I had a need to patch some code around oracle output cursors that are closed when returned. basically, trying to get results out of a closed cursor results in an SQLException being thrown. SQLUnit treats this as an exception and the test case fails. there is an argument that says that is correct behavior. but there is an argument (mine) that says a closed cursor is very similar to an empty data set which could be ok.
the net of it is that there is no way to stop that that exception from happening. so, i hacked in some code to allow the Cursor Closed exception and create an empty ResultSetBean.
if you'd like, let me know if/how you would like my changes. they are pretty minor.
thanks,
pat
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Sure, thanks, I will patch the code if you send me a patch (or the classes which have changed, with details).
The only question (and possible reservation) is what exception you are catching to find that the cursor is closed. Is this an Oracle JDBC only exception? If so, this will be a problem for non-Oracle users (the code will not compile for them).
-sujit
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Sujit,
I had a need to patch some code around oracle output cursors that are closed when returned. basically, trying to get results out of a closed cursor results in an SQLException being thrown. SQLUnit treats this as an exception and the test case fails. there is an argument that says that is correct behavior. but there is an argument (mine) that says a closed cursor is very similar to an empty data set which could be ok.
the net of it is that there is no way to stop that that exception from happening. so, i hacked in some code to allow the Cursor Closed exception and create an empty ResultSetBean.
if you'd like, let me know if/how you would like my changes. they are pretty minor.
thanks,
pat
Hi Pat,
Sure, thanks, I will patch the code if you send me a patch (or the classes which have changed, with details).
The only question (and possible reservation) is what exception you are catching to find that the cursor is closed. Is this an Oracle JDBC only exception? If so, this will be a problem for non-Oracle users (the code will not compile for them).
-sujit