?
Solved

Entity bean's primary key class must implement Serializable?

Posted on 2004-08-07
7
Medium Priority
?
801 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

Stressed Out?

Watch some penguins on the livecam!

Question has a verified solution.

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

For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
A solution for Fortify Path Manipulation.
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
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…
Suggested Courses
Course of the Month10 days, 21 hours left to enroll

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