Uploaded image for project: 'Application Server 7'
  1. Application Server 7
  2. AS7-2433

Hibernate session is getting closed during JPA transaction

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Major
    • 7.1.0.Beta1
    • 7.0.2.Final
    • JPA / Hibernate
    • None
    • Hide

      1) unzip attached project
      2) maven install
      3) start JBoss 7.0.2.Final with ./standalone.bat --server-config=standalone-preview.xml
      4) deploy target/SessionClosedProblem-1.0-SNAPSHOT.jar
      5) call the testDao on http://localhost:8080/SessionClosedProblem-1.0-SNAPSHOT/DaoTestService?wsdl
      6) Do the web service call twice
      7) Observe the server log.
      8) An exception is thrown: javax.ejb.EJBTransactionRolledbackException: Session is closed!
      9) For more info see this thread: http://community.jboss.org/message/634095#634095

      Show
      1) unzip attached project 2) maven install 3) start JBoss 7.0.2.Final with ./standalone.bat --server-config=standalone-preview.xml 4) deploy target/SessionClosedProblem-1.0-SNAPSHOT.jar 5) call the testDao on http://localhost:8080/SessionClosedProblem-1.0-SNAPSHOT/DaoTestService?wsdl 6) Do the web service call twice 7) Observe the server log. 8) An exception is thrown: javax.ejb.EJBTransactionRolledbackException: Session is closed! 9) For more info see this thread: http://community.jboss.org/message/634095#634095

    Description

      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.

      Attachments

        Activity

          People

            smarlow1@redhat.com Scott Marlow
            dev0_jira Lasse Wallentin (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: