DBTransaction question

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,
I have some code like this :

DBTransaction = DBConnection.BeginTransaction()

Assuming I don't book keep the return from this call ,
How do I
1) determine if there is a DBTransaction pending on this DBConnection and
2 ) if there is , what is the DBTransaction .


thanks
-chaz
 
Hi Chaz,

We cannot get the pending transactions from a DBConnection object. So you
have to keep the object reference, so that you can commit or rollback the
transaction.

Kevin Yu
Microsoft Online Community Support

============================================================================
==========================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
============================================================================
==========================

(This posting is provided "AS IS", with no warranties, and confers no
rights.)
 
Kevin,
Surely the DBTransaction is available at some level . Is this an oversight
on the design of the DBConnection object ?
It seems arbitrary that a function such as DBConnection.CommitTransaction()
has been left out , is there some underlying architectural reason for this?
thanks,
Chaz
 
Hi Chaz,

In my opinion, it's not an oversight. You have to keep the reference to
DBTransactions yourself. Is there any reason that you cannot keep it in
your code?

Also, Commit is performed on a single Trasaction, not on a DBConnection.
Some provider support parellel transactions, so this cannot be used on a
DBConnection object.

Kevin Yu
Microsoft Online Community Support

============================================================================
==========================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
============================================================================
==========================

(This posting is provided "AS IS", with no warranties, and confers no
rights.)
 
Back
Top