[jboss-user] [Persistence, JBoss/CMP, Hibernate, Database] - Re: TransactionException: could not register synchronization

holmes.j do-not-reply at jboss.com
Thu Sep 14 13:37:21 EDT 2006


I'm going crazy trying to figure this out.  

So I was reading the Hibernate docs again and came across this ...

anonymous wrote : 
  |  With CMT, transaction demarcation is done in session bean deployment descriptors, not programatically, hence, the code is reduced to:
  | 
  | // CMT idiom
  |  Session sess = factory.getCurrentSession();
  | 
  |  // do some work
  |  ...
  | 
  | In a CMT/EJB even rollback happens automatically, since an unhandled RuntimeException thrown by a session bean method tells the container to set the global transaction to rollback. This means you do not need to use the Hibernate Transaction API at all with BMT or CMT, and you get automatic propagation of the "current" Session bound to the transaction.
  | 

So I was write, it is supposed to automagically create the Transaction.  I was stepping through my session bean, and it looks like it did create a transaction, it's just that it hasn't started the transaction.  This then throws the HibernateException because the transaction is not in a valid state.

Anybody know how to use EJB Session Beans w/ Hibernate, JTA and all this wonderful stuff?

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3971643#3971643

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3971643



More information about the jboss-user mailing list