Solved

Entity bean's primary key class must implement Serializable?

Posted on 2004-08-07
7
783 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
7 Comments
 
LVL 35

Accepted Solution

by:
girionis earned 25 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 25 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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Viewers learn about the “while” loop and how to utilize it correctly in Java. Additionally, viewers begin exploring how to include conditional statements within a while loop and avoid an endless loop. Define While Loop: Basic Example: Explanatio…
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…

770 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