[
https://issues.jboss.org/browse/AS7-2433?page=com.atlassian.jira.plugin.s...
]
Scott Marlow edited comment on AS7-2433 at 11/4/11 5:11 PM:
------------------------------------------------------------
http://pastie.org/2812071 shows how the Hibernate session is getting closed at the end of
the first invocation (as part of the transaction cleanup).
The pattern for transaction scoped entity managers that are used in a JTA transaction, is
that the underlying persistence provider is associated with the JTA transaction on first
use. The same provider will continue to be used while the JTA transaction is in progress.
At the Transaction end, the entity manager is closed.
The above would be expected, if you were using a transaction scoped entity manager and
also had obtained Hibernate session from the entity manager (from the
em.unwrap(Session.class)).
I'll look to see if we can improve this case where there is no entity manager used by
the application, in way that wouldn't disturb the above...
was (Author: smarlow):
http://pastie.org/2812071 shows how the Hibernate session is getting closed at the end
of the first invocation (as part of the transaction cleanup).
The pattern for transaction scoped entity managers that are used in a JTA transaction, is
that the underlying persistence provider is associated with the JTA transaction on first
use. The same provider will continue to be used while the JTA transaction is in progress.
At the Transaction end, the entity manager is closed.
The above would be expected, if you were using a transaction scoped entity manager and
also had obtained Hibernate session from the entity manager (from the
em.unwrap(Session.class)).
I'll look to see if we can improve this case where there is no entity manager used by
the application, in way that would disturb the above...
Hibernate session is getting closed during JPA transaction
----------------------------------------------------------
Key: AS7-2433
URL:
https://issues.jboss.org/browse/AS7-2433
Project: Application Server 7
Issue Type: Bug
Components: JPA / Hibernate
Affects Versions: 7.0.2.Final
Environment: Windows 7
Reporter: Lasse Wallentin
Assignee: Scott Marlow
Attachments: server.log, Session Closed Problem.zip
We have a simple setup where a web service is using a Dao to store data in a Database.
The Dao uses an injected persistence context. The dao is in turn injected into the
webservice as a simple EJB.
This is a classic setup we have used extensively on JBoss AS 5.1.
However on JBoss 7.0.2.Final the hibernate session is closed on the second call to the
web service.
I have created a simple maven project containing the problem. It uses the standard
datasource from the standalone-preview configuration.
I will attach the project and server.log containing all relevant exceptions.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see:
http://www.atlassian.com/software/jira