Re: Hibernate in JBoss: You cannot commit during a managed transaction!
From: Carlo Luib-Finetti (carlo.lf_at_onlinehome.de)
Date: 12/27/04
- Previous message: Ivan: "Re: RowSet vs Hibernate, JDO, etc."
- In reply to: Carlo LF: "Hibernate in JBoss: You cannot commit during a managed transaction!"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Mon, 27 Dec 2004 13:13:29 +0100
Carlo LF schrieb:
>>Are you getting an instance of Hibernate through JBoss or on your
>
> own.
>
> I bound the Hibernate SessionFactory into JBoss JNDI as Bauer/King
> adviced in their book 'Hibernate in Action', so I get a Hibernate
> Session by doing a lookup for the SessionFactory.
>
> If I understand the book from above, it says that Hibernate is smart
> enough to detect if it is running in a managed environment, where
> transactions are governed by a separate Transaction Manager (which,
> btw, you have to configure in Hibernate's global configuration). So I
> thought, that a statement which commits a Hibernate transaction,
> simply does nothing, but 'waits' until the JBoss TX manager commits
> the transaction.
>
> Carlo Luib-Finetti
I have found the solution at
http://forum.hibernate.org/viewtopic.php?t=935847
"You're trying to commit from within a bean running in a managed
environment (ie JBoss).
You need to change the transaction strategy so enable HB integration
with JTA
In hibernate.properties, change the factory_class property
hibernate.transaction.factory_class=net.sf.hibernate.transaction.JTATransactionFactory
Look into Hibernate in Action, Chapter 2, section 2.3.3 if you need
further information§
- Previous message: Ivan: "Re: RowSet vs Hibernate, JDO, etc."
- In reply to: Carlo LF: "Hibernate in JBoss: You cannot commit during a managed transaction!"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|