Solved

Entity bean's primary key class must implement Serializable?

Posted on 2004-08-07
7
789 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

How our DevOps Teams Maximize Uptime

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us. Read the use case whitepaper.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
expectj telnet failing 5 45
servlet web applications   metadata-complete="true" or false 3 109
hibernate example for saving data 19 52
intellij error 2 17
After being asked a question last year, I went into one of my moods where I did some research and code just for the fun and learning of it all.  Subsequently, from this journey, I put together this article on "Range Searching Using Visual Basic.NET …
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
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…
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …

839 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