Database Stored Procedures

0cean

Member
May 25, 2017
841
58
0
N/A
අපි Database එකකින් data read, write කරනකොට හැම query එකක් සදහාම Stored Procedures එකක් ලියනවද..?

සාමාන්‍යයෙන් ලොකුවට කරන application එකක database එක්ක communicate කරන හැම වතාවකම Stored Procedures හරහා කරන්න ගියොත් එක කරදරයක් නේද...?

Security පැත්තෙන් හොදයි කියලා තේරුනාට දැන් නම මල ඇනයක් කියලත් හිතෙනවා.

උබල කොහොමද කරන්නේ..?
 

CloudX64

Well-known member
  • Nov 26, 2014
    9,383
    10,301
    113
    Winterfell
    nXLAsM6.png
     

    dilduda

    Member
    Jan 23, 2018
    3,928
    271
    0
    Dan nam godak than wala ORM use wenawa mama hitanne. But complex queries walata nam SP liwwata waradak na
     

    rcherath

    Well-known member
  • Sep 5, 2014
    991
    99
    63
    අපි Database එකකින් data read, write කරනකොට හැම query එකක් සදහාම Stored Procedures එකක් ලියනවද..?

    සාමාන්‍යයෙන් ලොකුවට කරන application එකක database එක්ක communicate කරන හැම වතාවකම Stored Procedures හරහා කරන්න ගියොත් එක කරදරයක් නේද...?

    Security පැත්තෙන් හොදයි කියලා තේරුනාට දැන් නම මල ඇනයක් කියලත් හිතෙනවා.

    උබල කොහොමද කරන්නේ..?

    Report wge complex ewta withri bn mm nm use krnne..
     

    owlX

    Well-known member
  • Jul 13, 2014
    1,321
    400
    83
    /usr/bin
    Stored Procedures are often written in a dialect of SQL (T-SQL for SQL Server, PL-SQL Oracle, and so on). That's because they add extra capabilities to SQL to make it more powerful. On the other hand, you have a ORM, let say NH that generates SQL.

    the SQL statements generated by the ORM doesn't have the same speed or power of writing T-SQL Stored Procedures. Here is where the dilemma enters: Do I need super fast application tied to a SQL Database vendor, hard to maintain or Do I need to be flexible because I need to target to multiple databases and I prefer cutting development time by writing HQL queries than SQL ones?

    Stored Procedure are faster than SQL statements because they are pre-compiled in the Database Engine, with execution plans cached. You can't do that in NH, but you have other alternatives, like using Cache Level 1 or 2.

    Also, try to do bulk operations with NH. Stored Procedures works very well in those cases. You need to consider that SP talks to the database in a deeper level.

    The choice may not be that obvious because all depends of the scenario you are working on.

    https://stackoverflow.com/questions/5346601/stored-procedures-and-orms