 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
kei Guest
|
Posted: Mon May 22, 2006 5:14 am Post subject: How to save several dataset in a transaction (all rollback o |
|
|
I try to use the follow method:
Database.setAutoCommit(false);
try{
// some change made on ds;
database.saveChanges(ds);
throw new Exception("test rollback()");
database..commit();
}
catch(Exception ex){
Database.rollback();
}
finally{
Database.setAutoCommit(true);
}
but I find that even I set autocommit to false, when
database.savechanges(ds) is called, the change is already written to
database (I check using SQL analyzer), and even there is exception and
rollback() is run, the record has not really rollback(), so the change is
still written to the database table, why??
Is it necessary to use
database.saveChanges(ds, false); // use false parameter instead of
database.saveChanges(ds) only??
Thx!! |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|