Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Transactions with Child-Parent-Grandparent
Message
Information générale
Forum:
ASP.NET
Catégorie:
The Mere Mortals .NET Framework
Titre:
Transactions with Child-Parent-Grandparent
Versions des environnements
Environment:
C# 1.1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
MS SQL Server
Divers
Thread ID:
01053421
Message ID:
01053421
Vues:
54
I am using the Mere Mortals business objects to control transactions with related business objects.
1) In my test I relate a child business object to a parent business object and relate the parent to a grandparent business object.
2) I get an empty dataset into each of the business objects
3) I add a new record to each of the datasets
4) I start a transaction on the grandparent object with TransactionBegin()
5) I call SaveDataSet() on the grandparent, which automatically calls it on the parent and child objects
6) I rollback the transaction by calling TransactionRollback() on the grandparent.

I would expect this to rollback the new records in all 3 tables. It does rollback on the grandparent and parent tables, but leaves the new record in the child table.

I thought maybe the transaction was only good in 2 generations (the parent and grandparent) so I tried to simultaneously start another transaction at the parent level so I could rollback both transactions in my test. But I get an error saying that the connection cannot have multiple transactions open in it.

Any thoughts?

Matthew J. Price
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform