I have located where the hang exactly occurs. Below you will find a stacktrace using c3p0. It seems that it hangs when it tries to acquire a pooled connection.
Edit:
I have debugged a bit further and it looks like the opened connections are not returned to the pool. How could this be?
Code:
System Thread [RMI TCP Connection(29)-10.31.100.105] (Stepping)
BasicResourcePool.awaitAcquire(long) line: 968
BasicResourcePool.checkoutResource(long) line: 208
C3P0PooledConnectionPool.checkoutPooledConnection() line: 260
PoolBackedDataSource.getConnection() line: 94
ComboPooledDataSource.getConnection() line: 521
LocalDataSourceConnectionProvider.getConnection() line: 80
ConnectionManager.openConnection() line: 417
ConnectionManager.getConnection() line: 144
BatchingBatcher(AbstractBatcher).prepareQueryStatement(String, boolean, ScrollMode) line: 105
CriteriaLoader(Loader).prepareQueryStatement(QueryParameters, boolean, SessionImplementor) line: 1561
CriteriaLoader(Loader).doQuery(SessionImplementor, QueryParameters, boolean) line: 661
CriteriaLoader(Loader).doQueryAndInitializeNonLazyCollections(SessionImplementor, QueryParameters, boolean) line: 224
CriteriaLoader(Loader).doList(SessionImplementor, QueryParameters) line: 2145
CriteriaLoader(Loader).listIgnoreQueryCache(SessionImplementor, QueryParameters) line: 2029
CriteriaLoader(Loader).list(SessionImplementor, QueryParameters, Set, Type[]) line: 2024
CriteriaLoader.list(SessionImplementor) line: 94
SessionImpl.list(CriteriaImpl) line: 1533
CriteriaImpl.list() line: 283
DeviceDao(BaseDaoHibernate<T,TID,TSearchCommand>).getBySearchCommand(TSearchCommand) line: 111
DeviceManagerImpl.getDeviceBySearchCommand(DeviceSearchCommand) line: 469
DeviceManagerImpl.identifyDeviceByUserAgent(String) line: 72
GeneratedMethodAccessor54.invoke(Object, Object[]) line: not available
DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: 25
Method.invoke(Object, Object...) line: 585
AopUtils.invokeJoinpointUsingReflection(Object, Method, Object[]) line: 335
ReflectiveMethodInvocation.invokeJoinpoint() line: 181
ReflectiveMethodInvocation.proceed() line: 148
RemoteInvocationTraceInterceptor.invoke(MethodInvocation) line: 68
ReflectiveMethodInvocation.proceed() line: 170
JdkDynamicAopProxy.invoke(Object, Method, Object[]) line: 176
$Proxy1.identifyDeviceByUserAgent(String) line: not available
NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) line: not available [native method]
NativeMethodAccessorImpl.invoke(Object, Object[]) line: 39
DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: 25
Method.invoke(Object, Object...) line: 585
RemoteInvocation.invoke(Object) line: 179
DefaultRemoteInvocationExecutor.invoke(RemoteInvocation, Object) line: 33
RmiServiceExporter(RemoteInvocationBasedExporter).invoke(RemoteInvocation, Object) line: 76
RmiServiceExporter(RmiBasedExporter).invoke(RemoteInvocation, Object) line: 72
RmiInvocationWrapper.invoke(RemoteInvocation) line: 62
GeneratedMethodAccessor51.invoke(Object, Object[]) line: not available
DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: 25
Method.invoke(Object, Object...) line: 585
UnicastServerRef.dispatch(Remote, RemoteCall) line: 294
Transport$1.run() line: 153
AccessController.doPrivileged(PrivilegedExceptionAction<T>, AccessControlContext) line: not available [native method]
TCPTransport(Transport).serviceCall(RemoteCall) line: 149
TCPTransport.handleMessages(Connection, boolean) line: 460
TCPTransport$ConnectionHandler.run() line: 701
Thread.run() line: 595