[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-4642) Unexpected results when an entity with non-flushed changes is changed from read-only to modifiable

Gail Badner (JIRA) noreply at atlassian.com
Fri Dec 18 16:58:29 EST 2009


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

Gail Badner commented on HHH-4642:
----------------------------------

I've added "FailureExected" tests that reproduce this issue: 

org.hibernate.test.readonly.ReadOnlyVersionedNodesTest.testUpdateSetReadOnlySetModifiableFailureExpected
org.hibernate.test.readonly.ReadOnlyVersionedNodesTest.testSetReadOnlyUpdateSetModifiableFailureExpected


> Unexpected results when an entity with non-flushed changes is changed from read-only to modifiable
> --------------------------------------------------------------------------------------------------
>
>                 Key: HHH-4642
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-4642
>             Project: Hibernate Core
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 3.3.2, 3.5.0.Beta-1, 3.5.0-Beta-2
>            Reporter: Gail Badner
>            Assignee: Gail Badner
>
> When an entity is changed from being read-only to modifiable, its snapshot is created from its current state (in the session), not its persistent state (in the DB).
> This can cause unexpected results when:
> - an entity had non-flushed changes when it was set to read-only, or 
> - an entity's state (in the session) was changed after being made read-only.
> If no other changes are made to the entity after being made modifiable, Hibernate will not detect that the entity is dirty, and those changes will not be pushed to the DB. If other changes are made, Hibernate will detect that the entity is dirty, and the newer changes will be persisted, but the older changes may not be.

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