Hibernate sessions are not properly closed due to exceptions in REST API

  • 7010435
  • 10-Jul-2012
  • 19-Jul-2012

Environment

Novell Vibe 3.3

Situation

When unexpected exceptions occur in the REST API, it does not properly close the Hibernate session. Leaving the session open results in subsequent SOAP request failures.

The REST failures that result in unclosed sessions look like this in catalina.out:

May 20, 2012 9:11:29 PM com.sun.jersey.spi.container.ContainerResponse mapMappableContainerException
SEVERE: The RuntimeException could not be mapped to a response, re-throwing to the HTTP container

The subsequent SOAP failures look like this in catalina.out:

2012-05-20 21:11:29,783 WARN  [http-8443-3] [org.kablink.teaming.util.aopalliance.LoggingInterceptor] - ReflectiveMethodInvocation: public abstract
org.kablink.teaming.remoting.ws.model.FolderEntry
org.kablink.teaming.remoting.ws.service.folder.FolderService.folder_getEntry(java.lang.String,long,boolean,boolean); target is of class [org.kablink.teaming.remoting.ws.service.folder.attachments.FolderServiceImpl]
org.kablink.teaming.InternalException

Resolution

A patch is available to correct this problem for Novell Vibe 3.3. Please contact Novell Technical Support with reference to this TID and request the patch for your Vibe 3.3 site.

Additional Information

This has been fixed using a servlet filter, where we can open a hibernate session, forward the request on and close the session in a final block.  This ensures that it will also be closed.

This FTF is only applicable to Novell Vibe 3.3.