[
https://issues.jboss.org/browse/JBSEAM-4589?page=com.atlassian.jira.plugi...
]
Peter Brewer commented on JBSEAM-4589:
--------------------------------------
I've applied a patch that I have up and working on my local environment.
The patch will now save entities to the conversation even if they are wrapped or embedded
in a complex user defined data-structure. However, for the sake of performance such
wrapped entities must be annotated on the field with
org.jboss.seam.annotations.persistence.EntityWrapper. This is a marker interface that
tells the ManagedEntityWrapper to drop into wrapper and then perform passivation at that
level. Further entity wrappers down the object graph must also be annotated though.
There are a couple of issues so far:
1. Recursive references are not handled, I'm currently working on this(should be quite
simple), but thought others may like the patch straight away.
2. The field reference is not set to null, so the entity is serialized twice, once in the
field and once in the conversation. This is so that the deserialization process has
knowledge of the runtime type of the field, but it may be possible to fix this.
3. If a Collection or Map is annotated with EntityWrapper it must provide guaranteed
ordering otherwise activation may break. Not sure how to avoid this, so suggestions
welcome.
Please let me have any feedback you may have.
ManagedEntityWrapper wrap and deserialize with in-depth fields of
Stateful Beans
--------------------------------------------------------------------------------
Key: JBSEAM-4589
URL:
https://issues.jboss.org/browse/JBSEAM-4589
Project: Seam
Issue Type: Bug
Components: Core
Affects Versions: 2.1.2.GA
Reporter: Sebastien Boutte
Attachments: JBSEAM-4375 and JBSEAM-4589.diff, ManagedEntityWrapper.diff
As it is said in documentation (Part : EJB Passivation and the ManagedEntityInterceptor)
; seam is capable of passivate SMPC (EntityManager with @In) and reattach all instances
loaded at activation.
For simple fields (Entities, Lists, Maps ...) , it works perfectly.
For user defined fields (Wrapper with entity object, or more complex structure), this is
not the case and cause a lazy exception later after activation.
In class ManagedEntityWrapper, methods wrap and deserialize are not able to do in depth
operations.
--
This message is automatically generated by JIRA.
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira