I'm using an in-memory instance of derby to test my application, mainly the EJB
communication with the DB. My EJBs are calling stored procedures. For
testing,
I've stubbed out Java based stored procedures in Derby. I have narrowed down
my
tests to those invoking one of these stored procedures as the one(s) that make
JUnit hang. Having prepared a callable statement cstmt and calling execute on
it, Derby magically executes the java code for the procedure. Perhaps my
notes/tracing below will point out something to those more knowledgeable than I
am, about what might be causing the problem.
TIA,
TT
*****************************************************************
This run, the tests all run as expected, but JUnit hangs
- Notice different ResultSet types on either side of the call
Though the object id is the same on both
*****************************************************************
INSIDE EJB JAR CODE
Using:
- InitialContext ctx = new InitialContext();
- DataSource ds = (DataSource) ctx.lookup("openejb:Resource/WTSHARE");
- Connection conn = ds.getConnection();
---------------------------------------------
isResultSet = cstmt.execute();
INSIDE DERBY JAVA BASED STORED PROCEDURE CODE
Using:
- Connection conn =
DriverManager.getConnection("jdbc:default:connection");
---------------------------------------------
rs: org.apache.derby.impl.jdbc.embedresultse...@9f8c02
rs: org.apache.derby.impl.jdbc.embedresultse...@18a577d
rs: org.apache.derby.impl.jdbc.embedresultse...@1a96bae
BACK inside ejb jar code
---------------------------------------------
isResultSet: true
rs: org.apache.commons.dbcp.delegatingresult...@9f8c02
rs: org.apache.commons.dbcp.delegatingresult...@18a577d
rs: org.apache.commons.dbcp.delegatingresult...@1a96bae
*****************************************************************
This run, the tests fail, because execute reports no ResultSets
*****************************************************************
INSIDE EJB JAR CODE
Using:
- InitialContext ctx = new InitialContext();
- DataSource ds = (DataSource) ctx.lookup("openejb:Resource/WTSHARE");
- Connection conn = ds.getConnection();
---------------------------------------------
isResultSet = cstmt.execute();
INSIDE DERBY JAVA BASED STORED PROCEDURE CODE
Using: (attempting to use the same OpenEJB style connection this time)
- InitialContext ctx = new InitialContext();
- DataSource ds = (DataSource) ctx.lookup("openejb:Resource/WTSHARE");
- Connection conn = ds.getConnection();
---------------------------------------------
rs: org.apache.commons.dbcp.delegatingresult...@663ec
rs: org.apache.commons.dbcp.delegatingresult...@1a48515
rs: org.apache.commons.dbcp.delegatingresult...@101a4f3
BACK inside ejb jar code
---------------------------------------------
isResultSet: false