This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes Primitive/ Arrays in ejbPassivate() Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Certification » EJB Certification (SCBCD/OCPJBCD)
Bookmark "Primitive/ Arrays in ejbPassivate()" Watch "Primitive/ Arrays in ejbPassivate()" New topic
Author

Primitive/ Arrays in ejbPassivate()

Natarajan Shankar
Ranch Hand

Joined: Jun 10, 2004
Posts: 53
Dear all,
During ejbPassivate() said it can take serializable object for passivation without any alteration. How about primitives/ arrays? They are serializable auto?


Best Regards<br />N.Shankar<br />SCJP, SCWCD
Valentin Crettaz
Gold Digger
Sheriff

Joined: Aug 26, 2001
Posts: 7610
This is one of the many reasons why the SCJP exam is a prerequisite for the SCBCD certification...

Section 10.8 of the JLS states:

The direct superclass of an array type is Object. Every array type implements the interfaces Cloneable and java.io.Serializable.


Which means that arrays are serializable by nature and are thus concerned by the first bullet of section 7.4.1 of the EJB specification

I hope this helps


SCJP 5, SCJD, SCBCD, SCWCD, SCDJWS, IBM XML
[Blog] [Blogroll] [My Reviews] My Linked In
Natarajan Shankar
Ranch Hand

Joined: Jun 10, 2004
Posts: 53
Ok Valentin, thanks for the reference so you mean primitives are not serializable?
Valentin Crettaz
Gold Digger
Sheriff

Joined: Aug 26, 2001
Posts: 7610
Did I mention that? I don't think so

Actually, the serialization of primitive types is supported by default by any JVM, so you don't need to do anything special for that...

For the same reason, arrays of primitive types are also serializable.

Hope this helps
Natarajan Shankar
Ranch Hand

Joined: Jun 10, 2004
Posts: 53
Yes, I was also having same assumption. But I was wondering my assumption is correct or not. For this reason only I was looking into some documents and also in my earlier question I meant as primitive array. Thanks for the support.
Valentin Crettaz
Gold Digger
Sheriff

Joined: Aug 26, 2001
Posts: 7610
No problem, it's cool
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Primitive/ Arrays in ejbPassivate()
 
Similar Threads
regarding ejbPassivate()
Stateless Session bean
ejbPassivate
Passing a String[][] using sockets
regarding ejbPassivate()