Version 2

    Besides the usual "check your finally blocks, that every statement and resultset is closed" hint, this error could be caused by the connection pooling.

     

    Even when you close all of your statements/resultsets, the pool could be to slow in returning the close order to the database, which often happens during multiple open/close calls in a loop. The solution to this is on one hand to reduce the "idle-timeout" and on the other hand to configure a "prepared-statement-cache-size" in your oracle datasource configuration file (oracle-ds.xml). The second option should be less than the number of open cursors allowed on your database (typically 100, it is configured by your DBA in the ora.ini file on the server).