[
https://jira.jboss.org/jira/browse/JBSEAM-3728?page=com.atlassian.jira.pl...
]
Dan Allen resolved JBSEAM-3728.
-------------------------------
Resolution: Done
Using the transient keyword worked. There is probably more thinking that needs to be done
about the challenge of session replication in general, but at least now we aren't
breaking clustering.
not clearing EntityManager in
ManagedPersistenceContext#sessionWillPassivate breaks session replication
-------------------------------------------------------------------------------------------------------
Key: JBSEAM-3728
URL:
https://jira.jboss.org/jira/browse/JBSEAM-3728
Project: Seam
Issue Type: Bug
Components: Core
Affects Versions: 2.1.0.SP1
Reporter: Dan Allen
Assignee: Dan Allen
Fix For: 2.1.1.CR2
Original Estimate: 4 hours
Remaining Estimate: 4 hours
Commit 8372 broke the clustering because EntityManager is not being cleared before
session passivation. The EntityManager cannot be serialized and therefore to leave it in
the conversation context (and hence the session context) prevents the HTTP session from
being restored properly. Two ways to fix is either set the EntityManager it to null in the
ManagedPersistenceContext#sessionWillPassivate method (the old behavior, which gives us a
chance to clean things up) or mark the field as transient. Making the field transient
solves the problem that commit 8372 was attempting to fix, which was that the entities
were being reloaded from the database on each request in a clustered environment. The
problem with using transient is that we don't get an opportunity to formally close the
EntityManager (but then again, it might be hard to tell when the session being used jumps
a node in the cluster, which is the only time you want to destroy the EntityManager).
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira