[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-6982) ForeignKeys$Nullifier thinks a detached proxy is attached if another object with the same identifier is associated with the persistence context

Gail Badner (JIRA) noreply at atlassian.com
Fri Jan 27 17:28:09 EST 2012


    [ http://opensource.atlassian.com/projects/hibernate/browse/HHH-6982?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=45284#comment-45284 ] 

Gail Badner commented on HHH-6982:
----------------------------------

Please either create a pull request (preferable) or attach a patch for a test case that reproduces your issue.
Thanks,
Gail 

> ForeignKeys$Nullifier thinks a detached proxy is attached if another object with the same identifier is associated with the persistence context
> -----------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HHH-6982
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-6982
>             Project: Hibernate ORM
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 3.5.1
>         Environment: Hibernate 3.5.1, IBM DB2 9.7 on Win7 and AIX 6.1
>            Reporter: Martin Keßler
>
> 1. Create a transient object A which has a many-to-one property of type B
> 2. Create a proxy of type B with identifier x via Session.load(B.class, x)
> 3. Set the B-property in A to B
> 4. Flush and clear the persistence context; the B-proxy is now detached
> 5. Read the B-entity with identifier x through a query; a new object with id=x is now in the persistence context
> 6. Persist the A-entity (Session.save)
> 7. ForeignKeys$Nullifier.isNullifiable is called with the B-proxy, and checks if the persistence context contains an entity with the id x
> 8. The persistence context actually contains such an entity, but it's not the proxy
> 9. Hibernate tries to initialize the detached proxy, leading to a LazyInitializationException

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

       



More information about the hibernate-issues mailing list