I am using 9.0.3 app server. I have a datasource with datasource class 'oracle.jdbc.pool.OracleConnectionCacheImpl' and JDBC Driver oracle.jdbc.driver.OracleDriver.
Our oracle database gets restarted every night, so there will be some staled connections in the pool.. and when I use the application after the database is restarted I get the following error:
java.sql.SQLException: OALL8 is in an inconsistent state.
I set the following connection attributes:
Is n't it automatically remove the staled connections and give fresh connections ?
Thanks for any inputs, Kiran
In 9.0.3 we did not have an option of stale pool checking, so if you restart your DB everynight, you will have to bounce the OC4J instance as well. This funcionality has been introduced in 10.1.2.x
Hope this answers your question.
Thanks Deepak for your response.
Can I use any other datasource class (like com.evermind.sql.DriverManagerDataSource) which has stale pool checking? Both options, bouncing OC4J or Upgrading to 10.1.3 are not feasible for me.
I am pretty sure that in 9.0.3 DriverManagerDataSource did not support stale connection checking. and I don't think OracleConnectionCacheImpl does either (at least there is no way through the config files).
The only option might be through code, i.e. your application checks for stale connections since there is some driver settings that you could modify through code. I would suggest posting your question in the JDBC forum and do mention that you are running on OC4J and is there a way in the driver that you could check for stale connections, through code.
Hope this helps.
Thanks for your inputs.
I wrote a patch, that will check the validity of connection before it gets used.. This code will keep getting the connection from the datasource until it gets a good connection.. Though it is not a very elegant solution.. atleast I can live with for now..