-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Hibernate JNDI 3CP0 not sharing connections with webapps
PostPosted: Thu May 23, 2013 5:05 pm 
Newbie

Joined: Thu Nov 20, 2008 7:49 pm
Posts: 4
Location: Salt Lake City
I have a JNDI datasource defined in my tomcat/conf/context.xml that shares connections with all of our web applications. I have just written a new part of two of the applications using Hibernate 4.1.10. I have a listener in my web.xml that creates the SessionFactory. Since webapps can't share the factory, the two applications each have a SessionFactory. The problem I'm having is that when I start up tomcat each of the applications with hibernate grab 30 connections. When I start running a web applications that uses straight JDBC connections it also grabs 30 connections. If I run the applications without the hibernate modifications, then there are a total of 30 connections that are shared between all applications. What do I need to do to get Hibernate to share its pool of connections with the other apps?

I'm running Tomcat 6, Hibernate 4.1.10, Postgresql 8.3, and C3P0.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.