ARTEMIS-3174: Set new connection on ServerSession during reattachment
During session reattachment, also set the new connection on the "session" member of the ServerSessionPacketHandler. Until now, the connected ServerSessionImpl instance still referenced the old connection although it had already been transferred on the new connection.
This commit is contained in:
parent
cd44d90f2b
commit
3b9008bda0
|
@ -1018,6 +1018,8 @@ public class ServerSessionPacketHandler implements ChannelHandler {
|
|||
|
||||
newConnection.syncIDGeneratorSequence(remotingConnection.getIDGeneratorSequence());
|
||||
|
||||
session.transferConnection(newConnection);
|
||||
|
||||
Connection oldTransportConnection = remotingConnection.getTransportConnection();
|
||||
|
||||
remotingConnection = newConnection;
|
||||
|
|
|
@ -58,6 +58,8 @@ public interface ServerSession extends SecurityAuth {
|
|||
@Override
|
||||
RemotingConnection getRemotingConnection();
|
||||
|
||||
void transferConnection(RemotingConnection newConnection);
|
||||
|
||||
Transaction newTransaction();
|
||||
|
||||
boolean removeConsumer(long consumerID) throws Exception;
|
||||
|
|
|
@ -136,7 +136,7 @@ public class ServerSessionImpl implements ServerSession, FailureListener {
|
|||
|
||||
protected final boolean strictUpdateDeliveryCount;
|
||||
|
||||
protected final RemotingConnection remotingConnection;
|
||||
protected RemotingConnection remotingConnection;
|
||||
|
||||
protected final Map<Long, ServerConsumer> consumers = new ConcurrentHashMap<>();
|
||||
|
||||
|
@ -1073,6 +1073,11 @@ public class ServerSessionImpl implements ServerSession, FailureListener {
|
|||
return remotingConnection;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void transferConnection(RemotingConnection newConnection) {
|
||||
remotingConnection = newConnection;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getSecurityDomain() {
|
||||
return securityDomain;
|
||||
|
|
Loading…
Reference in New Issue