[jbossseam-issues] [JBoss JIRA] Created: (JBSEAM-3125) seam conversation and session.disconnect()

Florian Keusch (JIRA) jira-events at lists.jboss.org
Thu Jun 19 03:29:47 EDT 2008


seam conversation and session.disconnect()
------------------------------------------

                 Key: JBSEAM-3125
                 URL: http://jira.jboss.com/jira/browse/JBSEAM-3125
             Project: Seam
          Issue Type: Bug
          Components: Spring
         Environment: Seam 2.0.2.SP1
Spring 2.5.4
            Reporter: Florian Keusch


hi,

we use seam/spring/hibernate in our application. We detected a problem that database connections are not released after each request during seam conversations. Then if we have many conversations we can run out of connections.

Let me explain this issue a little bit more:
If a conversation starts a session is opened. This session is bound to the conversation and borrows a database connection from the pool.
After the request the session doesn't have to be closed necessarily, but the session should be disconnected (to release the connection).
What happens in the code (org.jboss.seam.ioc.spring.SeamManagedSessionFactoryBean) is that the session only is 'marked' as closed. 
Later seam recognizes that the conversation is still opened and the session will not be closed at the end of the request. The connection is therefore
not returned to the pool for many requests until the conversation ends.

For our case we fixed this problem by slightly changing the code of org.jboss.seam.ioc.spring.SeamManagedSessionFactoryBean (see the patch). We added code to disconnect the session

greetings fke


patch:

--- SeamManagedSessionFactoryBean.java	2008-06-19 09:17:09.152049800 +0200
+++ SeamManagedSessionFactoryBeanPatched.java	2008-05-27 20:16:46.000000000 +0200
@@ -165,8 +165,6 @@
          }
          if (method.getName().equals("close"))
          {
-			Session session = getSession();
-			session.disconnect();
             isClosed = true;
             return null;
          }
@@ -290,7 +288,6 @@
          if (method.getName().equals("close"))
          {
             log.debug("Closing Session Proxy.");
-			delegate.disconnect();
             closed = true;
             return null;
          }

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the seam-issues mailing list