• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

autocommit setting on JBoss 3.2, Hibernate, Spring

 
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I have a webapp whose persistence layer is provided by hibernate. the sessionfactory's datasource is configured via spring and is configured in a standard oracle -ds.xml file.

in our spring configuration file for the hibernate session factory, i have this property set:

<property name="hibernateProperties">
<props>
...
<prop key="hibernate.connection.autocommit">false</prop>
...
</props>
</property>

however, when i execute session.commit() in my DAO implementation, i get the following exception. i've used this same pattern in apps deployed on tomcat and weblogic, so i'm thinking this might be a jboss 3.2.6 issue. i didnt see a bug entry in jboss's JIRA. anyone know if I'm missing a config setting somewhere?

thanks in advance,
t


Caused by: java.sql.SQLException: You cannot commit with autocommit set!
at org.jboss.resource.adapter.jdbc.BaseWrapperManagedConnection.jdbcCommit(BaseWrapperManagedConnection.java:527)
at org.jboss.resource.adapter.jdbc.WrappedConnection.commit(WrappedConnection.java:473)
at com.cauldron.framework.dao.hibernate.SpringHibernateDAOSupportImpl.createObject(SpringHibernateDAOSupportImpl.java:408)
... 54 more
 
Ranch Hand
Posts: 85
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I had a similar problem before. The connection obtained from JBoss managed datasource has autocommit set to true by default. So, you need to set it to false manually in your code where you get the connection from the datasource.

Hope this helps.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic