@@ -487,6 +487,7 @@ public java.sql.ResultSet executeQuery() throws SQLServerException, SQLTimeoutEx
487
487
loggerExternal .finer (toString () + ACTIVITY_ID + ActivityCorrelator .getCurrent ().toString ());
488
488
}
489
489
checkClosed ();
490
+ connection .unprepareUnreferencedPreparedStatementHandles (false );
490
491
executeStatement (new PrepStmtExecCmd (this , EXECUTE_QUERY ));
491
492
loggerExternal .exiting (getClassNameLogging (), "executeQuery" );
492
493
return resultSet ;
@@ -501,6 +502,7 @@ public java.sql.ResultSet executeQuery() throws SQLServerException, SQLTimeoutEx
501
502
*/
502
503
final java .sql .ResultSet executeQueryInternal () throws SQLServerException , SQLTimeoutException {
503
504
checkClosed ();
505
+ connection .unprepareUnreferencedPreparedStatementHandles (false );
504
506
executeStatement (new PrepStmtExecCmd (this , EXECUTE_QUERY_INTERNAL ));
505
507
return resultSet ;
506
508
}
@@ -513,7 +515,7 @@ public int executeUpdate() throws SQLServerException, SQLTimeoutException {
513
515
}
514
516
515
517
checkClosed ();
516
-
518
+ connection . unprepareUnreferencedPreparedStatementHandles ( false );
517
519
executeStatement (new PrepStmtExecCmd (this , EXECUTE_UPDATE ));
518
520
519
521
// this shouldn't happen, caller probably meant to call executeLargeUpdate
@@ -534,6 +536,7 @@ public long executeLargeUpdate() throws SQLServerException, SQLTimeoutException
534
536
loggerExternal .finer (toString () + ACTIVITY_ID + ActivityCorrelator .getCurrent ().toString ());
535
537
}
536
538
checkClosed ();
539
+ connection .unprepareUnreferencedPreparedStatementHandles (false );
537
540
executeStatement (new PrepStmtExecCmd (this , EXECUTE_UPDATE ));
538
541
loggerExternal .exiting (getClassNameLogging (), "executeLargeUpdate" , updateCount );
539
542
return updateCount ;
@@ -546,6 +549,7 @@ public boolean execute() throws SQLServerException, SQLTimeoutException {
546
549
loggerExternal .finer (toString () + ACTIVITY_ID + ActivityCorrelator .getCurrent ().toString ());
547
550
}
548
551
checkClosed ();
552
+ connection .unprepareUnreferencedPreparedStatementHandles (false );
549
553
executeStatement (new PrepStmtExecCmd (this , EXECUTE ));
550
554
loggerExternal .exiting (getClassNameLogging (), "execute" , null != resultSet );
551
555
return null != resultSet ;
@@ -2199,6 +2203,7 @@ public int[] executeBatch() throws SQLServerException, BatchUpdateException, SQL
2199
2203
loggerExternal .finer (toString () + ACTIVITY_ID + ActivityCorrelator .getCurrent ().toString ());
2200
2204
}
2201
2205
checkClosed ();
2206
+ connection .unprepareUnreferencedPreparedStatementHandles (false );
2202
2207
discardLastExecutionResults ();
2203
2208
2204
2209
try {
@@ -2382,6 +2387,7 @@ public long[] executeLargeBatch() throws SQLServerException, BatchUpdateExceptio
2382
2387
loggerExternal .finer (toString () + ACTIVITY_ID + ActivityCorrelator .getCurrent ().toString ());
2383
2388
}
2384
2389
checkClosed ();
2390
+ connection .unprepareUnreferencedPreparedStatementHandles (false );
2385
2391
discardLastExecutionResults ();
2386
2392
2387
2393
try {
0 commit comments