none
transaction RRS feed

  • Question

  • Hello,

    I am implementing transaction in all the stored procedure in SQL Server 2008, but after having discussion with DBA and developer team, there arises a controversy that,where to implement the transaction, ie in Database or in front end codes.(This is a web Application in VB.NET)

    I want to know - Where is best to implement the transaction and what is the reason for that.

    Thanks in Advance,
    Ravi
    Friday, September 11, 2009 9:40 AM

Answers

  • Hi Ravi,

     

    I find a thread about this topic. Here is a discussion about this problem between the MVP and Eric.

    http://bytes.com/topic/c-sharp/answers/254365-c-transactions-v-sql-transactions

     

    You can get ideas form it to decide which one is more proper to your situation.

     

    If you want to know about transaction in SQL Server, you can get help from SQL Server Database Engine forum.

     

    If you have any questions or concerns, please update the thread and we will have a further discussion.

     

     

    Best Regards

    Yichun Feng

     

    • Marked as answer by Yichun_Feng Friday, September 18, 2009 1:33 AM
    Monday, September 14, 2009 9:20 AM
  • I believe it depends on specific needs. You cannot say that it has to be implemented on server side only or on client side only. If your stored procedure provides all the functionality it needs to complete the whole task as single transaction and does not depend on any other database calls from the client application, then you could open and close transaction inside of stored procedure. In some cases you need to call multiple stored procedures inside of single transaction, and in this case you would need to open transaction from the client code.
    Val Mazur (MVP) http://www.xporttools.net
    • Marked as answer by Yichun_Feng Friday, September 18, 2009 1:33 AM
    Tuesday, September 15, 2009 10:40 AM
    Moderator

All replies

  • Hi Ravi,

     

    I find a thread about this topic. Here is a discussion about this problem between the MVP and Eric.

    http://bytes.com/topic/c-sharp/answers/254365-c-transactions-v-sql-transactions

     

    You can get ideas form it to decide which one is more proper to your situation.

     

    If you want to know about transaction in SQL Server, you can get help from SQL Server Database Engine forum.

     

    If you have any questions or concerns, please update the thread and we will have a further discussion.

     

     

    Best Regards

    Yichun Feng

     

    • Marked as answer by Yichun_Feng Friday, September 18, 2009 1:33 AM
    Monday, September 14, 2009 9:20 AM
  • I believe it depends on specific needs. You cannot say that it has to be implemented on server side only or on client side only. If your stored procedure provides all the functionality it needs to complete the whole task as single transaction and does not depend on any other database calls from the client application, then you could open and close transaction inside of stored procedure. In some cases you need to call multiple stored procedures inside of single transaction, and in this case you would need to open transaction from the client code.
    Val Mazur (MVP) http://www.xporttools.net
    • Marked as answer by Yichun_Feng Friday, September 18, 2009 1:33 AM
    Tuesday, September 15, 2009 10:40 AM
    Moderator