[
http://opensource.atlassian.com/projects/hibernate/browse/HHH-6727?page=c...
]
Scott Marlow commented on HHH-6727:
-----------------------------------
From looking at the "EntityManagerFactoryImpl
entityManagerFactory" instance variable in class EntityManagerFactoryImpl, it would
appear that the serializing the EntityManager, would include the EntityManagerFactory.
Looking at in class EntityManagerFactoryImpl, a SessionFactory (SessionFactoryImpl)
instance is referenced. When the SessionFactoryImpl is serialized, only the UUID + JNDI
name of SF (if configured) is serialized. The cache and other heavy instance variables
are not serialized. :)
The puzzling part of this for me is what happens currently in a clustered environment,
where the same application SF on different machines, would have different UUIDs (and
possibly no JNDI name for the SF). We must be requiring the SF JNDI name to be set, to
cover that case. That would seem to be a good workaround.
I look forward to seeing the clustering of the extended persistence context
(EntityManager) in action, so we can go by facts, not just Scott's review of current
code. ;)
serializing an EntityManager should include enough information to
later be unserialized with re-association to existing EntityManagerFactory (even on a
different machine/jvm process)
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Key: HHH-6727
URL:
http://opensource.atlassian.com/projects/hibernate/browse/HHH-6727
Project: Hibernate Core
Issue Type: Bug
Components: entity-manager
Reporter: Scott Marlow
Fix For: 4.0.0.next
The re-association (of EM to EMF) is important, as applications expect that closing the
EntityManagerFactory, will close the EntityManager's that have been opened from the
EMF.
--
This message is automatically generated by JIRA.
For more information on JIRA, see:
http://www.atlassian.com/software/jira