Entity bean's primary key class must implement Serializable?

why Entity bean's primary key class must implement Serializable?

what Serializable is used for?
she1Asked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
girionisConnect With a Mentor Commented:
It is used to transfer objects across the wire and to save the satte of the object on the disk.
0
 
mrigankConnect With a Mentor Commented:
And your EntityBean might be deployed remotely ... You need to pass the Primary Key for a finder , The bean passes the PK object back in the ejbCreate ... this is done across the wire .. so the PK should implement Serializable ....
0
 
Mayank SAssociate Director - Product EngineeringCommented:
Anything that goes across a network should be serialize-able:

http://mindprod.com/jgloss/serialization.html
0
 
mrigankCommented:
During pooling of bean instances, if the maximum pool size is exceeded, then the container saves some of the beans onto the disk to allow for new instances. Now when a bean which has been saved onto the disk is called for, the container reconstructs the bean from the secondary storage. To do this it might also need to persist an existing bean which is not being used.
The persistance of beans requires all bean and bean related objects to implement serializable.
0
 
she1Author Commented:
so the 2 reasons for serizable: remote deployment, & persist the  bean to secondary storage.

0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.