[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-4289) Version increment not triggered on @OneToOne property modification having inverse owner

Guenther Demetz (JIRA) noreply at atlassian.com
Mon Feb 8 05:15:31 EST 2010


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

Guenther Demetz commented on HHH-4289:
--------------------------------------

Testcase still fails with version 3.5.0-Beta-4

> Version increment not triggered on @OneToOne property modification having inverse owner
> ---------------------------------------------------------------------------------------
>
>                 Key: HHH-4289
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-4289
>             Project: Hibernate Core
>          Issue Type: Bug
>          Components: annotations
>         Environment: Hibernate 3.3.1.GA ,    Microsoft SQL Server
>            Reporter: Guenther Demetz
>            Priority: Minor
>         Attachments: Testcase.jar
>
>
> In the revised "Java Persistence with Hibernate" book by Christian Bauer and Gavin King on page 464
> there's written following about versioning:
> "If you use Hibernate as JPA provider ... every value-typed property modification .. triggers a version increment."
> Now I saw that Version increment indeed is not triggered on @OneToOne properties having an inverse owner (= mappedBy setted).
> This allows several concurrent transactions to set the association from same object towards different targets without having a OptimistickLockException at commit.
> This violates the ToOne policy! (Hibernate detects the inconsistency later when loading the property from database:
> org.hibernate.HibernateException: More than one row with the given identifier was found)
> Please see attached junit-testcase for reproducing the problem.
> regards
> Guenther Demetz

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