Discussion:
[Hibernate] DBCP Connection Pooling
Dave Tilley
2003-08-28 12:41:03 UTC
Permalink
Ok, I am trying to get DBCP connection pooling working reliably (and not
dropping connections)...so far i am not having much success. After a
period of several hours of non-use, Hibernate will generate the familiar
ioExcpetion when the connections are timed out.

With that in mind, can someone give me a definitive list of DBCP params
that are required to be set to get this working, along with some
reasonable values???

Right now, i'm using:

"hibernate.dbcp.maxActive"
"hibernate.dbcp.maxIdle"
"hibernate.dbcp.maxWait"
"hibernate.dbcp.testOnBorrow" -> true
"hibernate.dbcp.testOnReturn" -> true
"hibernate.dbcp.validationQuery"

Do i need to set any others???? Are there any other tricks to getting
DBCP working with Hibernate that i need to know?

I have tried using C3P0 and also fooled around with this
autoreconnect=true URL, but i have given up on both of these options and
would like to get DBCP configured "the right way".


I would *really* appreciate some guidance with this -- i will be happy
to summarize what i learn and submit it for a FAQ or something if that
will help so others will have this well-documented online somewhere.


Many thanks,

-dave
Juozas Baliuka
2003-08-28 14:49:01 UTC
Permalink
Why do you need pooling if connections are time out. Close connection after
transaction and open a new one before transaction without any kind of
pooling. It must be very trivial to implement this kind of DataSource, a few
lines of code.
Post by Dave Tilley
Ok, I am trying to get DBCP connection pooling working reliably (and not
dropping connections)...so far i am not having much success. After a
period of several hours of non-use, Hibernate will generate the familiar
ioExcpetion when the connections are timed out.
With that in mind, can someone give me a definitive list of DBCP params
that are required to be set to get this working, along with some
reasonable values???
"hibernate.dbcp.maxActive"
"hibernate.dbcp.maxIdle"
"hibernate.dbcp.maxWait"
"hibernate.dbcp.testOnBorrow" -> true
"hibernate.dbcp.testOnReturn" -> true
"hibernate.dbcp.validationQuery"
Do i need to set any others???? Are there any other tricks to getting
DBCP working with Hibernate that i need to know?
I have tried using C3P0 and also fooled around with this
autoreconnect=true URL, but i have given up on both of these options and
would like to get DBCP configured "the right way".
I would *really* appreciate some guidance with this -- i will be happy
to summarize what i learn and submit it for a FAQ or something if that
will help so others will have this well-documented online somewhere.
Many thanks,
-dave
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
hibernate-devel mailing list
https://lists.sourceforge.net/lists/listinfo/hibernate-devel
Dave Tilley
2003-08-28 15:09:05 UTC
Permalink
Connections only time out late at night or over the weekend when the web
app in question is not being used.

Normally, the web app is used heavily during the day until about 9pm and
then no more until the next day.

I want to take advantage of pooling with Hibernate when the app is being
used heavily, but i do not want it to drop the connection afterwards
when it is idle.

I simply would like some good docs for how to properly set up DBCP with
Hibernate and the validation query. Such docs do not seem to exist on
the Hibernate site and various mailing list postings seem to contain
contradictory information about how to do this.


thanks,

-dave
Post by Juozas Baliuka
Why do you need pooling if connections are time out. Close connection after
transaction and open a new one before transaction without any kind of
pooling. It must be very trivial to implement this kind of DataSource, a few
lines of code.
Post by Dave Tilley
Ok, I am trying to get DBCP connection pooling working reliably (and not
dropping connections)...so far i am not having much success. After a
period of several hours of non-use, Hibernate will generate the familiar
ioExcpetion when the connections are timed out.
With that in mind, can someone give me a definitive list of DBCP params
that are required to be set to get this working, along with some
reasonable values???
"hibernate.dbcp.maxActive"
"hibernate.dbcp.maxIdle"
"hibernate.dbcp.maxWait"
"hibernate.dbcp.testOnBorrow" -> true
"hibernate.dbcp.testOnReturn" -> true
"hibernate.dbcp.validationQuery"
Do i need to set any others???? Are there any other tricks to getting
DBCP working with Hibernate that i need to know?
I have tried using C3P0 and also fooled around with this
autoreconnect=true URL, but i have given up on both of these options and
would like to get DBCP configured "the right way".
I would *really* appreciate some guidance with this -- i will be happy
to summarize what i learn and submit it for a FAQ or something if that
will help so others will have this well-documented online somewhere.
Many thanks,
-dave
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
hibernate-devel mailing list
https://lists.sourceforge.net/lists/listinfo/hibernate-devel
Juozas Baliuka
2003-08-28 15:29:03 UTC
Permalink
Looks like your settings are ok. But do not trust this feature too mutch. I
prefer no workarounds in pools
and to dissable all of this kind of "features".
BTW it is verry trivial to implement a pool and to do it right way. You need
to validate connection before the first operation in transaction only and
you can do it yourself (implement some trivial static method to get
connection from ThreadLocal, validate and put it to threadLocal if no
connection exists in current thread, unset threadlocal after
transaction/request/action )
Post by Dave Tilley
Connections only time out late at night or over the weekend when the web
app in question is not being used.
Normally, the web app is used heavily during the day until about 9pm and
then no more until the next day.
I want to take advantage of pooling with Hibernate when the app is being
used heavily, but i do not want it to drop the connection afterwards
when it is idle.
I simply would like some good docs for how to properly set up DBCP with
Hibernate and the validation query. Such docs do not seem to exist on
the Hibernate site and various mailing list postings seem to contain
contradictory information about how to do this.
thanks,
-dave
Post by Juozas Baliuka
Why do you need pooling if connections are time out. Close connection after
transaction and open a new one before transaction without any kind of
pooling. It must be very trivial to implement this kind of DataSource, a few
lines of code.
Post by Dave Tilley
Ok, I am trying to get DBCP connection pooling working reliably (and not
dropping connections)...so far i am not having much success. After a
period of several hours of non-use, Hibernate will generate the familiar
ioExcpetion when the connections are timed out.
With that in mind, can someone give me a definitive list of DBCP params
that are required to be set to get this working, along with some
reasonable values???
"hibernate.dbcp.maxActive"
"hibernate.dbcp.maxIdle"
"hibernate.dbcp.maxWait"
"hibernate.dbcp.testOnBorrow" -> true
"hibernate.dbcp.testOnReturn" -> true
"hibernate.dbcp.validationQuery"
Do i need to set any others???? Are there any other tricks to getting
DBCP working with Hibernate that i need to know?
I have tried using C3P0 and also fooled around with this
autoreconnect=true URL, but i have given up on both of these options and
would like to get DBCP configured "the right way".
I would *really* appreciate some guidance with this -- i will be happy
to summarize what i learn and submit it for a FAQ or something if that
will help so others will have this well-documented online somewhere.
Many thanks,
-dave
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
hibernate-devel mailing list
https://lists.sourceforge.net/lists/listinfo/hibernate-devel
Gavin King
2003-08-28 17:16:02 UTC
Permalink
I think its better to direct these questions to the dbcp guys; dbcp is, as
is usual for Jakarta stuff, extremely undocumented - but _someone_ must
know the answers to these questions.

I *don't*; I've ALWAYS used an appserver datasource in production.

If you can't get definitive answers from dbcp guys, try out c3p0 or
proxool. I *know* that Steve Waldman will support c3p0 properly.
Post by Dave Tilley
Connections only time out late at night or over the weekend when the web
app in question is not being used.
Normally, the web app is used heavily during the day until about 9pm and
then no more until the next day.
I want to take advantage of pooling with Hibernate when the app is being
used heavily, but i do not want it to drop the connection afterwards
when it is idle.
I simply would like some good docs for how to properly set up DBCP with
Hibernate and the validation query. Such docs do not seem to exist on
the Hibernate site and various mailing list postings seem to contain
contradictory information about how to do this.
thanks,
-dave
Post by Juozas Baliuka
Why do you need pooling if connections are time out. Close connection after
transaction and open a new one before transaction without any kind of
pooling. It must be very trivial to implement this kind of DataSource, a few
lines of code.
Post by Dave Tilley
Ok, I am trying to get DBCP connection pooling working reliably (and not
dropping connections)...so far i am not having much success. After a
period of several hours of non-use, Hibernate will generate the familiar
ioExcpetion when the connections are timed out.
With that in mind, can someone give me a definitive list of DBCP params
that are required to be set to get this working, along with some
reasonable values???
"hibernate.dbcp.maxActive"
"hibernate.dbcp.maxIdle"
"hibernate.dbcp.maxWait"
"hibernate.dbcp.testOnBorrow" -> true
"hibernate.dbcp.testOnReturn" -> true
"hibernate.dbcp.validationQuery"
Do i need to set any others???? Are there any other tricks to getting
DBCP working with Hibernate that i need to know?
I have tried using C3P0 and also fooled around with this
autoreconnect=true URL, but i have given up on both of these options and
would like to get DBCP configured "the right way".
I would *really* appreciate some guidance with this -- i will be happy
to summarize what i learn and submit it for a FAQ or something if that
will help so others will have this well-documented online somewhere.
Many thanks,
-dave
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
hibernate-devel mailing list
https://lists.sourceforge.net/lists/listinfo/hibernate-devel
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
hibernate-devel mailing list
https://lists.sourceforge.net/lists/listinfo/hibernate-devel
Serge Knystautas
2003-08-28 18:41:04 UTC
Permalink
Post by Gavin King
I think its better to direct these questions to the dbcp guys; dbcp is, as
is usual for Jakarta stuff, extremely undocumented - but _someone_ must
know the answers to these questions.
I *don't*; I've ALWAYS used an appserver datasource in production.
If you can't get definitive answers from dbcp guys, try out c3p0 or
proxool. I *know* that Steve Waldman will support c3p0 properly.
There are a lot of bugs with DBCP, but Dirk is working on applying
available patches to the current 1.X branch to get a better release out
there.

At the same time, there's been a lot of discussion about how to improve
the design for a major 2.0 rewrite. It's getting there, but we haven't
reached consensus on the 2.0 release.

If you can switch to another database connection pooler in the meantime,
you might want to give it a whirl. DBCP can work reasonably well, but
can be a pain to get configured right. Post any specific questions to
commons-***@jakarta.apache.org
--
Serge Knystautas
President
Lokitech >> software . strategy . design >> http://www.lokitech.com
p. 301.656.5501
e. ***@lokitech.com
Travis Reeder
2003-08-28 19:51:09 UTC
Permalink
Ya, c3p0 is better anyways. And Steve is always ready to help.

Travis
Post by Gavin King
I think its better to direct these questions to the dbcp guys; dbcp is, as
is usual for Jakarta stuff, extremely undocumented - but _someone_ must
know the answers to these questions.
I *don't*; I've ALWAYS used an appserver datasource in production.
If you can't get definitive answers from dbcp guys, try out c3p0 or
proxool. I *know* that Steve Waldman will support c3p0 properly.
Post by Dave Tilley
Connections only time out late at night or over the weekend when the web
app in question is not being used.
Normally, the web app is used heavily during the day until about 9pm and
then no more until the next day.
I want to take advantage of pooling with Hibernate when the app is being
used heavily, but i do not want it to drop the connection afterwards
when it is idle.
I simply would like some good docs for how to properly set up DBCP with
Hibernate and the validation query. Such docs do not seem to exist on
the Hibernate site and various mailing list postings seem to contain
contradictory information about how to do this.
thanks,
-dave
Post by Juozas Baliuka
Why do you need pooling if connections are time out. Close connection after
transaction and open a new one before transaction without any kind of
pooling. It must be very trivial to implement this kind of DataSource, a few
lines of code.
Post by Dave Tilley
Ok, I am trying to get DBCP connection pooling working reliably (and not
dropping connections)...so far i am not having much success. After a
period of several hours of non-use, Hibernate will generate the familiar
ioExcpetion when the connections are timed out.
With that in mind, can someone give me a definitive list of DBCP params
that are required to be set to get this working, along with some
reasonable values???
"hibernate.dbcp.maxActive"
"hibernate.dbcp.maxIdle"
"hibernate.dbcp.maxWait"
"hibernate.dbcp.testOnBorrow" -> true
"hibernate.dbcp.testOnReturn" -> true
"hibernate.dbcp.validationQuery"
Do i need to set any others???? Are there any other tricks to getting
DBCP working with Hibernate that i need to know?
I have tried using C3P0 and also fooled around with this
autoreconnect=true URL, but i have given up on both of these options and
would like to get DBCP configured "the right way".
I would *really* appreciate some guidance with this -- i will be happy
to summarize what i learn and submit it for a FAQ or something if that
will help so others will have this well-documented online somewhere.
Many thanks,
-dave
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
hibernate-devel mailing list
https://lists.sourceforge.net/lists/listinfo/hibernate-devel
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
hibernate-devel mailing list
https://lists.sourceforge.net/lists/listinfo/hibernate-devel
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
hibernate-devel mailing list
https://lists.sourceforge.net/lists/listinfo/hibernate-devel
.
Patrick Burleson
2003-08-29 10:12:07 UTC
Permalink
Post by Gavin King
I think its better to direct these questions to the dbcp guys; dbcp is, as
is usual for Jakarta stuff, extremely undocumented - but _someone_ must
know the answers to these questions.
So you to have noticed how most Jakarta projects aren't documented
well...funny, Torque's lack of good docs is what got me looking at
Hibernate. :-)

(Yes, I realize Torque is now apart of Apache DB, but it came from an even
worse documented project in Jakarta, Turbine)

<mini-rant>
And to those in those projects who say "If you don't like the docs, then
write some yourself", I have this to say: It's hard to explain to my boss
why I am staring at source code writing docs when I am supposed to be
trying to evaluate a product for our usage.

So in my case, bad docs get you dropped from contention pretty quickly. And
the core developers (or people with the time) or the only ones that can
write the documentation needed by normal people like me.
</mini-rant>

Thanks,
Patrick
Serge Knystautas
2003-08-29 12:41:01 UTC
Permalink
Post by Patrick Burleson
Post by Gavin King
I think its better to direct these questions to the dbcp guys; dbcp is, as
is usual for Jakarta stuff, extremely undocumented - but _someone_ must
know the answers to these questions.
So you to have noticed how most Jakarta projects aren't documented
well...funny, Torque's lack of good docs is what got me looking at
Hibernate. :-)
<mini-rant>
And to those in those projects who say "If you don't like the docs, then
write some yourself", I have this to say: It's hard to explain to my
boss why I am staring at source code writing docs when I am supposed to
be trying to evaluate a product for our usage.
Put the other shoe on... jakarta developers have the same set of
bosses/wives/children who don't accept explanations of needing to write
docs.

If anything, I think it's a tribute to how good of a job the Hibernate
committers are for doing this. As having been one of those lothesome
Jakarta committers, who has told so many people that if they want
something fix/doc'd to fix/doc it, I really appreciate how much Max,
Gavin, Christian, et al do.
Post by Patrick Burleson
So in my case, bad docs get you dropped from contention pretty quickly.
And the core developers (or people with the time) or the only ones that
can write the documentation needed by normal people like me.
This implies you'd prefer people didn't donate source code unless they
are prepared to doc it and meet other requirements. I would rather have
the code in contention and then quickly dropped rather than never had
that opportunity. I agree that value(docs) >= value(code), so you try
to help when you can.
--
Serge Knystautas
President
Lokitech >> software . strategy . design >> http://www.lokitech.com
p. 301.656.5501
e. ***@lokitech.com
Gavin King
2003-08-29 17:00:06 UTC
Permalink
I know I am a broken record on this:


Documenting your work is a part of writing code, just like writing unit
tests. Code without documentation is useless.


:)
Post by Patrick Burleson
Post by Gavin King
I think its better to direct these questions to the dbcp guys; dbcp is, as
is usual for Jakarta stuff, extremely undocumented - but _someone_ must
know the answers to these questions.
So you to have noticed how most Jakarta projects aren't documented
well...funny, Torque's lack of good docs is what got me looking at
Hibernate. :-)
(Yes, I realize Torque is now apart of Apache DB, but it came from an even
worse documented project in Jakarta, Turbine)
<mini-rant>
And to those in those projects who say "If you don't like the docs, then
write some yourself", I have this to say: It's hard to explain to my boss
why I am staring at source code writing docs when I am supposed to be
trying to evaluate a product for our usage.
So in my case, bad docs get you dropped from contention pretty quickly. And
the core developers (or people with the time) or the only ones that can
write the documentation needed by normal people like me.
</mini-rant>
Thanks,
Patrick
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
hibernate-devel mailing list
https://lists.sourceforge.net/lists/listinfo/hibernate-devel
Patrick Burleson
2003-08-29 22:24:16 UTC
Permalink
Post by Serge Knystautas
Put the other shoe on... jakarta developers have the same set of
bosses/wives/children who don't accept explanations of needing to write docs.
Actually, my boss gets quite irate if I don't document things so that
someone can come in and use our software. But I also see your point, as I
have a wife who would rather have me spending time with her than my
computer. :-)
Post by Serge Knystautas
If anything, I think it's a tribute to how good of a job the Hibernate
committers are for doing this. As having been one of those lothesome
Jakarta committers, who has told so many people that if they want
something fix/doc'd to fix/doc it, I really appreciate how much Max,
Gavin, Christian, et al do.
I think I my implicit idea was how much I appreciate how well Hibernate is
documented. I have found only one place where the docs didn't live up to
reality. (And I might even submit a patch to them to make it clearer)
Post by Serge Knystautas
This implies you'd prefer people didn't donate source code unless they are
prepared to doc it and meet other requirements. I would rather have the
code in contention and then quickly dropped rather than never had that
opportunity. I agree that value(docs) >= value(code), so you try to help
when you can.
I agree that having the opportunity to have access to code with no docs is
much better than that code having never been available. I greatly
appreciate the contributions of the Jakarta projects and use them a lot in
my personal projects. I just get very frustrated when there aren't docs or
the docs are wrong. Cause then convincing my boss that we should use it
becomes that much harder.

Patrick

Mark Woon
2003-08-28 17:30:09 UTC
Permalink
Post by Dave Tilley
I would *really* appreciate some guidance with this -- i will be happy
to summarize what i learn and submit it for a FAQ or something if that
will help so others will have this well-documented online somewhere.
Dave,

Here's a list of all the extra params I have to configure DBCP. It's
not formatted for hibernate.cfg.xml, but you'll get the idea:

<parameter>
<name>maxActive</name>
<value>5</value>
</parameter>
<parameter>
<name>maxIdle</name>
<value>3</value>
</parameter>
<parameter>
<name>maxWait</name>
<!-- should be less than your HTTP timeout -->
<value>500</value>
</parameter>
<parameter>
<name>defaulAutoCommit</name>
<value>false</value>
</parameter>
<parameter>
<name>validationQuery</name>
<value>select 1 from dual</value>
</parameter>
<!-- abandoned connections properties, time in seconds -->
<parameter>
<name>removeAbandoned</name>
<value>true</value>
</parameter>
<parameter>
<name>removeAbandonedTimeout</name>
<value>60</value>
</parameter>
<parameter>
<name>logAbandoned</name>
<value>true</value>
</parameter>


Hope that helps,
-Mark
Dave Tilley
2003-08-28 17:43:10 UTC
Permalink
Mark Woon,

Mucho Gracias! I will give this a try! Thank you muchly!!


Gavin - thanks for your help and comments. I will ask the DBCP folks for
more details per your suggestion, since their online doc is pretty thin.

I guess I was under the impression that lots of Hibernate users make use
of DBCP -- i see now maybe that is not so true! Later on, i will get to
use an appserver datasource for the web app in question, but for now,
we're not using one quite yet.


thanks again,


-dave
Post by Mark Woon
Post by Dave Tilley
I would *really* appreciate some guidance with this -- i will be happy
to summarize what i learn and submit it for a FAQ or something if that
will help so others will have this well-documented online somewhere.
Dave,
Here's a list of all the extra params I have to configure DBCP. It's
<parameter>
<name>maxActive</name>
<value>5</value>
</parameter>
<parameter>
<name>maxIdle</name>
<value>3</value>
</parameter>
<parameter>
<name>maxWait</name>
<!-- should be less than your HTTP timeout -->
<value>500</value>
</parameter>
<parameter>
<name>defaulAutoCommit</name>
<value>false</value>
</parameter>
<parameter>
<name>validationQuery</name>
<value>select 1 from dual</value>
</parameter>
<!-- abandoned connections properties, time in seconds -->
<parameter>
<name>removeAbandoned</name>
<value>true</value>
</parameter>
<parameter>
<name>removeAbandonedTimeout</name>
<value>60</value>
</parameter>
<parameter>
<name>logAbandoned</name>
<value>true</value>
</parameter>
Hope that helps,
-Mark
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
hibernate-devel mailing list
https://lists.sourceforge.net/lists/listinfo/hibernate-devel
Steven Citron-Pousty
2003-08-28 20:23:03 UTC
Permalink
I think this is a mysql issue.
Two clues as to how you should set things up
1) you need to set autoreconnect to true for MySQL in the url.
Please see
http://jakarta.apache.org/tomcat/tomcat-4.1-doc/jndi-datasource-examples-howto.html#Database%20Connection%20Pool%20(DBCP)%20Configurations
and look at the MySQL example, specifically,
<parameter>
<name>url</name>

<value>jdbc:mysql://localhost:3306/javatest?autoReconnect=true</value>
</parameter>

2) Look at this and see if this is your issue:
http://raibledesigns.com/page/rd/20030821
and look at the comments on the MySQL issue
Thanks,
Steve
Post by Dave Tilley
Ok, I am trying to get DBCP connection pooling working reliably (and not
dropping connections)...so far i am not having much success. After a
period of several hours of non-use, Hibernate will generate the familiar
ioExcpetion when the connections are timed out.
With that in mind, can someone give me a definitive list of DBCP params
that are required to be set to get this working, along with some
reasonable values???
"hibernate.dbcp.maxActive"
"hibernate.dbcp.maxIdle"
"hibernate.dbcp.maxWait"
"hibernate.dbcp.testOnBorrow" -> true
"hibernate.dbcp.testOnReturn" -> true
"hibernate.dbcp.validationQuery"
Do i need to set any others???? Are there any other tricks to getting
DBCP working with Hibernate that i need to know?
I have tried using C3P0 and also fooled around with this
autoreconnect=true URL, but i have given up on both of these options and
would like to get DBCP configured "the right way".
I would *really* appreciate some guidance with this -- i will be happy
to summarize what i learn and submit it for a FAQ or something if that
will help so others will have this well-documented online somewhere.
Many thanks,
-dave
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
Steve Bate
2003-08-28 22:18:04 UTC
Permalink
Post by Steven Citron-Pousty
I think this is a mysql issue.
Two clues as to how you should set things up
1) you need to set autoreconnect to true for MySQL in the url.
Please see
http://jakarta.apache.org/tomcat/tomcat-4.1-doc/jndi-datasource-examples-how
to.html#Database%20Connection%20Pool%20(DBCP)%20Configurations
Post by Steven Citron-Pousty
and look at the MySQL example, specifically,
<parameter>
<name>url</name>
<value>jdbc:mysql://localhost:3306/javatest?autoReconnect=true</value>
</parameter>
...
My application sets autoReconnect=true. It was recently converted to
Hibernate/DBCP from another O/R mapping engine. The autoReconnect option was
set to true in both versions of the application and only the
Hibernate/DBCP implementation has the connection timeout exceptions.

Steve
Steven Citron-Pousty
2003-08-29 16:56:03 UTC
Permalink
THen look at teh second link. Matt said he also set it to true. Make
sure you have the latest dev jdbc driver.
Steve
Post by Steven Citron-Pousty
Post by Steven Citron-Pousty
I think this is a mysql issue.
Two clues as to how you should set things up
1) you need to set autoreconnect to true for MySQL in the url.
Please see
http://jakarta.apache.org/tomcat/tomcat-4.1-doc/jndi-datasource-examples-how
to.html#Database%20Connection%20Pool%20(DBCP)%20Configurations
Post by Steven Citron-Pousty
and look at the MySQL example, specifically,
<parameter>
<name>url</name>
<value>jdbc:mysql://localhost:3306/javatest?autoReconnect=true</value>
</parameter>
...
My application sets autoReconnect=true. It was recently converted to
Hibernate/DBCP from another O/R mapping engine. The autoReconnect option was
set to true in both versions of the application and only the
Hibernate/DBCP implementation has the connection timeout exceptions.
Steve
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
Loading...