Win a copy of Micro Frontends in Action this week in the Server-Side JavaScript and NodeJS forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Primitive/ Arrays in ejbPassivate()

 
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear all,
During ejbPassivate() said it can take serializable object for passivation without any alteration. How about primitives/ arrays? They are serializable auto?
 
Author & Gold Digger
Posts: 7617
6
IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Natarajan Shankar
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok Valentin, thanks for the reference so you mean primitives are not serializable?
 
Valentin Crettaz
Author & Gold Digger
Posts: 7617
6
IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 53
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Author & Gold Digger
Posts: 7617
6
IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No problem, it's cool
 
Squanch that. And squanch this tiny ad:
the value of filler advertising in 2020
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic