-->
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: SchemaUpdate with JBoss - You cannot commit in cmt
PostPosted: Wed Nov 03, 2004 1:25 am 
Newbie

Joined: Wed Nov 03, 2004 12:33 am
Posts: 1
Hi,

There is a very similar question posted to this one
here
but since there was not reply I have posted the question again.

This exception is thrown when I an using a hsql datasource, bound to a jndi name, TestDS, that is defined inside jboss. I am using jboss 3.2.5, and the problem doesnot happen if i declare the datasource inside my hibernate file. The underlying code in net.sf.hibernate.tool.hbm2ddl.SchemaUpdate, does a commit inside a managed transaction which causes the connection wrapper to throw an exception inside jboss. Is there any way that this can be done?

Thanks

- Karamvir

Hibernate version:
2.1.6

Mapping documents:
Code:
This is the code in my hibernate-cfg.xml file
  <property name="connection.datasource">java:/TestDS</property>     
  <property name="hibernate.statement_cache.size">10</property>
  <property name="show_sql">false</property>
  <property name="use_outer_join">true</property>
  <property name="hibernate.hbm2ddl.auto">update</property>
  <property name="transaction.manager_lookup_class">net.sf.hibernate.transaction.JBossTransactionManagerLookup</property>
        <property name="transaction.factory_class">net.sf.hibernate.transaction.JTATransactionFactory</property>
      <property name="dialect">net.sf.hibernate.dialect.HSQLDialect</property>


Full stack trace of any exception that occurs:
Code:
16:01:00,499 INFO  [SchemaUpdate] Running hbm2ddl schema update
16:01:00,499 INFO  [SchemaUpdate] fetching database metadata
16:01:00,514 ERROR [SchemaUpdate] could not get database metadata
java.sql.SQLException: You cannot commit during a managed transaction!
        at org.jboss.resource.adapter.jdbc.BaseWrapperManagedConnection.jdbcComm
it(BaseWrapperManagedConnection.java:525)
        at org.jboss.resource.adapter.jdbc.WrappedConnection.commit(WrappedConne
ction.java:464)
        at net.sf.hibernate.tool.hbm2ddl.SchemaUpdate.execute(SchemaUpdate.java:
155)
        at net.sf.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.ja
va:198)
        at net.sf.hibernate.cfg.Configuration.buildSessionFactory(Configuration.
java:791)


Name and version of the database you are using:
HSQLDB


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.