I am running into a problem with very many open cursors.
I am running close to 200 database queries very quickly to fetch data. The database is configured to handle up to 300 open cursors at a time.
Over time, I am getting stack traces saying that I have reached the maximum amount of open cursors possible.
I searched many times and have not found a close method on JPA's Query method. I am using hibernate's implementation of JPA, and that has no way to close the cursor, if I cast down to the hibernate implementation class. Has anyone ever ran into this problem before?
Another thing I am doing is opening and closing a new EntityManager around each call...so roughly 200 EntityManagers are being created and destroyed for this operation...it seems very wasteful to me.
Can anyone help?
Joined: Apr 11, 2004
The problem seems to go away if I manually invoke the garbage collector.
This is a hack solution...there must be a better way to solve this.