This is a migrated thread and some comments may be shown as answers.
Transactions Help
1 Answer 16 Views
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Brian Mains
Top achievements
Rank 1
Brian Mains asked on 24 Jul 2012, 07:39 PM
Hello,

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

create procedure CreateSomeRecords
(
   . . .
)

as

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.

Thanks.

1 Answer, 1 is accepted

Sort by
0
Ivailo
Telerik team
answered on 27 Jul 2012, 03:44 PM
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,
Ivailo
the Telerik team
OpenAccess ORM Q2'12 Now Available! Get your hands on all the new stuff.
Tags
General Discussions
Asked by
Brian Mains
Top achievements
Rank 1
Answers by
Ivailo
Telerik team
Share this question
or