Nested transactions with SQL connection object - how?

J

Julia B

Hi all

I'm really struggling here to work out how to do nested transactions with my
asp.net 2.0 web application, connected to a sql server database.

If I try to begin a second transaction on my transaction object I get the
error "SQL connection does not support parallel transactions".

Private _MyTrans As SqlTransaction
Public transCount As Integer

Public Sub startTransaction()
If _MyTrans Is Nothing Then
_MyTrans = conn.BeginTransaction
transCount = 1
Else
'this is where I get the error when the second transaction is
called
_MyTrans.Connection.BeginTransaction()
transCount += 1
End If
End Sub

I've googled and looked on help, but can't find any solution.

Is it possible, are there any examples anywhere?

PS. I know I can do nested transactions in stored procedures but I don't
want to do this because of the number of stored procedures I'll end up having
to generate.

Thanks

Julia
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top