Uploaded image for project: 'JBoss Enterprise Application Platform 4 and 5'
  1. JBoss Enterprise Application Platform 4 and 5
  2. JBPAPP-5156

Flag AUTO_CLOSE_SESSION is hard-coded in HAR (sar) deployer

    XMLWordPrintable

    Details

    • Affects:
      Release Notes
    • Release Notes Text:
      Hide
      The Hibernate Deployer (<classname>org.jboss.hibernate.jmx.Hibernate</classname>) controls .har deployments. In JBoss Enterprise Application Platform 4.3 CP08, the Hibernate Deployer's <literal>AUTO_CLOSE_SESSION</literal> and <literal>FLUSH_BEFORE_COMPLETION</literal> parameters were set to <literal>true</literal> by default. Customers migrating from older versions of Hibernate were encountering errors when <methodname>using session.close()</methodname> in finally blocks. "Session was already closed" and "Session is closed" errors occurred when deploying Hibernate archives (.har). In this release, <literal>AUTO_CLOSE_SESSION</literal> and <literal>FLUSH_BEFORE_COMPLETION</literal> are set to <literal>false</literal> by default. This prevents issues with backwards compatibility, and returns functionality to expected behavior.
      Show
      The Hibernate Deployer (<classname>org.jboss.hibernate.jmx.Hibernate</classname>) controls .har deployments. In JBoss Enterprise Application Platform 4.3 CP08, the Hibernate Deployer's <literal>AUTO_CLOSE_SESSION</literal> and <literal>FLUSH_BEFORE_COMPLETION</literal> parameters were set to <literal>true</literal> by default. Customers migrating from older versions of Hibernate were encountering errors when <methodname>using session.close()</methodname> in finally blocks. "Session was already closed" and "Session is closed" errors occurred when deploying Hibernate archives (.har). In this release, <literal>AUTO_CLOSE_SESSION</literal> and <literal>FLUSH_BEFORE_COMPLETION</literal> are set to <literal>false</literal> by default. This prevents issues with backwards compatibility, and returns functionality to expected behavior.
    • Release Notes Docs Status:
      Documented as Resolved Issue

      Description

      For some reason, the parameter AUTO_CLOSE_SESSION and FLUSH_BEFORE_COMPLETION is hard-coded as "true" on mbean org.jboss.hibernate.jmx.Hibernate, responsible of the .har deployments (Hibernate default to AUTO_CLOSE_SESSION is false).
      The fact is that it did not affect versions prior to 3.0.2 Hibernate (JBoss 4.0.2 and previous), but affect the current.
      People who have codes with session.close() in finally blocks, get the exception "Session was already close" and "Session is closed".
      Migration from earlier versions has been hard because of this.

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  stliu Strong Liu
                  Reporter:
                  alessandrolt Alessandro Lazarotti
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  1 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: