• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Paul Clapham
  • Jeanne Boyarsky
  • Knute Snortum
Sheriffs:
  • Liutauras Vilda
  • Tim Cooke
  • Junilu Lacar
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Joe Ess
  • salvin francis
  • fred rosenberger

Approaches to roll back transactions

 
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 ]
 
author & internet detective
Posts: 39789
797
Eclipse IDE VI Editor Java
  • 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 ]
 
yeah, but ... what would PIE do? Especially concerning this tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!