-->
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: flush() does not commit
PostPosted: Thu Oct 07, 2004 11:24 pm 
Newbie

Joined: Thu Jun 10, 2004 9:49 pm
Posts: 3
Hibernate version:
2.16
Code between sessionFactory.openSession() and session.close():

AttributeType type = new AttributeType();
type.setType(AttributeType.STRING);
session.save(type);
session.flush();

Name and version of the database you are using:
mysql 4.0.21

The generated SQL (show_sql=true):
insert into AttributeType (Type) values (?)

MySQL log
SET autocommit=1
Query SET autocommit=0
Query SHOW VARIABLES LIKE 'tx_isolation'
Query insert into AttributeType (Type) values ('String')

And that's it. it does not commit though it sets autocommit=0.

Transaction is not set at all, but hibernate seems to set "autocommit=0" itself.

Thanks in advance.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Oct 08, 2004 1:50 am 
Hibernate Team
Hibernate Team

Joined: Thu Dec 18, 2003 9:55 am
Posts: 1977
Location: France
Quote:
is not set at all, but hibernate seems to set "autocommit=0" itself.


you're right,
you have to manage beginTrans et commit, it has been said 50 000 times, it's better, even in jdbc, not to use autocommit.

_________________
Anthony,
Get value thanks to your skills: http://www.redhat.com/certification


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.