#33 Too many open cursors when processing large include .sql

open
nobody
None
5
2010-09-08
2010-09-08
Marcelo F. Ochoa
No

Hi:
I found that if need to process a large .sql file for example with many insert sentences the tag include fails with too-many open cursors in Oracle databases.
The problem is that in net.sourceforge.sqlunit.handlers.IncludeHandler the Statement are not closed after their are used, for example:
line 156:
Statement statement = conn.createStatement();
statement.execute(stmt);
ConnectionRegistry.safelyCommit(connectionId, conn);
I added a close() method and now it works properly:
Statement statement = conn.createStatement();
statement.execute(stmt);
statement.close();
ConnectionRegistry.safelyCommit(connectionId, conn);
similar problem is in methods:
executeCallableSQL
executeOtherSQL
for cs and ps variables.
Best regards, Marcelo.

Discussion