Hi Ravi, I have now the JDBC spy trace and have following observing related to the prep statement. It seems that the framework is actively closing the statement after the SQL error that looks pretty ok to me. Beforehand the prep statement should remain available, but for any reason it is not.
Below see an extract of the spy trace. Maybe you see something meaningful: spy([ACTIVE] (2010/11/23 09:13:23.726)>> Connection[1].prepareStatement(String sql, int resultSetType, int resultSetConcurrency) spy([ACTIVE] (2010/11/23 09:13:23.726)>> Connection[1]sql = SELECT t0.version, t0.FAILURE_COUNT, t0.RUNNING_SINCE, t0.state FROM DB.Task t0 WHERE t0.name = ? optimize for 1 row spy([ACTIVE] (2010/11/23 09:13:23.726)>> Connection[1]resultSetType = 1003 spy([ACTIVE] (2010/11/23 09:13:23.726)>> Connection[1]resultSetConcurrency = 1007 spy([ACTIVE] (2010/11/23 09:13:23.728)>> OK (PreparedStatement[475]) spy([ACTIVE] (2010/11/23 09:13:23.759)>> PreparedStatement[475].setPoolable(boolean poolable) spy([ACTIVE] (2010/11/23 09:13:23.759)>> poolable = true spy([ACTIVE] (2010/11/23 09:13:23.759)>> OK spy([ACTIVE] (2010/11/23 09:13:23.766)>> PreparedStatement[475].setString(int parameterIndex, String x) spy([ACTIVE] (2010/11/23 09:13:23.766)>> parameterIndex = 1 spy([ACTIVE] (2010/11/23 09:13:23.766)>> x = BuBaBestand spy([ACTIVE] (2010/11/23 09:13:23.767)>> OK spy([ACTIVE] (2010/11/23 09:13:23.767)>> PreparedStatement[475].executeQuery() spy([ACTIVE] (2010/11/23 09:13:23.010)>> OK (ResultSet[493]) =========> ALL OK spy([ACTIVE] (2010/11/23 09:13:23.033)>> PreparedStatement[475].clearParameters() spy([ACTIVE] (2010/11/23 09:13:23.033)>> OK spy([ACTIVE] (2010/11/23 09:13:23.033)>> PreparedStatement[475].clearBatch() spy([ACTIVE] (2010/11/23 09:13:23.033)>> OK spy([ACTIVE] (2010/11/23 09:13:23.033)>> PreparedStatement[475].setEscapeProcessing(boolean enable) spy([ACTIVE] (2010/11/23 09:13:23.033)>> enable = true spy([ACTIVE] (2010/11/23 09:13:23.033)>> OK spy([ACTIVE] (2010/11/23 09:13:23.033)>> PreparedStatement[475].getFetchDirection() spy([ACTIVE] (2010/11/23 09:13:23.033)>> OK (1002) spy([ACTIVE] (2010/11/23 09:13:23.033)>> PreparedStatement[475].setFetchDirection(int direction) spy([ACTIVE] (2010/11/23 09:13:23.033)>> direction = 1000 spy([ACTIVE] (2010/11/23 09:13:23.033)>> OK spy([ACTIVE] (2010/11/23 09:13:23.033)>> PreparedStatement[475].getFetchSize() spy([ACTIVE] (2010/11/23 09:13:23.034)>> OK (0) spy([ACTIVE] (2010/11/23 09:13:23.034)>> PreparedStatement[475].getMaxFieldSize() spy([ACTIVE] (2010/11/23 09:13:23.034)>> OK (0) spy([ACTIVE] (2010/11/23 09:13:23.034)>> PreparedStatement[475].getMaxRows() spy([ACTIVE] (2010/11/23 09:13:23.034)>> OK (0) spy([ACTIVE] (2010/11/23 09:13:23.034)>> PreparedStatement[475].getQueryTimeout() spy([ACTIVE] (2010/11/23 09:13:23.034)>> OK (0) spy([ACTIVE] (2010/11/23 09:13:23.034)>> PreparedStatement[475].clearWarnings() spy([ACTIVE] (2010/11/23 09:13:23.034)>> OK spy([ACTIVE] (2010/11/23 09:13:24.540)>> PreparedStatement[475].setPoolable(boolean poolable) spy([ACTIVE] (2010/11/23 09:13:24.540)>> poolable = true spy([ACTIVE] (2010/11/23 09:13:24.540)>> OK spy([ACTIVE] (2010/11/23 09:13:24.540)>> PreparedStatement[475].setString(int parameterIndex, String x) spy([ACTIVE] (2010/11/23 09:13:24.540)>> parameterIndex = 1 spy([ACTIVE] (2010/11/23 09:13:24.540)>> x = BuBaBestand spy([ACTIVE] (2010/11/23 09:13:24.540)>> OK spy([ACTIVE] (2010/11/23 09:13:24.540)>> PreparedStatement[475].executeQuery() =====> 2nd execution fails spy([ACTIVE] (2010/11/23 09:13:24.545)>> java.sql.SQLException: [OWLS][DB2 JDBC Driver][DB2]CURSOR C095 NOT IN PREPARED STATE ErrorCode=-514 SQLState=26501 java.sql.SQLException: [OWLS][DB2 JDBC Driver][DB2]CURSOR C095 NOT IN PREPARED STATE spy([ACTIVE] (2010/11/23 09:13:24.551)>> PreparedStatement[475].close() spy([ACTIVE] (2010/11/23 09:13:24.551)>> OK All in all I come to the conclusion that JPA is working properly and the Db2 server at client-side is working differently from ours. Any comments are appreciated. Thanks ----- Kind regards Matthias -- View this message in context: http://openjpa.208410.n2.nabble.com/cursor-prepared-statement-problem-with-WebLogic-10-3-2-tp5724027p5765998.html Sent from the OpenJPA Users mailing list archive at Nabble.com.
