This week's book giveaway is in the JavaFX forum.
We're giving away four copies of Introducing JavaFX 8 Programming and have Herbert Schildt on-line!
See this thread for details.
The moose likes JDBC and Relational Databases and the fly likes ora-00020 too many processes Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Introducing JavaFX 8 Programming this week in the JavaFX forum!
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "ora-00020 too many processes" Watch "ora-00020 too many processes" New topic

ora-00020 too many processes

Deepak Bala

Joined: Feb 24, 2006
Posts: 6662

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.

Please let me know what you think

SCJP 6 articles - SCJP 5/6 mock exams - More SCJP Mocks
Deepak Bala

Joined: Feb 24, 2006
Posts: 6662

Ah ! solved this one yesterday. I re establish connection for every loop and that releases all my resources. The batch runs well now.
I agree. Here's the link:
subject: ora-00020 too many processes
It's not a secret anymore!