-->
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: fetching database metadata fails
PostPosted: Wed Jun 01, 2005 4:30 pm 
Newbie

Joined: Wed Jun 01, 2005 4:04 pm
Posts: 1
I have five session factories for 5 different datasources. These are spread out over 3 different packages but all are initialized in the same manner. Four of them work correctly, but the fifth fails on the creation of the session factory with an error stating that you cannot commit within a transaction block while it tries to fetch the database metadata.

This behavior remains constant regardless of which configuration file and mappings I use. All configurations get beyond this problem if they are not initalized from this specific session factory.

Everything is running inside of jboss-3.2.7. All datasources have been configured with jboss.jca:service=LocalTxCM.

I'm completely confused and any help or pointers in the correct direction would be appreciated.

Hibernate version: 3.0.2/3.0.5

Full stack trace of any exception that occurs:
2005-06-01 15:59:55,825 [main] INFO [org.hibernate.connection.DatasourceConnectionProvider] Using datasource: java:jdbc/appDS
2005-06-01 15:59:55,825 [main] INFO [org.hibernate.tool.hbm2ddl.SchemaUpdate] Running hbm2ddl schema update
2005-06-01 15:59:55,825 [main] INFO [org.hibernate.tool.hbm2ddl.SchemaUpdate] fetching database metadata
2005-06-01 15:59:55,825 [main] ERROR [org.hibernate.tool.hbm2ddl.SchemaUpdate] could not get database metadata
java.sql.SQLException: You cannot commit during a managed transaction!
at org.jboss.resource.adapter.jdbc.BaseWrapperManagedConnection.jdbcCommit(BaseWrapperManagedConnection.java:525)
at org.jboss.resource.adapter.jdbc.WrappedConnection.commit(WrappedConnection.java:473)
at org.hibernate.tool.hbm2ddl.SchemaUpdate.execute(SchemaUpdate.java:120)
at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:260)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1055)
at net.vocalocity.appcenter.server.common.persistence.AppHibernateSessionFactory.<clinit>(AppHibernateSessionFactory.java:43)


AppHibernateSessionFactory:43

Code:
sessionFactory = new Configuration().configure( propertiesFile ).setProperty( Environment.HBM2DDL_AUTO,
                    "update" ).buildSessionFactory();



Databases:
Postgres 8.0 and Firebird 1.5


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.