We have a batch process that executes every so seconds and this morning i found that the batch was throwing ora-00020 exception every time it tries to execute a query. I have a doubt on which method to adopt to make sure such errors dont happen again. Here are my approches
1. Make the batch process obtain a connection every time and then close it when it is done.
2. Make the batch process obtain a single connection and execute my queries based on this connection. I will not close this connection for every loop. This connection would be obtained only once and the infinite loop uses it.
I think i would be better off with approach number 1. That way if the database is down at any point of time the batch need not be started again. Also... if say i obtain a connection everytime like
conn = something.getConnection();
and i dont close this connection i am bound to get ORA-00020 arent I ?
The solution is not to increase the number of processes because we already have a number that is phenominally high than needed so i am pretty sure the program is screwed up some where.