Yes, I forgot this DBCP "feature", validation query has no effect if
"testOnReturn" or "testOnBorrow" is not set.
"testOnReturn" is not very meaningfull, but you must set "testOnReturn" to
true if "validationQuery" is set.


> As a follow-up to my last message, DBCP still times out,
> even with the validationQuery config property set.  As an
> experiment, I modified DBCPConnectionProvider as follows:
>
> ObjectPool connectionPool = new GenericObjectPool(
> null,
> Integer.parseInt( props.getProperty(Environment.DBCP_MAXACTIVE) ),
> Byte.parseByte( props.getProperty(Environment.DBCP_WHENEXHAUSTED) ),
> Long.parseLong( props.getProperty(Environment.DBCP_MAXWAIT) ),
> Integer.parseInt( props.getProperty(Environment.DBCP_MAXIDLE) ),
>       true, true
> );
>
> Note the last 2 hardcoded true parameters, indicating to test the
connection
> on borrow and on return.  This solved my problem, and I no longer get
> timeouts.  Is there any chance of getting these as additional properties
> in the config file, say as hibernate.dbcp.testOnBorrow and
> hibernate.dbcp.testOnReturn?  Say the word, and I'll take a stab at
> submitting a patch.
>
> Thanks,
>
> Ken
>
>
>
> -----Original Message-----
> From: Ken Robinson
> Sent: Wednesday, January 08, 2003 11:05 AM
> To: 'Gavin King'; [EMAIL PROTECTED]
> Subject: RE: [Hibernate] Problem with Connection Pool Timeouts
>
>
> I updated to latest CVS to take advantage of this, but a
> few things still jumped out at me.  I noticed that
> testOnBorrow and testOnReturn are still marked as false
> inside DBCPConnectionHandler.  That being the case, when
> is the validationQuery actually being executed to check
> that my connections are still valid?  I'm not familiar
> with the workings of DBCP, and the documentation on their
> site is certainly less than optimal.
>
> -----Original Message-----
> From: Gavin King [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, January 07, 2003 3:42 PM
> To: Ken Robinson; [EMAIL PROTECTED]
> Subject: RE: [Hibernate] Problem with Connection Pool Timeouts
>
>
> From version 1.2.1, Hibernate supports a
>
> hibernate.dbcp.validationQuery
>
> config property.
>
> > -----Original Message-----
> > From: Ken Robinson [mailto:[EMAIL PROTECTED]
> > Sent: Wednesday, 8 January 2003 6:15 AM
> > To: [EMAIL PROTECTED]
> > Subject: [Hibernate] Problem with Connection Pool Timeouts
> >
> >
> > Hi all,
> >
> > I'm running into an issue where my pooled connections are
> > timing out.  I've tried both the Hibernate default pool as
> > well as DBCP.  Digging a little deeper, I see that when
> > Hibernate creates it's DBCP pool via a
> > PoolableConnectionFactory, it doesn't specify a validation query.
> >
> > As I see it, my options at this point are to:
> >
> > A - screw around with database settings to increase the
> > timeout values...not a preferred option B - Write my own
> > ConnectionProvider/Pool to take advantage of additional
> > properties C - Write a patch for Hibernate to take additional
> > properties on construction of the
> > GenericObjectPool/PoolableConnectionFactory.
> >
> > Am I missing anything here?
> >
> > Thanks,
> > Ken Robinson
> >
> >
> > -------------------------------------------------------
> > This SF.NET email is sponsored by:
> > SourceForge Enterprise Edition + IBM + LinuxWorld = Something
> > 2 See! http://www.vasoftware.com
> > _______________________________________________
> > hibernate-devel mailing list [EMAIL PROTECTED]
> > https://lists.sourceforge.net/lists/listinfo/hibernate-devel
> >
>
>
> ********** CAUTION - Disclaimer **********
> This message may contain privileged and confidential
> information. If you are not the intended recipient of this
> message (or responsible for delivery of the message to
> such person) you are hereby notified that any use,
> dissemination, distribution or reproduction of this message
> is prohibited. If you have received this message in error,
> you should destroy it and kindly notify the sender by reply
> e-mail. Please advise immediately if you or your employer
> do not consent to Internet e-mail for messages of this kind.
> Opinions, conclusions and other information in this
> message that do not relate to the official business of
> Expert Information Services Pty Ltd ("The Company")
> shall be understood as neither given nor endorsed by it.
>
> The Company advises that this e-mail and any attached
> files should be scanned to detect viruses. The Company
> accepts no liability for loss or damage (whether caused
> by negligence or not) resulting from the use of any
> attached files.
> **EIS******** End of Disclaimer **********
>
>
> -------------------------------------------------------
> This SF.NET email is sponsored by:
> SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
> http://www.vasoftware.com
> _______________________________________________
> hibernate-devel mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/hibernate-devel



-------------------------------------------------------
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com
_______________________________________________
hibernate-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/hibernate-devel

Reply via email to