Transactions Help

2 posts, 0 answers
  1. Brian Mains
    Brian Mains avatar
    485 posts
    Member since:
    Oct 2008

    Posted 24 Jul 2012 Link to this post


    So what I'm reading is that I cannot have a stored procedure defines an explicit transaction as such:

    create procedure CreateSomeRecords
       . . .


    begin transaction
    begin try
        insert into X (..) values (..)
        insert into X (..) values (..) 

        commit transaction
    end try
    begin catch
        rollback transaction

        insert into errorlogs (..) values ( .. sql error info .. )
    end catch

    My app would call this function from within the OpenAccess context.  I read that OpenAccess wraps its request around a transaction, so stored procedure transactions don't work.  Is that correct?  I couldn't find anything definitive, so I'm posting this question directly.

  2. Ivailo
    Ivailo avatar
    318 posts

    Posted 27 Jul 2012 Link to this post

    Hello Brian,

    Yes, OpenAccess ORM does use a transaction when calling the database. In case nested transactions are supported by the backend you are using, this shouldn't be a problem. If they are not supported, you can isolate those calls using ADO.NET as a workaround.

    Do not hesitate to get back to us if you have other questions or if you need any clarifications.

    Kind regards,
    the Telerik team
    OpenAccess ORM Q2'12 Now Available! Get your hands on all the new stuff.
Back to Top