Answers for "why to use serializable with java bean"

0

why to use serializable with java bean

/*
One good reason, with respect to servlets, is that if you put 
serializable beans into your web server session, your web server can 
serialize them to disk if it's shutting down, and then deserialize them 
back into memory when it starts up. In this way, users wouldn't lose 
their sessions / logins when the server comes back up.
  
If there are any non-serializable beans in session, tomcat will fail to 
serialize sessions to disk.
I believe it's also necessary if you want to sync sessions between 
multiple servers in a cluster.
*/
Posted by: Guest on August-01-2020

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language