You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openjpa.apache.org by "Rick Curtis (JIRA)" <ji...@apache.org> on 2010/05/12 18:08:42 UTC

[jira] Created: (OPENJPA-1665) Problems when using auto incrementing colums that start at zero

Problems when using auto incrementing colums that start at zero 
----------------------------------------------------------------

                 Key: OPENJPA-1665
                 URL: https://issues.apache.org/jira/browse/OPENJPA-1665
             Project: OpenJPA
          Issue Type: Bug
    Affects Versions: 2.0.0
            Reporter: Rick Curtis
            Assignee: Rick Curtis


This issue was reported on the users mailing list[1].

The issue is that it is possible when using auto generated ids that there is a current entity in the persistence context that has an id of zero, and by default when a new entity is created it also has an id of zero. When persisting the second entity, OpenJPA incorrectly detects that there are multiple entities with the same id in the context even though the new id doesn't have an id from the database yet.

[1]http://openjpa.208410.n2.nabble.com/An-object-of-type-src-StatusUpdate-with-oid-0-already-exists-in-this-context-another-cannot-be-persi-td5030272.html#a5030272

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (OPENJPA-1665) Problems when using auto incrementing colums that start at zero

Posted by "Milosz Tylenda (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OPENJPA-1665?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Milosz Tylenda updated OPENJPA-1665:
------------------------------------

    Fix Version/s: 2.1.0
                       (was: 2.0.1)

Changing Fix Version to 2.1.0 since code has been committed to trunk.


> Problems when using auto incrementing colums that start at zero 
> ----------------------------------------------------------------
>
>                 Key: OPENJPA-1665
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-1665
>             Project: OpenJPA
>          Issue Type: Bug
>    Affects Versions: 2.0.0
>            Reporter: Rick Curtis
>            Assignee: Rick Curtis
>             Fix For: 2.1.0
>
>
> This issue was reported on the users mailing list[1].
> The issue is that it is possible when using auto generated ids that there is a current entity in the persistence context that has an id of zero, and by default when a new entity is created it also has an id of zero. When persisting the second entity, OpenJPA incorrectly detects that there are multiple entities with the same id in the context even though the new id doesn't have an id from the database yet.
> [1]http://openjpa.208410.n2.nabble.com/An-object-of-type-src-StatusUpdate-with-oid-0-already-exists-in-this-context-another-cannot-be-persi-td5030272.html#a5030272

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (OPENJPA-1665) Problems when using auto incrementing colums that start at zero

Posted by "Rick Curtis (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OPENJPA-1665?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Rick Curtis resolved OPENJPA-1665.
----------------------------------

    Fix Version/s: 2.0.1
       Resolution: Fixed

Committed revision 943638 to trunk.

Updated BrokerImpl to skip checks for duplicate ids when they are auto generated. Also added a new test case to exercise this code path.

> Problems when using auto incrementing colums that start at zero 
> ----------------------------------------------------------------
>
>                 Key: OPENJPA-1665
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-1665
>             Project: OpenJPA
>          Issue Type: Bug
>    Affects Versions: 2.0.0
>            Reporter: Rick Curtis
>            Assignee: Rick Curtis
>             Fix For: 2.0.1
>
>
> This issue was reported on the users mailing list[1].
> The issue is that it is possible when using auto generated ids that there is a current entity in the persistence context that has an id of zero, and by default when a new entity is created it also has an id of zero. When persisting the second entity, OpenJPA incorrectly detects that there are multiple entities with the same id in the context even though the new id doesn't have an id from the database yet.
> [1]http://openjpa.208410.n2.nabble.com/An-object-of-type-src-StatusUpdate-with-oid-0-already-exists-in-this-context-another-cannot-be-persi-td5030272.html#a5030272

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.