> Yes, you are right I checked in this version a few days ago. I'm not a
> DB-expert,
> so I don't now what's the best solution to get the 'validationQuery'
> from.
> 1. Use a hard-coded query from the Platform implementation class
> 2. Allow user to set the query within the jdbc-connection-descriptor
> in the repository file.
>
I'm not an expert either! But perhaps a hard coded default query from Platform which can be overridden by the user by a validationQuery attribute in jdbc-connection-descriptor or connection-pool?
In the meantime is there a way of getting hold of the PoolableConnectionFactory and setting the validation query directly in the application?
Thanks, John
Armin Waibel wrote:
Hi John,----- Original Message ----- From: "John Holman" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, December 04, 2002 2:23 PM Subject: OJB not robust against database or network failuresIf the database or network goes down when OJB already has connectionsinthe underlying pool, I've found that OJB does not recover when the database comes back up. I think this is because after an operationfailsthe invalid connection is returned to the pool rather than being destroyed and a new one created. Using the built-in connection pool ConnectionFactoryConPooledImpl I tried setting "testOnBorrow" to true in the connection-pool element of jdbc-connection-descriptor, but this did not help. Looking at thecode,ConnectionFactoryConPooledImpl.validateObject() just calls java.sql.Connection.isClosed(), and this does not seem to detect that the connection is invalid, at least for the JDBC drivers forPostgresqland Oracle that I'm using. Then, I noticed that the current CVS version (0.9.8) offers a ConnectionFactoryDBCPImpl option in OJB.properties. Using the Jakarta DBCP connection pool directly in another application, I've found that you can get robust behaviour by setting testOnBorrow to true andsettinga suitable validation query (e.g. select 0 from dual for Oracle). However, it seems that OJB sets the validation query to null. (Acommentsuggests this is because a suitable validation query would varybetweendatabase platforms). And there does not seem to be a configuration option to set/override the validation query ...Yes, you are right I checked in this version a few days ago. I'm not a DB-expert, so I don't now what's the best solution to get the 'validationQuery' from. 1. Use a hard-coded query from the Platform implementation class 2. Allow user to set the query within the jdbc-connection-descriptor in the repository file. Any comments welcome. regards, ArminI'd be grateful for any suggestions. John. -- To unsubscribe, e-mail:<mailto:[EMAIL PROTECTED]>For additional commands, e-mail:<mailto:[EMAIL PROTECTED]>-- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
-- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>