-->
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.  [ 2 posts ] 
Author Message
 Post subject: rollback doesn't work in MySQL?
PostPosted: Wed Jul 14, 2004 5:37 pm 
Newbie

Joined: Fri May 21, 2004 5:30 pm
Posts: 3
Hi guys,
I am using hibernate 2.1.4 and MySQL 4.0.20d for Windows.
My question: why do the track objects are saved in the database although the transaction is rollback?

Configuration cfg = new Configuration();
cfg.addClass(Track.class);
SessionFactory factory = cfg.buildSessionFactory();
Session session = factory.openSession();
Transaction tx = session.beginTransaction();

Track track = new Track("Szła dzieweczka do laseczka","mp3/szla.mp3");
session.save(track);

track = new Track("Ala ma kota", "mp3/alakot.mp3", new Date(),
new Date(), (short) 12);
session.save(track);

tx.rollback();
session.close();
factory.close();


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jul 14, 2004 5:53 pm 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
are you using innodb tables? You should


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 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.