• 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
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

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: 40200
816
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 ]
 
I'm gonna teach you a lesson! Start by looking at this tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic