[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-2886) nonuniqueexception when loading the same object multiple times

Andreas Pakulat (JIRA) noreply at atlassian.com
Thu Oct 11 05:52:38 EDT 2007


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

Andreas Pakulat commented on HHH-2886:
--------------------------------------

Changed this to be an improvement. I missed that the caching needs to be enabled by explicit marking of the classes to be cached. 

This should be either better documented, at least to me its not obvious from the documentation that no objects are cached unless one adds the @Cache annotation (or apropriate mapping information). Or even better would be if Hibernate automatically caches the Entities.

> nonuniqueexception when loading the same object multiple times
> --------------------------------------------------------------
>
>                 Key: HHH-2886
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2886
>             Project: Hibernate3
>          Issue Type: Improvement
>    Affects Versions: 3.2.5
>         Environment: PostgreSQL 8.2
> EHCache 1.2.4
>            Reporter: Andreas Pakulat
>            Priority: Critical
>
> When using HQL or Criteria queries to find a specific object in the database it seems that Hibernate completely bypasses its Session Cache and thus creates new persistent objects each time the query is run. If the query however finds the same object multiple times this results in non-unique-exceptions as soon as one of the objects is updated.
> Hibernate should check its session cache when loading objects from the database and use those already associated objects instead of creating new ones.

-- 
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