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

holmes.j do-not-reply at jboss.com
Wed Sep 13 17:19:19 EDT 2006


So we've just decided to jump on the Hibernate/EJB3 bandwagon.  We were using EJB2.1 before.  I'm not really familiar with much of that as I just joined, but it looks nasty.  

Anyways, I've got Hibernate working in our test environment, following the CaveatEmptor example rather closely.

However, once deployed to JBoss, it's just not working.  I'm trying to use JTA to manage the transactions, but something somewhere isn't making the connection it needs too.

In our SessionBean, once the Dao is called, it decides it wants to throw an Exception with the message: "load is not valid without active transaction".  I'm betting it's root is a NPE, but I haven't navigated that far deep.

To make sure it wasn't the SessionBean that was causing the problem, I just threw a line in a jsp to get the Dao.  That comes back with a org.hibernate.TransactionException: could not register synchronization, who's root cause is a NPE from the transaction in JTATransaction.registerSynchronization() (line 306)

So, I don't really know how to get this stuff to work.  Below is my hibernate.properties file.  

  | hibernate.c3p0.min_size=5
  | hibernate.c3p0.max_size=20
  | hibernate.c3p0.timeout=1800
  | hibernate.c3p0.max_statements=50
  | 
  | hibernate.current_session_context_class=jta
  | hibernate.transaction.factory_class=org.hibernate.transaction.JTATransactionFactory
  | hibernate.transaction.manager_lookup_class=org.hibernate.transaction.JBossTransactionManagerLookup
  | hibernate.transaction.flush_before_completion=true
  | hibernate.transaction.auto_close_session=true
  | 
  | hibernate.cache.provider_class=org.hibernate.cache.NoCacheProvider
  | hibernate.show_sql=true
  | hibernate.format_sql=true
  | hibernate.generate_statistics=true
  | 
  | hibernate.bytecode.use_reflection_optimizer=false
  | hibernate.bytecode.provider=javassist
  | 

Any idea on what else I have to do to get transactions to work with JTA?

Thanks,
Jason

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

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



More information about the jboss-user mailing list