File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Object Relational Mapping and the fly likes hibernate JTA transaction: Failed to instantiate TransactionFactory Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "hibernate JTA transaction: Failed to instantiate TransactionFactory" Watch "hibernate JTA transaction: Failed to instantiate TransactionFactory" New topic
Author

hibernate JTA transaction: Failed to instantiate TransactionFactory

Paul W Lee
Ranch Hand

Joined: Jun 19, 2003
Posts: 40
hi folks,

I'm using hibernate 2.0 and JTATransaction as transaction strategy, and the underlying database is oracle 9.

In the hibernate.cfg.xml:
<property name="dialect">net.sf.hibernate.dialect.Oracle9Dialect</property>
<property name="show_sql">false</property>
<property name="transaction.factory_class">net.sf.hibernate.transaction.JTATransaction</property>
<property name="connection.username">username</property>
<property name="connection.url">jdbc : oracle : thin: @ ip : port : sid</property>
<property name="connection.password">password</property>
<property name="connection.driver_class">oracle.jdbc.driver.OracleDriver</property>

There is this error:
06:09:43,984 INFO [TransactionFactoryFactory] Transaction strategy: net.sf.hibernate.transaction.JTATransaction
06:09:44,000 ERROR [TransactionFactoryFactory] Failed to instantiate TransactionFactory
java.lang.InstantiationException: net.sf.hibernate.transaction.JTATransaction

Quite confused what happens, and how to heal it?

Thanks!


Paul

[ April 13, 2005: Message edited by: Paul W Lee ]
[ April 13, 2005: Message edited by: Paul W Lee ]
Steven Bell
Ranch Hand

Joined: Dec 29, 2004
Posts: 1071
I'm not a hibernate expert, but from my understanding the JTATransaction should be JTATransactionFactory. Also you should be fine by not even having that line there. Hibernate will use the default JDBCTransactionFactory that is fine as long as you are not using mulitple data sources. From what I've read the JTA Transactions actually come with more overhead that you just don't need if you are using a single db.
Paul W Lee
Ranch Hand

Joined: Jun 19, 2003
Posts: 40
Hi Steven,

Thank you for your reply.

Actually, i'm quite new to hibernate, and not yet clear for some basice concepts. The first problem is how to execute database operations using hibernate.

According to my understanding, there are 2 (or 3) ways to connect to database: one is to use JDBC connection pool; the other is JTA transaction. The project is under development and it seems difficult to do unit test if using JDBC connection pool because every time it has to deploy java classes on weblogic (or other web server).

Do you think my idea is correct?




Regards,

Paul
[ April 13, 2005: Message edited by: Paul W Lee ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: hibernate JTA transaction: Failed to instantiate TransactionFactory