This is a migrated thread and some comments may be shown as answers.

Disable transaction wrapping when making stored procedure calls

1 Answer 76 Views
Development (API, general questions)
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Chirag
Top achievements
Rank 1
Chirag asked on 01 Oct 2015, 08:49 AM

Hi, 

I noticed that whenever I make stored procedure calls to the database (sql sever), DataAccess wraps the session in a transaction (begin transaction), is there a way to disable it from automatically using a transaction?

I have Isolationlevel set to readuncommitted in the backend configuration.

ReadWithoutTransaction doesn't seem to be doing anything

 Thanks

 

1 Answer, 1 is accepted

Sort by
0
Pavel Uzunov
Telerik team
answered on 06 Oct 2015, 08:57 AM
Hello Chirag,
 
Telerik Data Access wraps the store procedures calls in a transaction automatically, this is done in that way as it actually enlists the the SP call in the transaction that would content some other CUD operations. If something fails if will rollback even the SP. If you need to invoke only the SP you should commit/rollback the transaction immediately after the Domain Method call with SaveChanges or ClearChanges.

There are several methods exposed by the OpenAccessContext that could be useful for handling transactions (look at this article). 

The ReadWithoutTransaction works only for the LINQ queries and it is turned on by default.

 So, I can recommended you to handling transactions as you want or to use a LINQ query if it is acceptable for you. I could be more helpful if you can give us more information about your actual scenario.

I hope this information helps.

Regards,
Pavel Uzunov
Telerik
 
Check out the latest announcement about Telerik Data Access vNext as a powerful framework able to solve core development problems.
Tags
Development (API, general questions)
Asked by
Chirag
Top achievements
Rank 1
Answers by
Pavel Uzunov
Telerik team
Share this question
or