简体   繁体   中英

java object serialization for hosting on aws tomcat elastic beanstalk

We are migrating a java based web application built in spring and hibernate to AWS elastic beanstalk.

To manage sessions, we are using the AmazonDynamoDBSessionManagerForTomcat library. This will typically serialize the session object and store the same in dynamo db.

Now, I have more than 100 beans. Some of them are to be saved in the session during runtime.

I had to implement Serializable to these beans for them to get stored in dynamo db.

Now, I have two options, go through the entire application logic and only implement Serializable to those beans which are stored in the session OR blindly implement Serializable to all the beans (quicker).

Will there be any issues if I choose the later approach ?

Does implementing Serializable to objects that need not be serialized, create any problems ?

Thanks, Sanket

Serializable is an empty interface (the marker pattern ) so I don't see any reason not to implement it by all relevant beans.

Make sure that every implementing class has an empty (no args) constructor.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM