Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

The container serializes EntityManager, SessionContext even if they are not serializable?

 
Himai Minh
Ranch Hand
Posts: 1361
7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
On p. 22 of Frits notes,

The following fields are serialized by the container:
- A reference to a Timer object
- A reference to SessionContext object,
- A reference to an EntityManager or EntityManagerFactory....



The JSR 318 says "even if they are not serializable".

So, how can the container serialize those fields which do not implement Serializable ?
 
Frits Walraven
Creator of Enthuware JWS+ V6
Saloon Keeper
Pie
Posts: 2536
113
Android Chrome Eclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So, how can the container serialize those fields which do not implement Serializable ?

Good question for the EJB-container developers. However in the relation to the exam this knowledge is not needed.
 
Himai Minh
Ranch Hand
Posts: 1361
7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When I pass an object reference, which does not implement Serializable, as an argument to a remote method, the EJB container throws an exception saying that object is not serializable.

I think the EJB container can still serialize a non-serializable object.
 
Himai Minh
Ranch Hand
Posts: 1361
7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I just got a reply from Enthuware http://www.enthuware.com/forum/viewtopic.php?f=4&t=861

The container can use externalization, re create the object like EntityManager that does not implement Serializable interface
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic