Skip to content

Commit 83351b2

Browse files
committed
Issue 2423: Fix ClassCastException in OracleChangeNotificationListener.remove() method (eclipse-ee4j#2427)
- use unwrap to get the underlying OracleConnection (cherry picked from commit e62e78a) Signed-off-by: Patrick Schmitt <[email protected]>
1 parent dd435a3 commit 83351b2

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

foundation/org.eclipse.persistence.oracle/src/main/java/org/eclipse/persistence/platform/database/oracle/dcn/OracleChangeNotificationListener.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,13 +248,15 @@ public void remove(Session session) {
248248
Accessor accessor = databaseSession.getAccessor();
249249
accessor.incrementCallCount(databaseSession);
250250
try {
251-
OracleConnection connection = (OracleConnection)databaseSession.getServerPlatform().unwrapConnection(accessor.getConnection());
251+
OracleConnection connection = databaseSession.getServerPlatform().unwrapConnection(accessor.getConnection()).unwrap(OracleConnection.class);
252252
databaseSession.log(SessionLog.FINEST, SessionLog.CONNECTION, "dcn_unregister");
253253
try {
254254
connection.unregisterDatabaseChangeNotification(this.register);
255255
} catch (SQLException exception) {
256256
throw DatabaseException.sqlException(exception, databaseSession.getAccessor(), databaseSession, false);
257257
}
258+
} catch (SQLException e) {
259+
throw DatabaseException.sqlException(e, databaseSession.getAccessor(), databaseSession, false);
258260
} finally {
259261
accessor.decrementCallCount();
260262
}

0 commit comments

Comments
 (0)