barbara_l
April 25th, 2005, 05:30 PM
Hi all,
I have a school project where I must use the Entreprise Library's Data Application Block. I can't seem to "commit" multiple strong typed datatset in a single transaction. Actually, it's rolling back that does not work:
dbTransaction.dbConnection.BeginTransaction();
try {
db.UpdateDataSet(ds1, "Table1", ...);
db.UpdateDataSet(ds2, "Table2", ...);
db.UpdateDataSet(ds3, "Table3", ...);
dbTransaction.Transaction.Commit();
} catch (Exception ex) {
dbTransaction.Transaction.Rollback();
}
If there's an error while updating ds3, only ds2 will be rolled back. It's as if there's some sort of implicit transaction within Database.UpdateDataSet. Any suggestion? Is there a better way to "atomically" modify multiple database tables?
By the way, I'm unable to find any sort of info other than a parameter list for UpdateDataSet.
Thanks,
Barbara
I have a school project where I must use the Entreprise Library's Data Application Block. I can't seem to "commit" multiple strong typed datatset in a single transaction. Actually, it's rolling back that does not work:
dbTransaction.dbConnection.BeginTransaction();
try {
db.UpdateDataSet(ds1, "Table1", ...);
db.UpdateDataSet(ds2, "Table2", ...);
db.UpdateDataSet(ds3, "Table3", ...);
dbTransaction.Transaction.Commit();
} catch (Exception ex) {
dbTransaction.Transaction.Rollback();
}
If there's an error while updating ds3, only ds2 will be rolled back. It's as if there's some sort of implicit transaction within Database.UpdateDataSet. Any suggestion? Is there a better way to "atomically" modify multiple database tables?
By the way, I'm unable to find any sort of info other than a parameter list for UpdateDataSet.
Thanks,
Barbara