Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Approaches to roll back transactions

 
Jeppe Sommer
Ranch Hand
Posts: 270
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

When I want to roll back a transaction I use this method:

conn.setAutoCommit( false );
....
if ( error )
conn.rollback();

The problem is that I use a mySQL database and have to convert the tables from myISAM to innoDB! I don�t like that, because it gives you some problem when making a copy of the database and open the new database, then all the innoDB tables can�t open again!

Because of that I will hear if there are other ways to make roll back transactions? What about executeBatch()?
[ April 10, 2005: Message edited by: Jeppe Fjord ]
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34179
340
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jeppe,
Take a look at XA drivers. They use two phase commit to roll back transactions across multiple databases.
 
Jeppe Sommer
Ranch Hand
Posts: 270
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
MySQL does not support XA or JTA...(except mySQL 5.0)

(http://e-docs.bea.com/wls/docs90/jdbc_admin/third_party_drivers.html)
[ April 10, 2005: Message edited by: Jeppe Fjord ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic