-->
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.  [ 21 posts ]  Go to page Previous  1, 2
Author Message
 Post subject:
PostPosted: Wed Aug 27, 2003 2:55 pm 
Pro
Pro

Joined: Tue Aug 26, 2003 1:24 pm
Posts: 213
Location: Richardson, TX
I'm trying to handle the pooling issue by setting up tomcat to provide a (hopefully pooling) DataSource in jndi, and just have hibernate use that.

I just got done using that, with MySQL as the database. I had periodic closed connections, usually after several hours of inactivity, but not always. (Sometimes it would fail in the same way during normal use) I had autoReconnect=true and even set some MySQL timeouts to high values (like interactive_timeout = 100000 and wait_timeout = 100000) but no luck.

I'm now testing C3P0 to see if the problem persists.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Aug 27, 2003 3:03 pm 
Pro
Pro

Joined: Tue Aug 26, 2003 1:24 pm
Posts: 213
Location: Richardson, TX
How do you explicitly configure connection validation??? Is this documented on the website?

Ya, Gavin, I second the question. Do we need to subclass
Code:
ConnectionProvider
?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 28, 2003 2:03 pm 
CGLIB Developer
CGLIB Developer

Joined: Thu Aug 28, 2003 1:44 pm
Posts: 1217
Location: Vilnius, Lithuania
All of pool implementations I have ever saw have too much of wokarounds(background threads, automagic, abandoning ).
The most of statements in this paper is not true, DBCP has too much of "features", It is possible to fix DBCP (remove workarounds), but looks like this automagic stuff has too mutch of fans and community will break open source implementation anyway.

jhoeller wrote:
After all, isn't it peculiar that we still have to worry about a proper open source *connection pool* implementation in 2003? One could naively assume that such basic stuff would have been around for a long time already - stable and battle-proven.

Of course, one can always resort to the J2EE container's pool implementation. But it would be really nice to have a stable pool implementation for lightweight local usage within applications. I still hope that Commons DBCP will become that.

Juergen


Top
 Profile  
 
 Post subject:
PostPosted: Fri Aug 29, 2003 4:31 am 
Beginner
Beginner

Joined: Fri Aug 29, 2003 4:26 am
Posts: 26
Location: Germany, Dortmund
As far as I understand all pooling solutions have problems.
What's about using the the pool of the JDBC driver like Oracle?

_________________
Bye
Kai


Top
 Profile  
 
 Post subject:
PostPosted: Fri Aug 29, 2003 2:50 pm 
CGLIB Developer
CGLIB Developer

Joined: Thu Aug 28, 2003 1:44 pm
Posts: 1217
Location: Vilnius, Lithuania
Kai wrote:
As far as I understand all pooling solutions have problems.
What's about using the the pool of the JDBC driver like Oracle?

I use very trivial decorators for jdbc resources and it woks with any pool implementation (it works for me without pooling too)


Top
 Profile  
 
 Post subject:
PostPosted: Fri Aug 29, 2003 3:48 pm 
Newbie

Joined: Fri Aug 29, 2003 3:31 pm
Posts: 6
This works fine for me:

--cut--
# connection pool

hibernate.dbcp.maxActive 100
hibernate.dbcp.whenExhaustedAction 1
hibernate.dbcp.maxWait 120000
hibernate.dbcp.maxIdle 10

## prepared statement cache

hibernate.dbcp.ps.maxActive 100
hibernate.dbcp.ps.whenExhaustedAction 1
hibernate.dbcp.ps.maxWait 120000
hibernate.dbcp.ps.maxIdle 100

# optional query to validate pooled connections:

hibernate.dbcp.validationQuery select 1 from hibernate_unique_key
hibernate.dbcp.testOnBorrow true
hibernate.dbcp.testOnReturn false
--cut--

mysql 4.x, hibernate 2.0.2.

Note, that validationQuery might not work on something other than mysql, so maybe you will need to change it.

Also note you don't need autoreconnect feature in connection url. As i remember, after reconnecting driver gives you old connection but it will be read-only. Any attempt to write something will lead to exception.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 21 posts ]  Go to page Previous  1, 2

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.