openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ravi P Palacherla (JIRA)" <j...@apache.org>
Subject [jira] Commented: (OPENJPA-1260) Wrong sequence is generated for custom native sequence generator from getIdGenerator.
Date Sun, 23 Aug 2009 12:46:59 GMT

    [ https://issues.apache.org/jira/browse/OPENJPA-1260?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12746596#action_12746596
] 

Ravi P Palacherla commented on OPENJPA-1260:
--------------------------------------------

OpenJPAEntityManager.getIdGenerator.next() fails to generate correct sequence number when
class uses native sequence geneartor.

The cause of the issue is OpenJPAEntityManager.getIdGenerator.next() goes against the default
sequence openjpa_sequence rather than the defined sequence.
So the SQL on openjpaentitymanager.getIdGenerator.next() is 
SELECT SEQUENCE_VALUE FROM OPENJPA_SEQUENCE_TABLE WHERE ID = ? FOR UPDATE
even though a native sequence generator is defined.

@Id
    @GeneratedValue(strategy=GenerationType.SEQUENCE, 
        generator="entityE2_seq_gen_name")
    @SequenceGenerator(name="entityE2_seq_gen_name", 
                       sequenceName="entityE2_seq_gen")
    private int id;

> Wrong sequence is generated for custom native sequence generator from getIdGenerator.
> -------------------------------------------------------------------------------------
>
>                 Key: OPENJPA-1260
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-1260
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: sql
>    Affects Versions: 2.0.0
>            Reporter: Ravi P Palacherla
>            Assignee: Ravi P Palacherla
>


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


Mime
View raw message