[seam-issues] [JBoss JIRA] (JBSEAM-4006) Setting transaction.auto_close_session=true creates "Session is closed" warnings

Marek Novotny (JIRA) issues at jboss.org
Wed Apr 2 10:21:13 EDT 2014

     [ https://issues.jboss.org/browse/JBSEAM-4006?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Marek Novotny closed JBSEAM-4006.

    Resolution: Rejected

> Setting transaction.auto_close_session=true creates "Session is closed" warnings
> --------------------------------------------------------------------------------
>                 Key: JBSEAM-4006
>                 URL: https://issues.jboss.org/browse/JBSEAM-4006
>             Project: Seam 2
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 2.1.0.SP1
>         Environment: Seam 2.1.0.SP1
> Spring 2.5.5
> Seam Managed Persistence Context enabled
> JTA transaction Manager declared in Spring used.
> Persistence unit property :"hibernate.transaction.auto_close_session=true" set to true
>            Reporter: Luc DEW
> Setting the hibernate.transaction.auto_close_session property to true cause "Session is closed!;" warnings in Seam with Seam Managed Persistence Context.
> Because for instance, in the SeamPhaseListener's afterServletPhase(PhaseEvent event) the following code is executed:
> handleTransactionsAfterPhase(event);
>              if ( event.getPhaseId() == RENDER_RESPONSE )
>       {
>          afterRenderResponse(facesContext);
>       }
>       else if ( facesContext.getResponseComplete() )
>       {
>          afterResponseComplete(facesContext);
>       }
> If the current JSF phase is "after RENDER_RESPONSE" transaction is terminated (commited or rollbacked) by the handleTransactionsAfterPhaseMethod(event) method. If auto_close_session mode is set to true, the session is closed. But the afterRenderResponse(facesContext) is then executed. This method tries to change session's flush mode. Therefore, a "session is already closed" warning appears !
> It should be documented that setting this parameter to true can cause this kind of errors in Seam. But not setting this parameter to true can cause Hibernate sessions leakage if the persistence context not handled by Seam. Also, i am not sure that in any Seam use cases, the managed persistence context is closed properly. Some examples a method annotated @Observer("org.jboss.seam.postInitialization") with or @Async... 

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

More information about the seam-issues mailing list