• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Hibernate error

 
Ajai
Ranch Hand
Posts: 198
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,


I get the below exception while performing select query in hibernate at the line

session.getTransaction().commit();


org.hibernate.transaction.JDBCTransaction Could not toggle autocommit
[3/3/06 19:12:57:340 SGT] 97d4d00 JDBCTransacti E org.hibernate.transaction.JDBCTransaction TRAS0014I: The following exception was logged java.sql.SQLException: DSRA9350E: Operation setAutoCommit is not allowed during a global transaction.

The exception comes only if I call hibernate DAO through EJB(and it also goes off if I remove this particular line) ,it does not appear if I call hibernate DAO from action without EJB.

Any reasons?

Thanks
 
Scott Johnson
Ranch Hand
Posts: 518
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hibernate is participating in the EJB container's JTA transaction.

Did you define "hibernate.transaction.factory_class" in your Hibernate config and, if so, what is the value?

If you don't want to participate in a JTA transaction, it should be
"org.hibernate.transaction.JDBCTransactionFactory" (which is the default if the parameter is not set.)
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic