[hibernate-issues] [Hibernate-JIRA] Updated: (HHH-2119) reloading a detached object with a collection fails

Gregory Kotsaftis (JIRA) noreply at atlassian.com
Fri Sep 29 16:05:24 EDT 2006


     [ http://opensource.atlassian.com/projects/hibernate/browse/HHH-2119?page=all ]

Gregory Kotsaftis updated HHH-2119:
-----------------------------------

    Attachment: BugFinder.zip

I created a very small app to demonstrate the problem.
Though I cannot reproduce the "NonUniqueObjectException" another exception which should be related occurs.

The "aliases.conf" should be placed inside FireBird root folder.
The db schema is in "tables.sql".

toggle the boolean "USE_REFRESH" inside main() in order to verify that the reloading works if I use refresh().

Please let me know if there is anything else you need.


> reloading a detached object with a collection fails
> ---------------------------------------------------
>
>          Key: HHH-2119
>          URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2119
>      Project: Hibernate3
>         Type: Bug

>     Versions: 3.1.3
>  Environment: Hibernate 3.1.3
> firebird 1.5.3.4870 with Jaybird-2.1.0
> java 1.5.0_07
>     Reporter: Gregory Kotsaftis
>  Attachments: BugFinder.zip
>
>
> Hi,
> 1) I have a simple object <O> with a collection loaded and use <version> for both (no second level cache)
> 2) The object <O> is associated with session A, via <O> = load(CLASS, <ID>)
> 3) The session <A> is later closed because e.g. an exception occurs
> 4) Another session is opened later on, session B
> 5) If  load(<O>, <ID>)  is called an NonUniqueObjectException is thrown
>     (a different object with the same identifier value was already associated with the session)
> 6) If instead I use the session.refresh(<O>) no exception is thrown, the object is reloaded ok.
> It seems this issue might be related with: 
>      http://opensource.atlassian.com/projects/hibernate/browse/HHH-511
> but i cannot be sure.
> Part of the stacktrace:
> org.hibernate.NonUniqueObjectException: a different object with the same identifier value was already associated with the session: [gr.metadata.orthomed.db.Patient#23]
> 	at org.hibernate.event.def.DefaultLoadEventListener.load(DefaultLoadEventListener.java:132)
> 	at org.hibernate.event.def.DefaultLoadEventListener.returnNarrowedProxy(DefaultLoadEventListener.java:202)
> 	at org.hibernate.event.def.DefaultLoadEventListener.proxyOrLoad(DefaultLoadEventListener.java:169)
> 	at org.hibernate.event.def.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:87)
> 	at org.hibernate.impl.SessionImpl.fireLoad(SessionImpl.java:862)
> 	at org.hibernate.impl.SessionImpl.load(SessionImpl.java:770)
> 	at gr.metadata.lib.hibernate.HibernateHelper.reloadObject(HibernateHelper.java:230)

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira




More information about the hibernate-issues mailing list