-->
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.  [ 3 posts ] 
Author Message
 Post subject: JTA problems
PostPosted: Sun Aug 29, 2004 11:52 am 
Newbie

Joined: Sun Aug 29, 2004 11:45 am
Posts: 16
Hi,

I am trying to implement a simple session bean that calls persistent POJO. I gave the following parameters in hibernate.properties:


hibernate.connection.datasource VerdeDataSource
hibernate.transaction.factory_class net.sf.hibernate.transaction.JTATransactionFactory
hibernate.transaction.manager_lookup_class net.sf.hibernate.transaction.WeblogicTransactionManagerLookup
hibernate.dialect net.sf.hibernate.dialect.MySQLDialect

and yet I get an exception saying that the SchemaExporter is trying to perform Connection.commit even though I specificaly told it to use JTA.

The excetption is:


19:55:43,093 ERROR SchemaExport:165 - schema export unsuccessful
java.sql.SQLException: Cannot call Connection.commit in distributed transaction.
Transaction Manager will commit the resource manager when the distributed tran
saction is committed.
at weblogic.jdbc.wrapper.JTSConnection.commit(JTSConnection.java:509)
at net.sf.hibernate.tool.hbm2ddl.SchemaExport.execute(SchemaExport.java:
121)
at net.sf.hibernate.tool.hbm2ddl.SchemaExport.create(SchemaExport.java:8
4)
at net.sf.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.ja
va:198)
at net.sf.hibernate.cfg.Configuration.buildSessionFactory(Configuration.
java:768)



Can someone please help me to understand what I am doing wrong?

thanks


Top
 Profile  
 
 Post subject:
PostPosted: Sun Aug 29, 2004 11:59 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
Some databases dont let you do multiple DDL in a transaction, so Hibernate uses autocommit mode for schema export. You'll have to run schemaexport outside of the container txn.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Aug 29, 2004 12:01 pm 
Newbie

Joined: Sun Aug 29, 2004 11:45 am
Posts: 16
Does MySQL is one of these databases? Why do you think I did multi DDL?


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