Sorry, I should have explained the firewall problem.  The firewall has a
timeout value of 1 hour for any connections going through it.  If the
application if left alone for over an hour, the connections in the connect
pool become dead because the firewall drops the connection from the tomcat
server to the database box.  After I get the validation query warning
message, the pool won't create a new connection.

The validation query did work with the problem of when oracle drops the
connection, ojb will create a new connection.

What happens is that the web page just sits there and spins while
downloading the page.  This is because it can't query the database anymore,
but it doesn't get an error, it just keeps trying.

Personally I think its crazy to have firewalls between a application server
and a database box, but this is what I have to work with :)

Thanks in advance,
Graham

-----Original Message-----
From: Armin Waibel [mailto:[EMAIL PROTECTED]
Sent: January 16, 2004 4:53 AM
To: OJB Users List
Subject: Re: Validation Query [OJB 0.9.9]


Hi Graham,

Graham Lounder wrote:
> Hello All,
>
> I've been using OJB on many projects and find it makes my life a whole lot
> easier.  I currently have a project that has over 1500+ unique logins each
> day.  I've got two tomcat servers setup, each with a connection pool found
> below.  There is a firewall between the tomcat box and the database box.
It
> seems like the connection pool is only making one connection and after an
> hour, the connection gets discarded with the following message:
>
> 15 Jan 16:03:21 WARN  [Thread-58] ConnectionFactoryPooledImpl - Validation
> query for connection failed, discard connection. Message:
>  Io exception: Connection timed out
>

This warning is ok. It signals that the validation query fails. The
ConnectionFactoryPooledImpl class now returns false in
validateObject(Object obj) method of commons-pool. Now the commons-pool
is responsible to handle this stuff. Connection validate false --> close
connection and try the next from the pool or create a new one --> pass
it to ConnectionFactoryPooledImpl validateObject method .... and so on
till we found a valid connection.

> I think the connection is dying on the firewall, but shouldn't the
> validation query create a new connection?
>

yes, but this stuff is handled by commons-pool not by
ConnectionFactoryPooledImpl. How does the whole stack trace look like?

> I'm using ojb 0.9.9.  Is there anything I can do to get a reliable
> connection pool?  Should I upgrade to the latest version of OJB or can
> anyone see a problem with my settings?
>
We are near final 1.0 version. So I recommend to wait until 1.0 was
released (Should be out sooner or later ;-) - think in a few days).
But I think the problem is another one.

regards,
Armin

>
> <jdbc-connection-descriptor
>     jcd-alias="default"
>     default-connection="true"
>     platform="Oracle"
>     jdbc-level="2.0"
>     driver="oracle.jdbc.driver.OracleDriver"
>     protocol="jdbc"
>     subprotocol="oracle"
>
>   <connection-pool
>     maxActive="41"
>     maxIdle="10"
>     maxWait="20000"
>     minEvictableIdleTimeMillis="-1"
>     numTestsPerEvictionRun="10"
>     testOnBorrow="true"
>     testOnReturn="false"
>     testWhileIdle="true"
>     whenExhaustedAction="1"
>     validationQuery="select 1 from dual"
>   />
> </jdbc-connection-descriptor>
>
>
>
> Thanks,
> Graham
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to