- priority: 5 --> 9
Hello,
After using dbfit for a while I have started getting sql error: max open cursor exceeded. After analysis I have found out that dbfit does not close any jdbc resource. This is obviously wrong. Any time you use a jdbc resource you need to close it immediately after you are done with it. By not doing that you will run into problems. I have run into it cause I am reusing single connection for all tests. So dbfit kepts opening new resources (statements, result sets) without closing them: thus my database run out of resources available.
In order to fix that you need to review all classes where you create resource (statement, result set) and wrap this section with try/finally block. In finnally block you need to close the resource.
I have fixed the issue by doing above change in following places (but there can be other places which I am not using):
- dbfit.environment.OracleEnvironment.readIntoParams(String[], String)
- dbfit.fixture.Query.getDataTable()
- dbfit.fixture.Insert.doRows(Parse)
- dbfit.fixture.Execute.doRows(Parse)
This is very critical for me.
thanks