Stateful session beans

1 view
Skip to first unread message

menny68

unread,
Jan 17, 2010, 4:46:23 AM1/17/10
to javaee6-codecamp
I know that stateless sessions beans are not included in the codecamp
but I hope someone finds this post useful.

I've seen that javaee6 with ejb 3.1 solves two major issues in
stateful session beans (concurrent accesss, passivation with extended
persistence context), from the ejb 3.1 specs:

1) The container serializes calls to each stateful and stateless
session bean instance. Most containers will support many instances of
a session bean executing concurrently; however, each instance sees
only a serialized sequence of method calls. Therefore, a stateful or
stateless session bean does not have to be coded as reentrant.

2) A container must not passivate a stateful session bean with an
extended persistence context unless the following conditions are met:
•All the entities in the persistence context are serializable.
•The EntityManager is serializable.

If my understanding of point 2 this means that if entities and entity
manager are serializable is a container responsibility to passivare
and reconstruct the extended persistence context.

I have only a question about the statement "The EntityManager is
serializable": does it means that it is implementation dependent? If
it is so, is the eclipselink (JPA implementation included in
glassfish) implementation of entitymanager serializable?

Best regards,
Roberto

Antonio Goncalves

unread,
Jan 17, 2010, 6:37:23 AM1/17/10
to robertome...@gmail.com, javaee6-codecamp
Indeed, it is implementation dependent. For EclipseLink the EntityManager implementation is org.eclipse.persistence.internal.jpa.EntityManagerImpl and it doesn't implement Serializable (it implements org.eclipse.persistence.jpa.JpaEntityManager which also doesn't extend Serializable)


--
You received this message because you are subscribed to the Google Groups "javaee6-codecamp" group.
To post to this group, send email to javaee6-...@googlegroups.com.
To unsubscribe from this group, send email to javaee6-codeca...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/javaee6-codecamp?hl=en.






--
Antonio Goncalves
Software architect and Java Champion

Web site : www.antoniogoncalves.org
Twitter : twitter.com/agoncal
Blog: agoncal.wordpress.com
LinkedIn: www.linkedin.com/in/agoncal
Paris JUG leader : www.parisjug.org
Reply all
Reply to author
Forward
0 new messages