tabish121 commented on code in PR #5576:
URL: https://github.com/apache/activemq-artemis/pull/5576#discussion_r2012991133


##########
artemis-ra/src/main/java/org/apache/activemq/artemis/ra/ActiveMQRAConnectionManager.java:
##########
@@ -39,7 +39,7 @@ public ActiveMQRAConnectionManager() {
       logger.trace("constructor()");
    }
 
-   ConcurrentHashSet<ManagedConnection> connections = new 
ConcurrentHashSet<>();
+   transient ConcurrentHashSet<ManagedConnection> connections = new 
ConcurrentHashSet<>();

Review Comment:
   My recollection of Serialization code (which is pretty foggy) is that when 
you do this the value of the connections variable will be null after readObject 
is called regardless of the initialization here and you would need to add an 
override of readObject to initialize the value of connections:
   
   ```
       private void readObject(ObjectInputStream in) throws IOException, 
ClassNotFoundException {
           in.defaultReadObject();
   
           connections = new ConcurrentHashSet<>();
       }
   ```
   
   Same holds true for some of the other new transient collections added below



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: gitbox-unsubscr...@activemq.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscr...@activemq.apache.org
For additional commands, e-mail: gitbox-h...@activemq.apache.org
For further information, visit: https://activemq.apache.org/contact


Reply via email to