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?
[ April 13, 2005: Message edited by: Paul W Lee ] [ April 13, 2005: Message edited by: Paul W Lee ]
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
Joined: Jun 19, 2003
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?
Paul [ April 13, 2005: Message edited by: Paul W Lee ]