-->
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.  [ 1 post ] 
Author Message
 Post subject: Switching auto-commit off
PostPosted: Mon Feb 15, 2010 4:48 pm 
Newbie

Joined: Mon Jan 18, 2010 6:07 am
Posts: 4
I'm having a problem with what seems like a trivial configuration setting.

I am currently using Hibernate as the persistence framework alongside Spring (using org.springframework.orm.hibernate3.support.HibernateDaoSupport). Initially auto-commit was adequate for my need however now my system has grown to require proper transaction management.

I decided I wanted to simplify development and use annotation based transaction management to reduce the size of my configuration files.

To cut a long story short I have attempted to switch the auto-commit more to off by setting the hibernate property in my application-context.xml file as below.

Code:
<bean id="sessionFactory" class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
   <property name="dataSource"><ref local="dataSource"/></property>

   <property name="annotatedClasses">
      <list><!-- my domain entity classes --></list>
   </property>
   <property name="hibernateProperties">
      <props>
         <prop key="hibernate.default_schema">APP</prop>
         <prop key="hibernate.dialect">org.hibernate.dialect.DerbyDialect</prop>
         <prop key="hibernate.show_sql">false</prop>
         <prop key="hibernate.connection.autocommit">false</prop>
      </props>
   </property>
</bean>


however, even after commenting out my transaction manager definition any calls such as save/saveOrUpdate successfuly update my database when the the changes should not have been committed.

As far as I know the hibernate setting should work, my datasource is also set to autocommit false by default and I do not know of any other settings in my setup which would affect my configuration.

Any help would be greatly appreciated.

Setup: Spring, Hibernate, Glassfish V2.1, JavaDB


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

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.