Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Nested Transactions
Message
Information générale
Forum:
ASP.NET
Catégorie:
ADO.NET
Titre:
Nested Transactions
Divers
Thread ID:
00708456
Message ID:
00708456
Vues:
55
I am trying to get nested transactions to work using 2 sql command objects
SqlTransaction myTrans = SqlConn.BeginTransaction();

HeaderCmd = poh.InsertCommand;
HeaderCmd.Transaction = myTrans;

if(poh.UpdateInsertdata(HeaderCmd, Header))
{
     DetailsCmd = pod.InsertCommand;
     DetailsCmd.Transaction = myTrans;

     if(pod.UpdateInsertData(DetailsCmd, Details))
        GoodTrans= true;
}
if(GoodTrans)
    myTrans,Commit();
else
    myTrans.Rollback();
Both of these command share the same transaction.

I am forcing an error to occur during the detail portion of the code. But when I hit
myTrans.Rollback() I am greeted with:
The ROLLBACK TRANSACTIOn request has no corresponding BEGIN TRANSACTION.
Anyone have a clue?

Doug
Douglas Osborne
Don't spend your life just wishing - http://www.AllGiftRegistry.com
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform