-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 
Author Message
 Post subject: Rollback doesn't work on MySQL
PostPosted: Mon Jul 26, 2004 2:59 pm 
Newbie

Joined: Mon Jul 26, 2004 2:52 pm
Posts: 11
I am using MySQL 4.0.20a, and have created the database tables of type innoDB. I am using AUTO_INCREMENT as the id generation scheme for objects. I am doing the following:

JTA txn begin;

PersistenceObject obj = new PersistentObject();
obj.set.....;
getHibernateSession().save(obj); // this issues an SQL insert

JTA txn rollback();

I expect the rollback to undo the save/insert. This doesn't work if the id generation type is AUTO_INCREMENT. It seems to work if I use the the Hibernate id generation scheme.

Any ideas?
Suresh


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jul 27, 2004 11:47 am 
Beginner
Beginner

Joined: Wed Jun 23, 2004 12:37 pm
Posts: 20
I'd use native.

see Hib doc's 5.1.4...

"native
picks identity, sequence or hilo depending upon the capabilities of the underlying database. "


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jul 27, 2004 11:58 am 
Newbie

Joined: Mon Jul 26, 2004 2:52 pm
Posts: 11
I am actually using the native tag in the hbm.xml. I have also noticed that the updates are rolled back but objects newly created are not getting rolled back.

It is as though the JDBC connection has auto commit mode set to true though the connection is obtained in JTA transaction. FYI, I am using JOTM transaction mgr implementation, with the Enhydra StandardXADataSource implementation. I have noticed the JDBC connection returned by default has auto mode set to true. Since I am calling Hibernate Session FactoryImpl.openSession() I am expecting Hibernate to get the JDBC connection. Maybe this is an Enhydra issue.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jun 02, 2005 9:55 am 
Newbie

Joined: Tue Sep 21, 2004 1:33 pm
Posts: 5
Did anyone ever find a solution to this problem?

I'm using hibernate 3.0.5, spring 1.2.1, and mysql 4.0.20 and notice this same behavior when inserting/saving new objects using auto_increament.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 

All times are UTC - 5 hours [ DST ]


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

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.