-->
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.  [ 8 posts ] 
Author Message
 Post subject: autocommit value is ignored with non-managed EntityManager
PostPosted: Fri Jul 01, 2005 12:13 pm 
Pro
Pro

Joined: Fri Nov 19, 2004 5:52 pm
Posts: 232
Location: Chicago, IL
I am using the EntityManager in a J2SE environment. Everything seems to be working so far. However, I noticed that it seems to be ignoring the autocommit value the I provided as a property in persistence.xml. The logs says that it's using autocommit true, but, I set it to false. Is this a bug?

Hibernate version: hibernate-3.1alpha1, hibernate-annotations-3.1beta3, hibernate-entitymanager-3.1beta1

Mapping documents:

persistence.xml

Code:
<?xml version="1.0"
   encoding="UTF-8"?>
<entity-manager>
   <name>bb_bb60</name>
   <class>edu.uchicago.at.blackboard.persistence.entity.CalendarItem</class>
   <class>edu.uchicago.at.blackboard.persistence.entity.Course</class>
   <class>edu.uchicago.at.blackboard.persistence.entity.CourseMembership</class>
   <class>edu.uchicago.at.blackboard.persistence.entity.CourseRole</class>
   <class>edu.uchicago.at.blackboard.persistence.entity.User</class>
   <properties>
      <property name="hibernate.dialect"
         value="org.hibernate.dialect.Oracle9Dialect"/>
      <property name="hibernate.connection.driver_class"
         value="oracle.jdbc.driver.OracleDriver"/>
      <property name="hibernate.connection.url"
         value="jdbc:oracle:thin:@localhost:1522:BB60"/>
      <property name="hibernate.connection.username"
         value=""/>
      <property name="hibernate.connection.password"
         value=""/>
      <property name="hibernate.connection.autocommit"
         value="false"/>
   </properties>
</entity-manager>


Name and version of the database you are using: Oracle 9i

Debug level Hibernate log excerpt:

[exec] INFO: autocommit mode: true
[exec] Jun 29, 2005 4:38:49 PM org.hibernate.connection.DriverManagerConnectionProvider configure


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jul 06, 2005 3:41 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
No it's as per the spec.

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jul 06, 2005 4:04 pm 
Pro
Pro

Joined: Fri Nov 19, 2004 5:52 pm
Posts: 232
Location: Chicago, IL
The spec says that autocommit has to be true?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Aug 17, 2005 3:12 pm 
Pro
Pro

Joined: Fri Nov 19, 2004 5:52 pm
Posts: 232
Location: Chicago, IL
I don't understand why autocommit is supposed to be true...


Top
 Profile  
 
 Post subject:
PostPosted: Wed Aug 17, 2005 3:47 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
Some operations are allowed be executed "outside" a transaction and give back detached objects automatically.

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Wed Aug 17, 2005 3:49 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
I've relaxed this limitation though in CVS, you can override this value and not be spec compliant.
PS: This does not means that all operations will be done using autocommit to true

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Wed Aug 17, 2005 4:46 pm 
Pro
Pro

Joined: Fri Nov 19, 2004 5:52 pm
Posts: 232
Location: Chicago, IL
Thanks for the info. It makes more sense now that you mentioned the part about operations occurring outside of a transaction.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Aug 17, 2005 5:49 pm 
Pro
Pro

Joined: Fri Nov 19, 2004 5:52 pm
Posts: 232
Location: Chicago, IL
Also, on an unrelated note, thanks for creating org.hibernate.annotations.Table and Index. I started using it for creating indexes today and it's working great so far. You can't ask for much easier than simply having to set hbm2ddl.auto to create and have it create your entire schema for you. Thanks!


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