Using DatabaseSpecific.RetrievalProcedures for transactions

Posts   
 
    
SamRose
User
Posts: 20
Joined: 24-Jun-2008
# Posted on: 24-Mar-2009 14:28:48   

Hi all,

I was wondering if I used the following code it would be run in a valid transaction.



try
 _DataAccessAdapter.StartTransaction(IsolationLevel.Serializable, "CreateIncidentCaseEntity")

DatabaseSpecific.RetrievalProcedures.SPNAME(PARAM1,_DataAccessAdapter)
_DataAccessAdapter.Commit()

Catch ex As Exception
_DataAccessAdapter.Rollback()
 End Try


so that it would be able to be commited or rolled back depending on errors or not?

Cheers Sam

MTrinder
User
Posts: 1461
Joined: 08-Oct-2008
# Posted on: 24-Mar-2009 20:43:04   

Yes it will.

You can verify this for yourself by watching the generated SQL using SQL Profiler.

Matt