OK - I know the faq - if a connection is open then you should close it.

Here's the setup

Hibernate session factory set up as an MBean available over JNDI.

Stateful session bean - state includes amongst other things a hibernate session - 
retrieved from the factory which was fetched with a JNDI lookup. 

The bean has a 

private Session getSession() {
  if (session == null) {
    // get the factory and then from there get the session - set the session instance 
variable
   }

   return session;
}

In passivate/remove the session is closed - then set to null.

In activate/create the session is not opened - getSession() handles this when needed - 
no point in connecting if we're not going to use it

Everything works except I get the "Closing a connection for you. Close them yourself" 
message.

So - in the log I get (when I call bean.remove()):

Exception - Closing a connection. Close them yourself
ejbRemove called
closing session
session closed

So - I am trying to close the thing - during ejbRemove here - what is triggering the 
"Close them yourself" error (in other words - what has spotted an open connection 
after remove() but before ejbRemove())?

This is driving me nuts at the moment.

View the original post : 
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3850331#3850331

Reply to the post : 
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3850331


-------------------------------------------------------
This SF.net email is sponsored by: IT Product Guide on ITManagersJournal
Use IT products in your business? Tell us what you think of them. Give us
Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more
http://productguide.itmanagersjournal.com/guidepromo.tmpl
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to