Skip to content

Commit

Permalink
Fixes issue #24849 make relevant methods synchronized in
Browse files Browse the repository at this point in the history
LocalTxConnectionEventListener and protect associatedHandles from
external clear calls. Process review comment and fix typo.
  • Loading branch information
escay committed Mar 11, 2024
1 parent 4aa5683 commit db6268a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,7 @@ public void end(Xid xid, int flags) throws XAException {
if (handle != null) { // not needed, just to be sure.
ManagedConnection associatedConnection = (ManagedConnection) handle.getResource();
associatedConnection.associateConnection(userHandle);
if (_logger.isLoggable(FINE)) {
_logger.log(FINE, "connection_sharing_reset_association", userHandle);
}
_logger.log(FINE, "connection_sharing_reset_association", userHandle);
}
}
} catch (Exception e) {
Expand Down Expand Up @@ -241,9 +239,7 @@ private void resetAssociation() throws XAException {
ResourceHandle associatedHandle = (ResourceHandle) userHandleEntry.getValue();
ManagedConnection associatedConnection = (ManagedConnection) associatedHandle.getResource();
associatedConnection.associateConnection(userHandleEntry.getKey());
if (_logger.isLoggable(FINE)) {
_logger.log(FINE, "connection_sharing_reset_association", userHandleEntry.getKey());
}
_logger.log(FINE, "connection_sharing_reset_association", userHandleEntry.getKey());
}
} catch (Exception ex) {
handleResourceException(ex);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ public synchronized void associateHandle(Object userHandle, ResourceHandle resou
}

/**
* Removes the Map entory for the given userHandle key.
* Removes the Map entry for the given userHandle key.
*
* @param userHandle The userHandle key to be removed from the map.
* @return the associated ResourceHandle that is removed from the map or null if no association was found. A null return
Expand Down

0 comments on commit db6268a

Please sign in to comment.