[英]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. 我们正在将基于Spring并休眠的基于Java的Web应用程序迁移到AWS Elastic beantalk。
To manage sessions, we are using the AmazonDynamoDBSessionManagerForTomcat library. 为了管理会话,我们使用AmazonDynamoDBSessionManagerForTomcat库。 This will typically serialize the session object and store the same in dynamo db. 通常,这将序列化会话对象,并将其存储在dynamo db中。
Now, I have more than 100 beans. 现在,我有100多个豆子。 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. 我必须对这些bean实现Serializable,以便它们存储在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). 现在,我有两个选择,遍历整个应用程序逻辑,仅对存储在会话中的bean实施Serializable,或对所有bean盲目实现Serializable(快速)。
Will there be any issues if I choose the later approach ? 如果我选择后一种方法,会不会有任何问题?
Does implementing Serializable to objects that need not be serialized, create any problems ? 对不需要序列化的对象实施Serializable是否会产生任何问题?
Thanks, Sanket 谢谢,Sanket
Serializable
is an empty interface (the marker pattern ) so I don't see any reason not to implement it by all relevant beans. Serializable
是一个空接口( 标记模式 ),因此我看不出没有任何理由不通过所有相关bean来实现它。
Make sure that every implementing class has an empty (no args) constructor. 确保每个实现类都有一个空的(无参数)构造函数。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.