?
Solved

Entity bean's primary key class must implement Serializable?

Posted on 2004-08-07
7
Medium Priority
?
806 Views
Last Modified: 2013-11-24
why Entity bean's primary key class must implement Serializable?

what Serializable is used for?
0
Comment
Question by:she1
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
7 Comments
 
LVL 35

Accepted Solution

by:
girionis earned 100 total points
ID: 11745874
It is used to transfer objects across the wire and to save the satte of the object on the disk.
0
 
LVL 5

Assisted Solution

by:mrigank
mrigank earned 100 total points
ID: 11750356
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
 
LVL 30

Expert Comment

by:Mayank S
ID: 11750417
Anything that goes across a network should be serialize-able:

http://mindprod.com/jgloss/serialization.html
0
 
LVL 5

Expert Comment

by:mrigank
ID: 11750447
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
 

Author Comment

by:she1
ID: 12012861
so the 2 reasons for serizable: remote deployment, & persist the  bean to secondary storage.

0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
A solution for Fortify Path Manipulation.
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
Suggested Courses

649 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question