Transaction Isolation

Transaction Isolation

Old forum URL: forums.lhotka.net/forums/t/4962.aspx


renegrin posted on Tuesday, June 10, 2008

When using CSLA.NET 3.0x set the the  DataPortal_Fetch, DataPortal_Update and DataPortal_Insert to set the transaction isolation methods to ReadUncommitted?

At the connection level?

Set cn = New ADODB.Connection
cn.IsolationLevel = adXactReadUncommitted
cn.open()

Or should I begin a transaction explicitly?

cn.Open()
   SqlTransaction tr = cn.BeginTransaction(IsolationLevel.ReadUncommitted);

I can just set it at the database level as well by turning on READ_COMMITED_SNAPSHOT database option.

use master;
go
ALTER DATABASE pubs
SET READ_COMMITTED_SNAPSHOT ON

So many choices, which is best?

Renegrin

 

JoeFallon1 replied on Wednesday, June 11, 2008

There is no "best" solution.

I happen to use your middle case. I use manual transactions and manage them by passing them around using the LocalContext. See this thread for sample code:

http://forums.lhotka.net/forums/24090/ShowThread.aspx#24090

Copyright (c) Marimer LLC