[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-2128) data corruption using one-to-one mapping

Patrick Moore (JIRA) noreply at atlassian.com
Tue Oct 3 21:01:24 EDT 2006


    [ http://opensource.atlassian.com/projects/hibernate/browse/HHH-2128?page=comments#action_24702 ] 

Patrick Moore commented on HHH-2128:
------------------------------------

This is not a case of trying to protect against all bad choices. This is a case of stopping the user from trying to define something that is clearly *incorrect* and shooting themselves in the foot. (And data corruption is a pretty big hole).

I am only suggesting making it so that the definition would fail on an 'obviously' wrong configuration. If it is obviously wrong, shouldn't Hibernate by default refuse to accept it? 







> data corruption using one-to-one mapping
> ----------------------------------------
>
>          Key: HHH-2128
>          URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2128
>      Project: Hibernate3
>         Type: Bug

>   Components: core
>     Versions: 3.2.0.cr4
>  Environment: hsqldb 1.8.0
>     Reporter: Patrick Moore
>     Priority: Blocker
>  Attachments: hibernatetests.zip
>
>
> Please notice that this situation arose from the most minimal definition. Using the 'defaults' is what caused this issue!
> See attached zip for definitions and reproduction test case.
> Steps:
> 1. define two classes (Primary, Secondary) that have a one-to-one relationship.
> 2. save a primary with no assigned secondary object.
> 3. save another primary with a secondary object.
> 4. retrieve the first primary and it will have the secondary object saved in step 3.
> 5. retrieve the second primary and it will have no secondary object.
> Suggested solution:
> require that 'one-to-one' enforce an implicit non-null requirement between primary and secondary.

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