• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

question about serialization

 
Meg Adal
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


My question is :

1. Do I need to Serialize EmailVO? As its used by local bean not remote bean
I think we should not need to serialze the EmailVO BUT since its SessionBean container can passivate/activate it so I need to serialize EmailVO

any thoughts....
 
KasiMurugan Ramasamy
Ranch Hand
Posts: 125
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Meg,

For passivation/activation need beans instance state(Instance field) need to be serializable. I thing your "EmailVO" is not a instance state. So don't need you to implement Serializable.

And also it is a return type of LocalComponent interace.

I hope you will get me.

Regards
Kasimurugan R.
 
Miki Muzsi
Ranch Hand
Posts: 120
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Meg I also think you do not have to implement Serializable. But I couldn't find it explicitly said in the spec. The only thing which is clearly formulated is that if you use remote interfaces then your value object must implement serializable (pg. 53). So we can choose as the container chooses in many situations

Miki
 
sawan parihar
Ranch Hand
Posts: 250
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
EmailVO doesn't needs to be serialized if it is not a instance variable. For remote calls the return types of the methods must be serializable because it needs to be sent over the wire .

Buts its good to keep value objects serializable .

sawan
 
Roger Chung-Wee
Ranch Hand
Posts: 1683
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Apart from special cases like bean references, JNDI context and sessionContext, the container will not passivate non-Serializable references with non-null values. So, watch out for those java.sql.Connection references with non-null values.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic