Sequences in toplink-Urgent!

Hi,
I have a Database table which has a column whose value is to be automatically generated from a sequence called 'SEQ_PERSON_ID'.I gave the sequence name,table and id in the workbench but i am getting an error
internal Exception: java.sql.SQLException: ORA-00942: table or view does not exi
st
Error Code: 942
Call:UPDATE SEQUENCE SET SEQ_COUNT = SEQ_COUNT + 50 WHERE SEQ_NAME = 'SEQ_PERSON
_ID'
Please suggest as this is very urgent.

Hi i have included both code and project descriptor.
Please suggest.
CODE
public class test
     ServerSession aSession = null;
     public void login() {
// Get the session from session.xml
aSession = (ServerSession)SessionManager.getManager().getSession("TestSession");
System.out.println(aSession);
* This method is used to disconnect from the database
public void logout() {
aSession.logout();
* Main method
public static void main(String[] args) {
          test t = new test();
          t.login();
          UnitOfWork uow = t.getUnitofWork();
          Person p = new Person();
          Person clonetest = (Person)uow.registerObject(p);
          clonetest.setPersonid(31979);
          clonetest.setFirstname("vasubabu");
          clonetest.setLastname("bathina");
          clonetest.setGender("M");
          clonetest.setLastupdatedby("ABC");
          clonetest.setLastupdatedwhen(new java.util.Date());
          uow.commit();
     public UnitOfWork getUnitofWork() {
          return aSession.acquireUnitOfWork() ;
Project xml
<?xml version = '1.0' encoding = 'UTF-8'?>
<toplink:object-persistence xmlns:opm="http://xmlns.oracle.com/ias/xsds/opm" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:toplink="http://xmlns.oracle.com/ias/xsds/toplink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<opm:name>Test</opm:name>
<opm:class-mapping-descriptors>
<opm:class-mapping-descriptor xsi:type="toplink:relational-class-mapping-descriptor">
<opm:class>Person</opm:class>
<opm:alias>Person</opm:alias>
<opm:primary-key>
<opm:field table="PERSON" name="PERSON_ID" xsi:type="opm:column"/>
</opm:primary-key>
<opm:events/>
<opm:querying/>
<opm:attribute-mappings>
<opm:attribute-mapping xsi:type="toplink:direct-mapping">
<opm:attribute-name>firstname</opm:attribute-name>
<opm:get-method>getFirstname</opm:get-method>
<opm:set-method>setFirstname</opm:set-method>
<opm:field table="PERSON" name="FIRST_NAME" xsi:type="opm:column"/>
</opm:attribute-mapping>
<opm:attribute-mapping xsi:type="toplink:direct-mapping">
<opm:attribute-name>gender</opm:attribute-name>
<opm:get-method>getGender</opm:get-method>
<opm:set-method>setGender</opm:set-method>
<opm:field table="PERSON" name="GENDER" xsi:type="opm:column"/>
</opm:attribute-mapping>
<opm:attribute-mapping xsi:type="toplink:direct-mapping">
<opm:attribute-name>lastname</opm:attribute-name>
<opm:get-method>getLastname</opm:get-method>
<opm:set-method>setLastname</opm:set-method>
<opm:field table="PERSON" name="LAST_NAME" xsi:type="opm:column"/>
</opm:attribute-mapping>
<opm:attribute-mapping xsi:type="toplink:direct-mapping">
<opm:attribute-name>lastupdatedby</opm:attribute-name>
<opm:get-method>getLastupdatedby</opm:get-method>
<opm:set-method>setLastupdatedby</opm:set-method>
<opm:field table="PERSON" name="LAST_UPDATED_BY" xsi:type="opm:column"/>
</opm:attribute-mapping>
<opm:attribute-mapping xsi:type="toplink:direct-mapping">
<opm:attribute-name>lastupdatedwhen</opm:attribute-name>
<opm:get-method>getLastupdatedwhen</opm:get-method>
<opm:set-method>setLastupdatedwhen</opm:set-method>
<opm:field table="PERSON" name="LAST_UPDATED_WHEN" xsi:type="opm:column"/>
</opm:attribute-mapping>
<opm:attribute-mapping xsi:type="toplink:direct-mapping">
<opm:attribute-name>personid</opm:attribute-name>
<opm:get-method>getPersonid</opm:get-method>
<opm:set-method>setPersonid</opm:set-method>
<opm:field table="PERSON" name="PERSON_ID" xsi:type="opm:column"/>
</opm:attribute-mapping>
</opm:attribute-mappings>
<toplink:descriptor-type>independent</toplink:descriptor-type>
<toplink:sequencing>
<toplink:sequence-name>seq_person_id</toplink:sequence-name>
<toplink:sequence-field table="PERSON" name="PERSON_ID" xsi:type="opm:column"/>
</toplink:sequencing>
<toplink:instantiation/>
<toplink:copying/>
<toplink:tables>
<toplink:table name="PERSON"/>
</toplink:tables>
</opm:class-mapping-descriptor>
</opm:class-mapping-descriptors>
<toplink:login xsi:type="database-login">
<toplink:platform-class>oracle.toplink.internal.databaseaccess.OraclePlatform</toplink:platform-class>
<toplink:user-name>citytime</toplink:user-name>
<toplink:password>9469F498BD56203FD481D5B2C4201C78</toplink:password>
<toplink:driver-class>oracle.jdbc.driver.OracleDriver</toplink:driver-class>
<toplink:connection-url>jdbc:oracle:thin:@derby:1524:ctfdeva1</toplink:connection-url>
<toplink:native-sequencing>true</toplink:native-sequencing>
</toplink:login>
</toplink:object-persistence>

Similar Messages

  • How to create a sequence using Toplink for DUAL table

    Hi All,
    How do I create below sequence using TOPLINK
    CREATE sequence my_seq start WITH 1;
    Regards,
    Dheeraj

    Hi Dheeraj,
    Sequence Object should be created in Database and specify the type of sequence that will be used in toplink to create sequence value.For example,sequence objects created in database needs to be configured using Native Sequence.
    For more information refer to the below link.Use JDeveloper Toplink Wizards for declarative programming of Toplink native Sequencing.
    http://www.oracle.com/technology/products/ias/toplink/doc/1013/main/_html/reldscfg003.htm.
    Regards,
    P.Vinay Kumar

  • Generating value of column using sequence in Toplink

    Hi
    I have a toplink pojo table, say SamplePojo. I need to automatically generate a value for the primary key field, say id. Is it possible to insert only the name field into the table and let toplink generate a value for id field using sequence?
    I try the following code from my client class
    Project project = XMLProjectReader.read("META-INF/tlMap.xml", Thread.currentThread().getContextClassLoader());
    DatabaseSession session = project.createDatabaseSession();
    session.shouldLogMessages();
    session.login();
    String query = "insert into SAMPLE_POJO(NAME) values('SAMPLE NAME')";               
    session.executeSQL(query);
    session.logout();If i execute the above code i get a error like "Internal Exception: java.sql.SQLException: ORA-01400: cannot insert NULL into ("MYSCHEMA"."SAMPLE_POJO"."ID")"
    This is how my SamplePojo class looks like
    @Entity
    public class SamplePojo iimplements Serializablel {
        @Id
        @GeneratedValue(generator = "sampleSequence")
        @SequenceGenerator(name = "sampleSequence", sequenceName = "SAMP_SEQ", allocationSize = 1)
        private BigDecimal id;
        private String name;
        public SamplePojo(BigDecimal id, String name) {
            this.name = name;
            this.id = id;
    //getters and setters for class variables
    }

    Are you trying to use JPA, or the native TopLink API?
    Your annotations are JPA, but your code is the native API, using the XMLProjectReader.read("META-INF/tlMap.xml"), either use one or the other.
    With JPA, you will just have a persistence.xml, and optionally an orm.xml (you will not use the Mapping Workbench).
    To insert an object you just create an instance of the class and call persist(), no SQL.
    i.e.
    EntityManager em = factory.createEntityManager();
    em.getTransaction().begin();
    SamplePojo pojo = new SamplePojo();
    pojo.setName("SAMPLE NAME");
    em.persist(pojo);
    em.getTransaction().commit();
    James : http://www.eclipselink.org

  • Toplink JPA and handle to a sequence

    Hi All,
    I am trying to figure out a way to get a handle to an Oracle sequence and use it from the java application i.e. run operations like currval/nextval.
    The reason I need this flexibility is to refer 2 sequences from the java app and apply it on a single table. Currently the table i am trying to insert already has a sequence which is a primary key generator. We do refer it in our JPA annotations and this works fine.
    But there was a need where another column (not part of Primary key) also needs its values from a different sequence.
    When we try to refer it from Toplink JPA it does not allow and errors stating cannot have 2 sequences mapping for a single table entity.
    Let me know your thoughts.
    Thanks

    You could use a native SQL query to get the nextval or curval from the Sequence.
    TopLink/EclipseLink should support an API for this, or allow multiple sequences per object, please vote for these bugs,
    https://bugs.eclipse.org/bugs/show_bug.cgi?id=267701
    https://bugs.eclipse.org/bugs/show_bug.cgi?id=320456
    James : http://www.eclipselink.org

  • SEQUENCE TABLE QUESTION

    For the sequencing processing, i tell TopLink to use Native Sequencing in my mapping file. When i generate it, TopLink write in the file :
    <uses-native-sequencing>true</uses-native-sequencing>
    <sequence-table>SEQUENCE</sequence-table>
    <sequence-name-field>SEQ_NAME</sequence-name-field>
    <sequence-counter-field>SEQ_COUNT</sequence-counter-field>
    But my SEQUENCE TABLE name is USER_SEQUENCES (ORACLE SYSTEM TABLE) with SEQUENCE_NAME and LAST_NUMBER as fields.
    I can not rename this table in "SEQUENCE" like TopLink want.
    How can i do without modify the mapping file ?

    I have the proof that TopLink use the sequence-table, sequence-name-field, sequence-counter-field when i use Native Sequencing. TopLink generates :
    <uses-native-sequencing>true</uses-native-sequencing>
    <sequence-preallocation-size>1</sequence-preallocation-size>
    <sequence-table>SEQUENCE</sequence-table>
    <sequence-name-field>SEQ_NAME</sequence-name-field>
    <sequence-counter-field>SEQ_COUNT</sequence-counter-field>
    SEQUENCE is not found when i commit a record -> error
    If i modify the XML file with :
    <uses-native-sequencing>true</uses-native-sequencing>
    <sequence-preallocation-size>1</sequence-preallocation-size>
    <sequence-table>USER_SEQUENCES</sequence-table>
    <sequence-name-field>SEQUENCE_NAME</sequence-name-field>
    <sequence-counter-field>LAST_NUMBER</sequence-counter-field>
    USER_SEQUENCES exist, it works !!
    Here is my code when i log to my server :
    private static ServerSession launchServer() {
    if (_server == null) {
    String fileName =
    Configuration.getInstance().getProperty(
    "project.mapping_file");
    if (new File(fileName).exists()) {
    Project builderProject = XMLProjectReader.read (fileName);
    _server = (ServerSession)   builderProject.createServerSession (1, 50);
    _server.useExclusiveReadConnectionPool(1, 1);
    _server.logMessages();
    try {
    _server.login();
    } catch (DatabaseException e) {
    } else {
    throw new RuntimeException(
    "Fichier " + fileName + " n'existe pas...");
    } else {
    throw new RuntimeException("M�thode static StarServerSession.launchServer() ex�cut�e deux fois...");
    return _server;
    My code to acquire a client session :
    public void open() throws DBException {
    try {
    clientSession = DBServerSession.server.acquireClientSession();
    } catch (DatabaseException e) {
    throw new DBException(
    DBException.DATABASE_EXCEPTION_ERROR_CODE,
    e.getDatabaseErrorCode(),
    e.getMessage());
    }

  • How to specify multiple sequence for multiple fields in a primary key!

    Hi,
    i have a table which has about 15 fields, one of the field is primary key and i am able to specify the sequence for it using toplink and when the object is created through toplink the sequence get generated automatically, which is fine.
    Now i have to add another sequence generated field to the table this field is not nullable and
    i am looking for a way in toplink to specify the sequence for this field too, so that when we create objects through toplink the value for the field is automatically generated instead of us fetching the next value from sequence using a sql statement and then using the set method for the field.
    is there a way i can specify a sequence for another field through toplink, while keeping the sequence settings for the primary field untouched.
    thanks for your help!
    -

    TopLink only supports a single sequence field in its' mappings. There should be an API you can use to get another sequence number from an event, but I could not find an easy one (please log a bug for this on EclipseLink). The following code might work if you define the other sequence in TopLink, but you could also just execute the raw SQL as you are doing.
    i.e. something like,
    preInsert(DescriptorEvent event) {
    MyObject object = (MyObject) event.getObject();
    object.setOtherId(event.getSession().getDatasourcePlatform().getSequence("MY_OTHER_SEQ").getGeneratedValue(event.getSession().getAccessor(), event.getSession()));
    -- James : http://www.eclipselink.org

  • JPA Sequencing

    Hi All,
    I'm working with Toplink JPA. I'm trying work using sequence in toplink JPA.
    What I'm doing is
    @Id
    @sequenceGenerator(name="seq_name" ,allocationSize=1)
    @GeneratedValue(strategy=GeneratedType.SEQUENCE,generation="seq_name")
    i am following the above steps but it is giving error as
    select table_name.nextval from dual.
    where should i mention this select query.
    please send reply as early as possible
    Thanks in advance,
    regards,
    satish

    Thanks for your response Mr ailitche,
    I'm able to work with sequence. I did not properly given the sequence generator name.
    Now corrected that and it is working fine.
    Thanks,
    Satish

  • Specified IDENTITY, got SEQUENCE

    I am using SAS9 as part of JEE 5 SDK, ontop of MaxDB.
    In one of my EJB 3.0 Entities, I have the following code:
    @Id
    @GeneratedValue(strategy = IDENTITY)
    private int id;The code gets compiled, packaged and validated without problem.
    But at deployment, SAS9 puts the following line into the log:
    [#|2006-07-29T14:40:42.243+0200|WARNING|sun-appserver-pe9.0|javax.enterprise.system.core.classloading|_ThreadID=12;_ThreadName=Thread-25;_RequestID=ae15f407-26d8-4423-b48f-8de844f9cac3;|Exception [TOPLINK-7144] (Oracle TopLink Essentials - 2006.4 (Build 060412)): oracle.toplink.essentials.exceptions.ValidationException
    Exception Description: SEQ_GEN_SEQUENCE: platform DatabasePlatform doesn't support NativeSequence.
    javax.persistence.PersistenceException: Exception [TOPLINK-7144] (Oracle TopLink Essentials - 2006.4 (Build 060412)): oracle.toplink.essentials.exceptions.ValidationException
    Exception Description: SEQ_GEN_SEQUENCE: platform DatabasePlatform doesn't support NativeSequence.
    at oracle.toplink.essentials.ejb.cmp3.EntityManagerFactoryProvider.createContainerEntityManagerFactory(EntityManagerFactoryProvider.java:173)
    It looks like SAS9's integrated OracleTopLink tries to do SEQUENCE while I specified IDENTITY. Unfortunately, SAS9 is not enabling the JSF application ontop of this persistence module in turn. As a result, my complete application is not accessible.
    Sounds like a bug.
    What do you think?

    Both Identity Seuqnce are treated as native sequence by
    toplink.But this is a clear violation of the EJB 3.0 persistence specification. So where can I report this violation to get fixed?
    MaxDB is not supported platform on toplink
    essentials.What can I do become MaxDB to be supported? I am an experienced software engineering professional (coding more than 20 years, analysis and design more than 9 years) and would like to contribute the necessary code changes. Can you tell me where to apply for that?
    You can use strategy=GenerationType.TABLE which is
    portable across all databases.I'll try doing that now. Actually I tried leaving it open to SAS9 to decide, but it then chooses SEQUENCE, which certainly fails in turn.
    Can you please post some more details about the issue
    you are having with the JSF aplpication.What exactly do you need to know? I think it is obvious that JSF will no more render once SAS9 is running on severe DB failures. Or shoulf JSF render an error page?

  • Concurrency into sequence tables

    Hi,
    Is there any concurrency problem by using sequence tables instead of a real sequence?
    []s

    In general there is no concurrency problem, however using the sequence table TopLink allocates the sequences in another transaction/connection(with server session). There may be an issue when using external connection pools and JTS and no non-JTS pool, as the sequence table access will be in the JTS transaction so could reduce concurrency in this specific case.
    If you are using Oracle, then native sequencing with sequence objects and preallocation through the increment is suggested, and is a little more efficient and concurrent than table sequencing.
    If you are any other database the sequence table with preallocation is suggested as their native sequencing does not allow preallocation.

  • Need help in Pessimistic locking

    I am getting the Maiximum of primaryKey field using reportquery ..now i want to lock the object of the report query. i am doing as following
    ExpressionBuilder exp=new ExpressionBuilder();
    ReportQuery query=new ReportQuery();               
    query.setReferenceClass(Abc.class);               
    query.addAttribute("memberId",exp.get("memberId").maximum());
    query.acquireLocksWithoutWaiting();          
    Vector results = (Vector)uow.executeQuery(query);
    System.out.println("results---->"+results);
    now i increment the value of primary key as follows
    ReportQueryResult result1=(ReportQueryResult)results.get(0);          
    System.out.println("hello"+result1.getByIndex(0));
    Integer ctr=(Integer)result1.getByIndex(0);
    System.out.println("ctr:-"+ctr);
    int count=ctr.intValue();
    count=count+1;
    System.out.println("incrementedValue:-"+count)
    here i insert the new record to the database ;;
    the whole code work fine but when i trying to implement the pessimistic locking by
         query.acquireLocksWithoutWaiting();     
    it will gives the following error..Please help me ..thanks in Advance     
    ServerSession(28523022)--Connection(27817788)--SELECT MAX(MemberId) FROM Abc FOR UPDATE OF * NOWAIT
    Local Exception Stack:
    Exception [TOPLINK-4002] (OracleAS TopLink - 10g (9.0.4.5) (Build 040930)): oracle.toplink.exceptions.DatabaseException
    Exception Description: com.sybase.jdbc3.jdbc.SybSQLException: Incorrect syntax near '*'.
    Internal Exception: com.sybase.jdbc3.jdbc.SybSQLException: Incorrect syntax near '*'.
    Error Code: 102
         at oracle.toplink.exceptions.DatabaseException.sqlException(DatabaseException.java:227)
         at oracle.toplink.internal.databaseaccess.DatabaseAccessor.executeCall(DatabaseAccessor.java:698)
         at oracle.toplink.threetier.ServerSession.executeCall(ServerSession.java:506)
         at oracle.toplink.internal.queryframework.CallQueryMechanism.executeCall(CallQueryMechanism.java:131)
         at oracle.toplink.internal.queryframework.CallQueryMechanism.executeCall(CallQueryMechanism.java:115)
         at oracle.toplink.internal.queryframework.CallQueryMechanism.executeSelectCall(CallQueryMechanism.java:194)
         at oracle.toplink.internal.queryframework.CallQueryMechanism.selectAllRows(CallQueryMechanism.java:565)
         at oracle.toplink.internal.queryframework.ExpressionQueryMechanism.selectAllRowsFromTable(ExpressionQueryMechanism.java:733)
         at oracle.toplink.internal.queryframework.ExpressionQueryMechanism.selectAllReportQueryRows(ExpressionQueryMechanism.java:694)
         at oracle.toplink.queryframework.ReportQuery.execute(ReportQuery.java:442)
         at oracle.toplink.queryframework.DatabaseQuery.execute(DatabaseQuery.java:493)
         at oracle.toplink.queryframework.ReadQuery.execute(ReadQuery.java:125)
         at oracle.toplink.publicinterface.Session.internalExecuteQuery(Session.java:1958)
         at oracle.toplink.threetier.ServerSession.internalExecuteQuery(ServerSession.java:629)
         at oracle.toplink.threetier.ClientSession.internalExecuteQuery(ClientSession.java:392)
         at oracle.toplink.publicinterface.Session.executeQuery(Session.java:1086)
         at oracle.toplink.publicinterface.UnitOfWork.internalExecuteQuery(UnitOfWork.java:2189)
         at oracle.toplink.publicinterface.Session.executeQuery(Session.java:1086)
         at oracle.toplink.publicinterface.Session.executeQuery(Session.java:1038)
         at com.pearson.Test.Test.insert(Test.java:664)
         at com.pearson.Test.Test.main(Test.java:78)
    Caused by: com.sybase.jdbc3.jdbc.SybSQLException: Incorrect syntax near '*'.
         at com.sybase.jdbc3.tds.Tds.a(Unknown Source)
         at com.sybase.jdbc3.tds.Tds.nextResult(Unknown Source)
         at com.sybase.jdbc3.jdbc.ResultGetter.nextResult(Unknown Source)
         at com.sybase.jdbc3.jdbc.SybStatement.nextResult(Unknown Source)
         at com.sybase.jdbc3.jdbc.SybStatement.nextResult(Unknown Source)
         at com.sybase.jdbc3.jdbc.SybStatement.queryLoop(Unknown Source)
         at com.sybase.jdbc3.jdbc.SybStatement.executeQuery(Unknown Source)
         at com.sybase.jdbc3.jdbc.SybPreparedStatement.executeQuery(Unknown Source)
         at oracle.toplink.internal.databaseaccess.DatabaseAccessor.executeSelect(DatabaseAccessor.java:802)
         at oracle.toplink.internal.databaseaccess.DatabaseAccessor.executeCall(DatabaseAccessor.java:651)
         ... 19 more

    I will explain you what I am trying to do:- we want to allocate the primary key to each new inserted row. suppose there are more than one user who are trying to insert the record in the database on the click of save button..how we can handle this situation by allocating them unique Id to each row..how we can genrate unique primary key to all the users who are inserting the new rows.
    Please help me how can i genrate unique primary key if more than one user inserting the data in the database. As you said use sequencing in toplink how can i use this?our database is sybase is it support Pessimistic locking or optimistic locking. need urgent help
    thanks in advance

  • DBAdapter and Sequcne on 10.1.3.3

    I have an issue regarding using native sequnce in DBAdapter to insert a new record into database.
    For Bpel 10.1.2
    I have to problem to use native sequnce by setting *mappig.xml and oc4j.xml.
    For Bpel 10.1.3.3 I saw "cnnot insert NULL" error. I am not sure why.
    ==The error message
    ORA-01400: cannot insert NULL into ("AP"."AP_INVOICES_INTERFACE"."INVOICE_ID") Error Code: 1400 Query:InsertObjectQuery(&lt;ApInvoiceLinesInterface {&lt;ApInvoicesInterface null />} null />)</detail> }}
    ==Setting on my ApInvoice.xml
    <opm:primary-key>
    opm:field table="AP_INVOICE_LINES_INTERFACE" name="INVOICE_ID" xsi:type="opm:column"/>
    <opm:field table="AP_INVOICE_LINES_INTERFACE" name="INVOICE_LINE_ID" xsi:type="opm:column"/>
    </opm:primary-key>
    <toplink:sequencing>
    <toplink:sequence-name>AP.AP_INVOICE_LINES_INTERFACE_S</toplink:sequence-name>
    <toplink:sequence-field table="AP_INVOICE_LINES_INTERFACE" name="INVOICE_LINE_ID" xsi:type="opm:column"/>
    </toplink:sequencing>
    <opm:primary-key>
    <opm:field table="AP_INVOICES_INTERFACE" name="INVOICE_ID" xsi:type="opm:column"/>
    </opm:primary-key>
    <toplink:sequencing>
    <toplink:sequence-name>AP.AP_INVOICES_INTERFACE_S</toplink:sequence-name>
    <toplink:sequence-field table="AP_INVOICES_INTERFACE" name="INVOICE_ID" xsi:type="opm:column"/>
    </toplink:sequencing>

    I did some experiments
    I created a sequence TESTAN_S start with 50 increment by 50.
    I have inserted 300 rows using DB adaptrer with native sequencing option.
    The ID's in table are incremented by 1 staring with 50 ie 50,51,52,53.....upto 351..
    This is wrong as sequence.nextval should always be incerments of 50 not 1. I dont know why this is happening. What is the significance of preallocation size tag?
    Here are the steps I followed to achieve this. its working somewhat but not exactly what i was expecting. I just changes the files manually and did not run any wizards after changing the files manually.
    1. On the Top link I have selected Native sequencing Option and pre allocation=50 and Save
    2. Open the bpel/servicename_toplink_mappings.xml and add sequence.. see the xml pasted below.
    <?xml version="1.0" encoding="UTF-8"?>
    <toplink:object-persistence version="Oracle TopLink - 10g Release 3 (10.1.3.3.0) (Build 070608)" xmlns:opm="http://xmlns.oracle.com/ias/xsds/opm" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:toplink="http://xmlns.oracle.com/ias/xsds/toplink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <opm:name>readtest_service</opm:name>
    <opm:class-mapping-descriptors>
    <opm:class-mapping-descriptor xsi:type="toplink:relational-class-mapping-descriptor">
    <opm:class>readtestservice.Readtest</opm:class>
    <opm:alias>Readtest</opm:alias>
    <opm:primary-key>
    <opm:field table="READTEST" name="ID" xsi:type="opm:column"/>
    </opm:primary-key>
    <opm:events xsi:type="toplink:event-policy"/>
    <opm:querying xsi:type="toplink:query-policy">
    <opm:queries>
    <opm:query name="findAllReadtest" xsi:type="toplink:read-all-query">
    <toplink:timeout>0</toplink:timeout>
    <toplink:reference-class>readtestservice.Readtest</toplink:reference-class>
    <toplink:cache-usage>primary-key</toplink:cache-usage>
    <toplink:lock-mode>none</toplink:lock-mode>
    <toplink:container xsi:type="toplink:list-container-policy">
    <toplink:collection-type>java.util.Vector</toplink:collection-type>
    </toplink:container>
    </opm:query>
    </opm:queries>
    <toplink:does-exist-query xsi:type="toplink:does-exist-query">
    <toplink:existence-check>check-database</toplink:existence-check>
    </toplink:does-exist-query>
    </opm:querying>
    <opm:attribute-mappings>
    <opm:attribute-mapping xsi:type="toplink:direct-mapping">
    <opm:attribute-name>id</opm:attribute-name>
    <opm:field table="READTEST" name="ID" xsi:type="opm:column"/>
    <opm:attribute-classification>java.math.BigDecimal</opm:attribute-classification>
    </opm:attribute-mapping>
    <opm:attribute-mapping xsi:type="toplink:direct-mapping">
    <opm:attribute-name>value</opm:attribute-name>
    <opm:field table="READTEST" name="VALUE" xsi:type="opm:column"/>
    <opm:attribute-classification>java.lang.String</opm:attribute-classification>
    </opm:attribute-mapping>
    <opm:attribute-mapping xsi:type="toplink:direct-mapping">
    <opm:attribute-name>updateDate</opm:attribute-name>
    <opm:field table="READTEST" name="UPDATE_DATE" xsi:type="opm:column"/>
    <opm:attribute-classification>java.sql.Timestamp</opm:attribute-classification>
    </opm:attribute-mapping>
    </opm:attribute-mappings>
    <toplink:descriptor-type>independent</toplink:descriptor-type>
    <toplink:caching>
    <toplink:cache-type>weak-reference</toplink:cache-type>
    <toplink:always-refresh>true</toplink:always-refresh>
    </toplink:caching>
    <toplink:remote-caching>
    <toplink:cache-type>weak-reference</toplink:cache-type>
    </toplink:remote-caching>
    <toplink:instantiation/>
    <toplink:copying xsi:type="toplink:instantiation-copy-policy"/>
    <toplink:change-policy xsi:type="toplink:deferred-detection-change-policy"/>
              <toplink:sequencing>
    <toplink:sequence-name>TESTAN_S</toplink:sequence-name>
    <toplink:sequence-field table="READTEST" name="ID" xsi:type="opm:column"/>
    </toplink:sequencing>
    <toplink:tables>
    <toplink:table name="READTEST"/>
    </toplink:tables>
    </opm:class-mapping-descriptor>
    </opm:class-mapping-descriptors>
    </toplink:object-persistence>
    3. add following in class descriptor.xml in toplink/servicename/descripter/servicename.tablename.ClassDescripter.xml
    <sequence-number-name>TESTAN_S</sequence-number-name>
    <uses-sequencing>true</uses-sequencing>
    see below for the complete file:
    <?xml version = '1.0' encoding = 'UTF-8'?>
    <descriptor>
    <unique-filename>readtestservice.Readtest.ClassDescriptor</unique-filename>
    <active>true</active>
    <bldr-class>readtestservice.Readtest</bldr-class>
    <mappings>
    <mapping>
    <inherited>false</inherited>
    <instance-variable-name>id</instance-variable-name>
    <default-field-names>
    <default-field-name>direct field=</default-field-name>
    </default-field-names>
    <uses-method-accessing>false</uses-method-accessing>
    <read-only>false</read-only>
    <get-method-handle>
    <method-handle/>
    </get-method-handle>
    <set-method-handle>
    <method-handle/>
    </set-method-handle>
    <direct-mapping-field-handle>
    <field-handle>
    <field-table>APPS.READTEST</field-table>
    <field-name>ID</field-name>
    </field-handle>
    </direct-mapping-field-handle>
    <mapping-class>MWDirectToFieldMapping</mapping-class>
    </mapping>
    <mapping>
    <inherited>false</inherited>
    <instance-variable-name>value</instance-variable-name>
    <default-field-names>
    <default-field-name>direct field=</default-field-name>
    </default-field-names>
    <uses-method-accessing>false</uses-method-accessing>
    <read-only>false</read-only>
    <get-method-handle>
    <method-handle/>
    </get-method-handle>
    <set-method-handle>
    <method-handle/>
    </set-method-handle>
    <direct-mapping-field-handle>
    <field-handle>
    <field-table>APPS.READTEST</field-table>
    <field-name>VALUE</field-name>
    </field-handle>
    </direct-mapping-field-handle>
    <mapping-class>MWDirectToFieldMapping</mapping-class>
    </mapping>
    <mapping>
    <inherited>false</inherited>
    <instance-variable-name>updateDate</instance-variable-name>
    <default-field-names>
    <default-field-name>direct field=</default-field-name>
    </default-field-names>
    <uses-method-accessing>false</uses-method-accessing>
    <read-only>false</read-only>
    <get-method-handle>
    <method-handle/>
    </get-method-handle>
    <set-method-handle>
    <method-handle/>
    </set-method-handle>
    <direct-mapping-field-handle>
    <field-handle>
    <field-table>APPS.READTEST</field-table>
    <field-name>UPDATE_DATE</field-name>
    </field-handle>
    </direct-mapping-field-handle>
    <mapping-class>MWDirectToFieldMapping</mapping-class>
    </mapping>
    </mappings>
    <sequence-number-name>TESTAN_S</sequence-number-name>
    <uses-sequencing>true</uses-sequencing>
    <should-always-refresh-cache>true</should-always-refresh-cache>
    <primary-key-field-handles>
    <field-handle>
    <field-table>APPS.READTEST</field-table>
    <field-name>ID</field-name>
    </field-handle>
    </primary-key-field-handles>
    <primary-table>APPS.READTEST</primary-table>
    <associated-tables>
    <associated-table>
    <name>APPS.READTEST</name>
    </associated-table>
    </associated-tables>
    <sequence-number-field-handle>
    <field-handle/>
    </sequence-number-field-handle>
    <class-descriptor-query-manager>
    <query-manager>
    <descriptor-alias>Readtest</descriptor-alias>
    <query-list>
    <query>
    <name>findAllReadtest</name>
    <query-type>oracle.toplink.queryframework.ReadAllQuery</query-type>
    <cache-usage>Check Cache by Primary Key</cache-usage>
    <lock-mode>Do Not Acquire Locks</lock-mode>
    <distinct-state>Uncomputed Distinct</distinct-state>
    <in-memory-query-indirection-policy>Throw Indirection Exception</in-memory-query-indirection-policy>
    <cache-query-results>false</cache-query-results>
    <maintain-cache>true</maintain-cache>
    <refresh-identity-map-result>false</refresh-identity-map-result>
    <refresh-remote-identity-map-result>false</refresh-remote-identity-map-result>
    <use-wrapper-policy>true</use-wrapper-policy>
    <prepare>true</prepare>
    <query-timeout>0</query-timeout>
    <maximum-rows>0</maximum-rows>
    <format>
    <query-format>
    <main-compound-expression>
    <expression>
    <operator-type>AND</operator-type>
    <expression-class>MWCompoundExpression</expression-class>
    </expression>
    </main-compound-expression>
    <query-format-class>MWExpressionQueryFormat</query-format-class>
    </query-format>
    </format>
    </query>
    </query-list>
    </query-manager>
    </class-descriptor-query-manager>
    <class-descriptor-identity-policy>
    <identity-policy>
    <identity-map-size>100</identity-map-size>
    <identity-map-class-name>oracle.toplink.internal.identitymaps.WeakIdentityMap</identity-map-class-name>
    <existence-checking>Check database</existence-checking>
    </identity-policy>
    </class-descriptor-identity-policy>
    <descriptor-class>MWClassDescriptor</descriptor-class>
    </descriptor>

  • JPA: Attr ... mapped to a primary key column in the DB. Update not allowed.

    Let me just say that I posted a bug report for this here:
    https://glassfish.dev.java.net/issues/show_bug.cgi?id=3937
    But I'm also posting the info here, so that people who search on this forum may get some help:
    TopLink (both Essentials and 11g) has a problem with flushing entities
    containing a self-reference relationship. When flushing, the following exception
    occurs:
    Exception [TOPLINK-7251] (Oracle TopLink Essentials - 2.1 (Build b14-fcs
    (12/17/2007))): oracle.toplink.essentials.exceptions.ValidationException
    Exception Description: The attribute [id] of class [test.jpa.entities.Person] is
    mapped to a primary key column in the database. Updates are not allowed.
    No manual updates have been made to ANY primary key.
    What I'm doing is:
    1. I instantiate a new entity.
    2. I start a transaction
    3. I persist the new entity.
    4. I read an existing entity from the DB.
    5. I let the existing entity point to the new entity via the self-reference
    relationship.
    6. I flush the persistence context.
    7. I issue commit(), and the exception occurs. (I have provided the stack traces for various versions of TopLink below.)
    This is a clear bug.
    Here are some additional observations:
    1. Reproduced on the following versions of TopLink:
    1.1. Oracle TopLink Essentials - 2.0 (Build b58g-fcs (09/07/2007))
    1.2. Oracle TopLink Essentials - 2.1 (Build b14-fcs (12/17/2007))
    1.3. Oracle TopLink - 11g Technology Preview 3 (11.1.1.0.0) (Build 071214)
    2. Reproducible both on Java SE and Java EE. (I tested on Oracle Application Server)
    3. Reproducible with and without class weaving
    4. Reproducible regardless of whether the JPA annotations are on fields or on
    methods
    5. Reproducible regardless of whether "cascade={CascadeType.PERSIST}" is used or
    not.
    6. Reproducible regardless of the fetch type of the self-reference relationship
    (EAGER or LAZY).
    Also:
    1. Without flushing, the bug doesn't occur. That is, if I commit without
    flushing, it works.
    2. Without setting the self-reference relationship, the bug doesn't occur.
    This is an issue that appears when using BOTH self-reference relationship AND
    flushing.
    Best regards,
    Bisser
    The message was edited by bisser:
    Added info that the exception occurs "when I issue commit()" on step 7.

    I'm extremely surprised that you couldn't reproduce the error. It's reproduced each time when I run the Test Scenario that I described above.
    You could download a sample Eclipse project that reproduces the error from here: https://glassfish.dev.java.net/issues/show_bug.cgi?id=3937
    For the log below I used TopLink, version: Oracle TopLink Essentials - 2.0 (Build b58g-fcs (09/07/2007)).
    Could you, please, tell me what version you use and I will try the Test Case on it.
    Here's the FINEST log:
    [TopLink Finest]: 2008.01.09 07:35:58.094--ServerSession(1968077)--Thread(Thread[Main Thread,5,main])--property=toplink.weaving; value=false
    [TopLink Finest]: 2008.01.09 07:35:59.312--ServerSession(1968077)--Thread(Thread[Main Thread,5,main])--property=toplink.orm.throw.exceptions; default value=true
    [TopLink Finer]: 2008.01.09 07:35:59.312--ServerSession(1968077)--Thread(Thread[Main Thread,5,main])--Searching for default mapping file in file:/D:/dev/bull/jpa_pk_bug/bin/
    [TopLink Config]: 2008.01.09 07:35:59.547--ServerSession(1968077)--Thread(Thread[Main Thread,5,main])--The alias name for the entity class [class test.jpa.entities.Person] is being defaulted to: Person.
    [TopLink Config]: 2008.01.09 07:35:59.594--ServerSession(1968077)--Thread(Thread[Main Thread,5,main])--The column name for element [private java.lang.Long test.jpa.entities.Person.id] is being defaulted to: ID.
    [TopLink Config]: 2008.01.09 07:35:59.609--ServerSession(1968077)--Thread(Thread[Main Thread,5,main])--The column name for element [private java.lang.String test.jpa.entities.Person.name] is being defaulted to: NAME.
    [TopLink Config]: 2008.01.09 07:35:59.641--ServerSession(1968077)--Thread(Thread[Main Thread,5,main])--The target entity (reference) class for the many to one mapping element [test.jpa.entities.Person test.jpa.entities.Person.mgr] is being defaulted to: class test.jpa.entities.Person.
    [TopLink Config]: 2008.01.09 07:35:59.703--ServerSession(1968077)--Thread(Thread[Main Thread,5,main])--The primary key column name for the mapping element [test.jpa.entities.Person test.jpa.entities.Person.mgr] is being defaulted to: ID.
    [TopLink Finest]: 2008.01.09 07:35:59.703--ServerSession(1968077)--Thread(Thread[Main Thread,5,main])--end predeploying Persistence Unit Test; state Predeployed; factoryCount 0
    [TopLink Finer]: 2008.01.09 07:35:59.703--Thread(Thread[Main Thread,5,main])--cmp_init_transformer_is_null
    [TopLink Finest]: 2008.01.09 07:35:59.703--ServerSession(1968077)--Thread(Thread[Main Thread,5,main])--begin predeploying Persistence Unit Test; state Predeployed; factoryCount 0
    [TopLink Finest]: 2008.01.09 07:35:59.703--ServerSession(1968077)--Thread(Thread[Main Thread,5,main])--end predeploying Persistence Unit Test; state Predeployed; factoryCount 1
    [TopLink Finest]: 2008.01.09 07:35:59.719--ServerSession(1968077)--Thread(Thread[Main Thread,5,main])--begin deploying Persistence Unit Test; state Predeployed; factoryCount 1
    [TopLink Finest]: 2008.01.09 07:35:59.734--ServerSession(1968077)--Thread(Thread[Main Thread,5,main])--property=toplink.logging.level; value=FINEST; translated value=FINEST
    [TopLink Finest]: 2008.01.09 07:35:59.734--ServerSession(1968077)--Thread(Thread[Main Thread,5,main])--property=toplink.logging.level; value=FINEST; translated value=FINEST
    [TopLink Finest]: 2008.01.09 07:35:59.750--ServerSession(1968077)--Thread(Thread[Main Thread,5,main])--property=toplink.jdbc.user; value=rms
    [TopLink Finest]: 2008.01.09 07:35:59.750--ServerSession(1968077)--Thread(Thread[Main Thread,5,main])--property=toplink.jdbc.password; value=xxxxxx
    [TopLink Finest]: 2008.01.09 07:36:00.766--ServerSession(1968077)--Thread(Thread[Main Thread,5,main])--property=toplink.target-database; value=Oracle; translated value=oracle.toplink.essentials.platform.database.oracle.OraclePlatform
    [TopLink Finest]: 2008.01.09 07:36:00.781--ServerSession(1968077)--Thread(Thread[Main Thread,5,main])--property=toplink.jdbc.driver; value=oracle.jdbc.OracleDriver
    [TopLink Finest]: 2008.01.09 07:36:00.781--ServerSession(1968077)--Thread(Thread[Main Thread,5,main])--property=toplink.jdbc.url; value=jdbc:oracle:thin:@//10.20.6.126:1521/region2
    [TopLink Info]: 2008.01.09 07:36:00.797--ServerSession(1968077)--Thread(Thread[Main Thread,5,main])--TopLink, version: Oracle TopLink Essentials - 2.0 (Build b58g-fcs (09/07/2007))
    [TopLink Config]: 2008.01.09 07:36:00.812--ServerSession(1968077)--Connection(5182312)--Thread(Thread[Main Thread,5,main])--connecting(DatabaseLogin(
         platform=>OraclePlatform
         user name=> "rms"
         datasource URL=> "jdbc:oracle:thin:@//10.20.6.126:1521/region2"
    [TopLink Config]: 2008.01.09 07:36:01.797--ServerSession(1968077)--Connection(4252099)--Thread(Thread[Main Thread,5,main])--Connected: jdbc:oracle:thin:@//10.20.6.126:1521/region2
         User: RMS
         Database: Oracle  Version: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bit Production
    With the Partitioning, OLAP and Data Mining options
         Driver: Oracle JDBC driver  Version: 10.2.0.1.0
    [TopLink Config]: 2008.01.09 07:36:01.797--ServerSession(1968077)--Connection(5744890)--Thread(Thread[Main Thread,5,main])--connecting(DatabaseLogin(
         platform=>OraclePlatform
         user name=> "rms"
         datasource URL=> "jdbc:oracle:thin:@//10.20.6.126:1521/region2"
    [TopLink Config]: 2008.01.09 07:36:01.875--ServerSession(1968077)--Connection(5747801)--Thread(Thread[Main Thread,5,main])--Connected: jdbc:oracle:thin:@//10.20.6.126:1521/region2
         User: RMS
         Database: Oracle  Version: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bit Production
    With the Partitioning, OLAP and Data Mining options
         Driver: Oracle JDBC driver  Version: 10.2.0.1.0
    [TopLink Config]: 2008.01.09 07:36:01.891--ServerSession(1968077)--Connection(5760373)--Thread(Thread[Main Thread,5,main])--connecting(DatabaseLogin(
         platform=>OraclePlatform
         user name=> "rms"
         datasource URL=> "jdbc:oracle:thin:@//10.20.6.126:1521/region2"
    [TopLink Config]: 2008.01.09 07:36:01.969--ServerSession(1968077)--Connection(5763284)--Thread(Thread[Main Thread,5,main])--Connected: jdbc:oracle:thin:@//10.20.6.126:1521/region2
         User: RMS
         Database: Oracle  Version: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bit Production
    With the Partitioning, OLAP and Data Mining options
         Driver: Oracle JDBC driver  Version: 10.2.0.1.0
    [TopLink Config]: 2008.01.09 07:36:01.969--ServerSession(1968077)--Connection(5497095)--Thread(Thread[Main Thread,5,main])--connecting(DatabaseLogin(
         platform=>OraclePlatform
         user name=> "rms"
         datasource URL=> "jdbc:oracle:thin:@//10.20.6.126:1521/region2"
    [TopLink Config]: 2008.01.09 07:36:02.047--ServerSession(1968077)--Connection(5500006)--Thread(Thread[Main Thread,5,main])--Connected: jdbc:oracle:thin:@//10.20.6.126:1521/region2
         User: RMS
         Database: Oracle  Version: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bit Production
    With the Partitioning, OLAP and Data Mining options
         Driver: Oracle JDBC driver  Version: 10.2.0.1.0
    [TopLink Config]: 2008.01.09 07:36:02.047--ServerSession(1968077)--Connection(5512041)--Thread(Thread[Main Thread,5,main])--connecting(DatabaseLogin(
         platform=>OraclePlatform
         user name=> "rms"
         datasource URL=> "jdbc:oracle:thin:@//10.20.6.126:1521/region2"
    [TopLink Config]: 2008.01.09 07:36:02.125--ServerSession(1968077)--Connection(5514977)--Thread(Thread[Main Thread,5,main])--Connected: jdbc:oracle:thin:@//10.20.6.126:1521/region2
         User: RMS
         Database: Oracle  Version: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bit Production
    With the Partitioning, OLAP and Data Mining options
         Driver: Oracle JDBC driver  Version: 10.2.0.1.0
    [TopLink Config]: 2008.01.09 07:36:02.125--ServerSession(1968077)--Connection(5527528)--Thread(Thread[Main Thread,5,main])--connecting(DatabaseLogin(
         platform=>OraclePlatform
         user name=> "rms"
         datasource URL=> "jdbc:oracle:thin:@//10.20.6.126:1521/region2"
    [TopLink Config]: 2008.01.09 07:36:02.203--ServerSession(1968077)--Connection(5530440)--Thread(Thread[Main Thread,5,main])--Connected: jdbc:oracle:thin:@//10.20.6.126:1521/region2
         User: RMS
         Database: Oracle  Version: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bit Production
    With the Partitioning, OLAP and Data Mining options
         Driver: Oracle JDBC driver  Version: 10.2.0.1.0
    [TopLink Config]: 2008.01.09 07:36:02.203--ServerSession(1968077)--Connection(5542993)--Thread(Thread[Main Thread,5,main])--connecting(DatabaseLogin(
         platform=>OraclePlatform
         user name=> "rms"
         datasource URL=> "jdbc:oracle:thin:@//10.20.6.126:1521/region2"
    [TopLink Config]: 2008.01.09 07:36:02.281--ServerSession(1968077)--Connection(5545904)--Thread(Thread[Main Thread,5,main])--Connected: jdbc:oracle:thin:@//10.20.6.126:1521/region2
         User: RMS
         Database: Oracle  Version: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bit Production
    With the Partitioning, OLAP and Data Mining options
         Driver: Oracle JDBC driver  Version: 10.2.0.1.0
    [TopLink Finest]: 2008.01.09 07:36:02.312--ServerSession(1968077)--Thread(Thread[Main Thread,5,main])--sequencing connected, state is Preallocation_NoTransaction_State
    [TopLink Info]: 2008.01.09 07:36:02.484--ServerSession(1968077)--Thread(Thread[Main Thread,5,main])--file:/D:/dev/bull/jpa_pk_bug/bin/-Test login successful
    [TopLink Finest]: 2008.01.09 07:36:02.484--ServerSession(1968077)--Thread(Thread[Main Thread,5,main])--end deploying Persistence Unit Test; state Deployed; factoryCount 1
    [TopLink Finer]: 2008.01.09 07:36:02.516--ServerSession(1968077)--Thread(Thread[Main Thread,5,main])--client acquired
    [TopLink Finest]: 2008.01.09 07:36:02.531--UnitOfWork(5663897)--Thread(Thread[Main Thread,5,main])--Execute query DoesExistQuery()
    [TopLink Finest]: 2008.01.09 07:36:02.547--UnitOfWork(5663897)--Thread(Thread[Main Thread,5,main])--PERSIST operation called on: test.jpa.entities.Person@563c8c.
    [TopLink Finest]: 2008.01.09 07:36:02.562--ClientSession(5666151)--Thread(Thread[Main Thread,5,main])--Execute query ValueReadQuery()
    [TopLink Fine]: 2008.01.09 07:36:02.594--ServerSession(1968077)--Connection(5747801)--Thread(Thread[Main Thread,5,main])--SELECT PERSONS_ID_SEQ.NEXTVAL FROM DUAL
    [TopLink Finest]: 2008.01.09 07:36:03.297--ServerSession(1968077)--Thread(Thread[Main Thread,5,main])--sequencing preallocation for PERSONS_ID_SEQ: objects: 1 , first: 5, last: 5
    [TopLink Finest]: 2008.01.09 07:36:03.312--UnitOfWork(5663897)--Thread(Thread[Main Thread,5,main])--assign sequence to the object (5 -> test.jpa.entities.Person@563c8c)
    [TopLink Finest]: 2008.01.09 07:36:03.328--UnitOfWork(5663897)--Thread(Thread[Main Thread,5,main])--Execute query ReadObjectQuery(test.jpa.entities.Person)
    [TopLink Fine]: 2008.01.09 07:36:03.438--ServerSession(1968077)--Connection(4252099)--Thread(Thread[Main Thread,5,main])--SELECT ID, NAME, MGR_ID FROM Persons WHERE (ID = ?)
         bind => [1]
    [TopLink Finest]: 2008.01.09 07:36:03.531--UnitOfWork(5663897)--Thread(Thread[Main Thread,5,main])--Register the existing object test.jpa.entities.Person@3a4484
    [TopLink Finer]: 2008.01.09 07:36:03.625--ClientSession(5666151)--Connection(5763284)--Thread(Thread[Main Thread,5,main])--begin transaction
    [TopLink Finest]: 2008.01.09 07:36:03.625--UnitOfWork(5663897)--Thread(Thread[Main Thread,5,main])--Execute query UpdateObjectQuery(test.jpa.entities.Person@3a57fa)
    [TopLink Finest]: 2008.01.09 07:36:03.641--UnitOfWork(5663897)--Thread(Thread[Main Thread,5,main])--Execute query WriteObjectQuery(test.jpa.entities.Person@563c8c)
    [TopLink Fine]: 2008.01.09 07:36:03.656--ClientSession(5666151)--Connection(5763284)--Thread(Thread[Main Thread,5,main])--INSERT INTO Persons (ID, NAME, MGR_ID) VALUES (?, ?, ?)
         bind => [5, Boss, null]
    [TopLink Fine]: 2008.01.09 07:36:03.688--ClientSession(5666151)--Connection(5763284)--Thread(Thread[Main Thread,5,main])--UPDATE Persons SET MGR_ID = ? WHERE (ID = ?)
         bind => [5, 1]
    [TopLink Finer]: 2008.01.09 07:36:03.703--UnitOfWork(5663897)--Thread(Thread[Main Thread,5,main])--begin unit of work commit
    [TopLink Finest]: 2008.01.09 07:36:03.703--UnitOfWork(5663897)--Thread(Thread[Main Thread,5,main])--Execute query UpdateObjectQuery(test.jpa.entities.Person@563c8c)
    [TopLink Warning]: 2008.01.09 07:36:03.812--UnitOfWork(5663897)--Thread(Thread[Main Thread,5,main])--Local Exception Stack:
    Exception [TOPLINK-7251] (Oracle TopLink Essentials - 2.0 (Build b58g-fcs (09/07/2007))): oracle.toplink.essentials.exceptions.ValidationException
    Exception Description: The attribute [id] of class [test.jpa.entities.Person] is mapped to a primary key column in the database. Updates are not allowed.
         at oracle.toplink.essentials.exceptions.ValidationException.primaryKeyUpdateDisallowed(ValidationException.java:2222)
         at oracle.toplink.essentials.mappings.foundation.AbstractDirectMapping.writeFromObjectIntoRowWithChangeRecord(AbstractDirectMapping.java:750)
         at oracle.toplink.essentials.internal.descriptors.ObjectBuilder.buildRowForUpdateWithChangeSet(ObjectBuilder.java:948)
         at oracle.toplink.essentials.internal.queryframework.DatabaseQueryMechanism.updateObjectForWriteWithChangeSet(DatabaseQueryMechanism.java:1263)
         at oracle.toplink.essentials.queryframework.UpdateObjectQuery.executeCommitWithChangeSet(UpdateObjectQuery.java:91)
         at oracle.toplink.essentials.internal.queryframework.DatabaseQueryMechanism.executeWriteWithChangeSet(DatabaseQueryMechanism.java:390)
         at oracle.toplink.essentials.queryframework.WriteObjectQuery.executeDatabaseQuery(WriteObjectQuery.java:109)
         at oracle.toplink.essentials.queryframework.DatabaseQuery.execute(DatabaseQuery.java:628)
         at oracle.toplink.essentials.queryframework.DatabaseQuery.executeInUnitOfWork(DatabaseQuery.java:555)
         at oracle.toplink.essentials.queryframework.ObjectLevelModifyQuery.executeInUnitOfWorkObjectLevelModifyQuery(ObjectLevelModifyQuery.java:138)
         at oracle.toplink.essentials.queryframework.ObjectLevelModifyQuery.executeInUnitOfWork(ObjectLevelModifyQuery.java:110)
         at oracle.toplink.essentials.internal.sessions.UnitOfWorkImpl.internalExecuteQuery(UnitOfWorkImpl.java:2233)
         at oracle.toplink.essentials.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:952)
         at oracle.toplink.essentials.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:909)
         at oracle.toplink.essentials.internal.sessions.CommitManager.commitChangedObjectsForClassWithChangeSet(CommitManager.java:309)
         at oracle.toplink.essentials.internal.sessions.CommitManager.commitAllObjectsWithChangeSet(CommitManager.java:195)
         at oracle.toplink.essentials.internal.sessions.AbstractSession.writeAllObjectsWithChangeSet(AbstractSession.java:2657)
         at oracle.toplink.essentials.internal.sessions.UnitOfWorkImpl.commitToDatabase(UnitOfWorkImpl.java:1044)
         at oracle.toplink.essentials.internal.ejb.cmp3.base.RepeatableWriteUnitOfWork.commitToDatabase(RepeatableWriteUnitOfWork.java:403)
         at oracle.toplink.essentials.internal.sessions.UnitOfWorkImpl.commitToDatabaseWithChangeSet(UnitOfWorkImpl.java:1126)
         at oracle.toplink.essentials.internal.ejb.cmp3.base.RepeatableWriteUnitOfWork.commitRootUnitOfWork(RepeatableWriteUnitOfWork.java:107)
         at oracle.toplink.essentials.internal.sessions.UnitOfWorkImpl.commitAndResume(UnitOfWorkImpl.java:856)
         at oracle.toplink.essentials.internal.ejb.cmp3.transaction.base.EntityTransactionImpl.commit(EntityTransactionImpl.java:102)
         at oracle.toplink.essentials.internal.ejb.cmp3.transaction.EntityTransactionImpl.commit(EntityTransactionImpl.java:60)
         at test.jpa.TestPkBug.runTest(TestPkBug.java:53)
         at test.jpa.TestPkBug.main(TestPkBug.java:95)
    [TopLink Finer]: 2008.01.09 07:36:03.828--ClientSession(5666151)--Connection(5763284)--Thread(Thread[Main Thread,5,main])--rollback transaction
    [TopLink Finer]: 2008.01.09 07:36:03.844--UnitOfWork(5663897)--Thread(Thread[Main Thread,5,main])--release unit of work
    [TopLink Finer]: 2008.01.09 07:36:03.844--UnitOfWork(5663897)--Thread(Thread[Main Thread,5,main])--initialize identitymaps
    [TopLink Finer]: 2008.01.09 07:36:03.844--ClientSession(5666151)--Thread(Thread[Main Thread,5,main])--client released
    [TopLink Finest]: 2008.01.09 07:36:03.844--ServerSession(1968077)--Thread(Thread[Main Thread,5,main])--begin undeploying Persistence Unit Test; state Deployed; factoryCount 1
    [TopLink Finest]: 2008.01.09 07:36:03.844--ServerSession(1968077)--Thread(Thread[Main Thread,5,main])--sequencing disconnected
    [TopLink Config]: 2008.01.09 07:36:03.844--ServerSession(1968077)--Connection(4252099)--Thread(Thread[Main Thread,5,main])--disconnect
    [TopLink Finer]: 2008.01.09 07:36:03.859--ServerSession(1968077)--Thread(Thread[Main Thread,5,main])--initialize identitymaps
    [TopLink Info]: 2008.01.09 07:36:03.859--ServerSession(1968077)--Thread(Thread[Main Thread,5,main])--file:/D:/dev/bull/jpa_pk_bug/bin/-Test logout successful
    [TopLink Config]: 2008.01.09 07:36:03.859--ServerSession(1968077)--Connection(5747801)--Thread(Thread[Main Thread,5,main])--disconnect
    [TopLink Config]: 2008.01.09 07:36:03.859--ServerSession(1968077)--Connection(5182312)--Thread(Thread[Main Thread,5,main])--disconnect
    [TopLink Config]: 2008.01.09 07:36:03.859--ServerSession(1968077)--Connection(5500006)--Thread(Thread[Main Thread,5,main])--disconnect
    [TopLink Config]: 2008.01.09 07:36:03.875--ServerSession(1968077)--Connection(5514977)--Thread(Thread[Main Thread,5,main])--disconnect
    [TopLink Config]: 2008.01.09 07:36:03.875--ServerSession(1968077)--Connection(5530440)--Thread(Thread[Main Thread,5,main])--disconnect
    [TopLink Config]: 2008.01.09 07:36:03.875--ServerSession(1968077)--Connection(5545904)--Thread(Thread[Main Thread,5,main])--disconnect
    [TopLink Config]: 2008.01.09 07:36:03.891--ServerSession(1968077)--Connection(5763284)--Thread(Thread[Main Thread,5,main])--disconnect
    [TopLink Finest]: 2008.01.09 07:36:03.891--ServerSession(1968077)--Thread(Thread[Main Thread,5,main])--end undeploying Persistence Unit Test; state Undeployed; factoryCount 0
    Exception in thread "Main Thread" javax.persistence.RollbackException: Exception [TOPLINK-7251] (Oracle TopLink Essentials - 2.0 (Build b58g-fcs (09/07/2007))): oracle.toplink.essentials.exceptions.ValidationException
    Exception Description: The attribute [id] of class [test.jpa.entities.Person] is mapped to a primary key column in the database. Updates are not allowed.
         at oracle.toplink.essentials.internal.ejb.cmp3.transaction.base.EntityTransactionImpl.commit(EntityTransactionImpl.java:120)
         at oracle.toplink.essentials.internal.ejb.cmp3.transaction.EntityTransactionImpl.commit(EntityTransactionImpl.java:60)
         at test.jpa.TestPkBug.runTest(TestPkBug.java:53)
         at test.jpa.TestPkBug.main(TestPkBug.java:95)
    Caused by: Exception [TOPLINK-7251] (Oracle TopLink Essentials - 2.0 (Build b58g-fcs (09/07/2007))): oracle.toplink.essentials.exceptions.ValidationException
    Exception Description: The attribute [id] of class [test.jpa.entities.Person] is mapped to a primary key column in the database. Updates are not allowed.
         at oracle.toplink.essentials.exceptions.ValidationException.primaryKeyUpdateDisallowed(ValidationException.java:2222)
         at oracle.toplink.essentials.mappings.foundation.AbstractDirectMapping.writeFromObjectIntoRowWithChangeRecord(AbstractDirectMapping.java:750)
         at oracle.toplink.essentials.internal.descriptors.ObjectBuilder.buildRowForUpdateWithChangeSet(ObjectBuilder.java:948)
         at oracle.toplink.essentials.internal.queryframework.DatabaseQueryMechanism.updateObjectForWriteWithChangeSet(DatabaseQueryMechanism.java:1263)
         at oracle.toplink.essentials.queryframework.UpdateObjectQuery.executeCommitWithChangeSet(UpdateObjectQuery.java:91)
         at oracle.toplink.essentials.internal.queryframework.DatabaseQueryMechanism.executeWriteWithChangeSet(DatabaseQueryMechanism.java:390)
         at oracle.toplink.essentials.queryframework.WriteObjectQuery.executeDatabaseQuery(WriteObjectQuery.java:109)
         at oracle.toplink.essentials.queryframework.DatabaseQuery.execute(DatabaseQuery.java:628)
         at oracle.toplink.essentials.queryframework.DatabaseQuery.executeInUnitOfWork(DatabaseQuery.java:555)
         at oracle.toplink.essentials.queryframework.ObjectLevelModifyQuery.executeInUnitOfWorkObjectLevelModifyQuery(ObjectLevelModifyQuery.java:138)
         at oracle.toplink.essentials.queryframework.ObjectLevelModifyQuery.executeInUnitOfWork(ObjectLevelModifyQuery.java:110)
         at oracle.toplink.essentials.internal.sessions.UnitOfWorkImpl.internalExecuteQuery(UnitOfWorkImpl.java:2233)
         at oracle.toplink.essentials.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:952)
         at oracle.toplink.essentials.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:909)
         at oracle.toplink.essentials.internal.sessions.CommitManager.commitChangedObjectsForClassWithChangeSet(CommitManager.java:309)
         at oracle.toplink.essentials.internal.sessions.CommitManager.commitAllObjectsWithChangeSet(CommitManager.java:195)
         at oracle.toplink.essentials.internal.sessions.AbstractSession.writeAllObjectsWithChangeSet(AbstractSession.java:2657)
         at oracle.toplink.essentials.internal.sessions.UnitOfWorkImpl.commitToDatabase(UnitOfWorkImpl.java:1044)
         at oracle.toplink.essentials.internal.ejb.cmp3.base.RepeatableWriteUnitOfWork.commitToDatabase(RepeatableWriteUnitOfWork.java:403)
         at oracle.toplink.essentials.internal.sessions.UnitOfWorkImpl.commitToDatabaseWithChangeSet(UnitOfWorkImpl.java:1126)
         at oracle.toplink.essentials.internal.ejb.cmp3.base.RepeatableWriteUnitOfWork.commitRootUnitOfWork(RepeatableWriteUnitOfWork.java:107)
         at oracle.toplink.essentials.internal.sessions.UnitOfWorkImpl.commitAndResume(UnitOfWorkImpl.java:856)
         at oracle.toplink.essentials.internal.ejb.cmp3.transaction.base.EntityTransactionImpl.commit(EntityTransactionImpl.java:102)
         ... 3 moreEDIT: Are you using the EXACT Test Case as I have described it in the previous posts? It's important that you commit(), and not rollback(), the transaction after the flush.
    EDIT: Updated the log because I found out that I had made a small change to the original Test Case while I was trying to find a workaround. The current log is produced by the EXACT Test Case I described in my previous posts.
    Message was edited by:
    bisser

  • Idocs miss match.

    Hi,
    I am changing a Customer Details using XD02 Tx.
    In BD50,The Message type'OILDEB' is Active.
    But when I run Program 'RBDMIDOC' to create an Idoc to send this change to other system,I am (At Times,not always)getting Idocs created in wrong order.
    Like for example >> Idoc 12 with creation time 5.00pm and Idoc 13 with creation time 3.00pm (Both were created on same day).
    Can there be a possiblity that Idoc 13 be created before Idoc 12 or is this an exceptional case?
    I was under the impression that Idocs get created in a sequence.
    Its Urgent.Kindly let me know.
    Regards,
    Shashank.

    yes, it is possible in idocs that they may be sent in that way because
    some idocs may be in queue which will send them later.
    SHASHANK AMIN wrote :
    Its Urgent.Kindly let me know.
      Follow the rules of engagement and dont use these kind of words.

  • ServerSession disconnects

    I am having a problem I need some help understanding.
    My application was developed with JDeveloper 10.1.3.3, JSF, ADF Faces, and Toplink, Session Facade EJB. The application is running on a Solaris 10 box and deployed with in OC4J (OAS 10gR3); it is clustered across 2 servers. the connection pool and data source are setup with OAS's default settings.
    We are using Loadrunner to help us determine maximum concurrent users for our application. The first test was with 5 concurrent users which ran flawlessly for over 20 minutes. The next was with 10 concurrent users; this test produces a nullpointerexception at approximately 9 users:
    [TopLink Warning]: 2008.10.08 05:48:58.790--UnitOfWork(30090810)--Thread(Thread[AJPRequestHandler-RMICallHandler-5,5,HTTPThreadGroup])--java.lang.NullPointerException
         at oracle.toplink.internal.queryframework.DatasourceCallQueryMechanism.insertObject(DatasourceCallQueryMechanism.java:213)
         at oracle.toplink.internal.queryframework.StatementQueryMechanism.insertObject(StatementQueryMechanism.java:156)
         at oracle.toplink.internal.queryframework.StatementQueryMechanism.insertObject(StatementQueryMechanism.java:170)
         at oracle.toplink.internal.queryframework.DatabaseQueryMechanism.insertObjectForWrite(DatabaseQueryMechanism.java:426)
         at oracle.toplink.queryframework.InsertObjectQuery.executeCommit(InsertObjectQuery.java:65)
         at oracle.toplink.queryframework.InsertObjectQuery.executeCommitWithChangeSet(InsertObjectQuery.java:75)
         at oracle.toplink.internal.queryframework.DatabaseQueryMechanism.executeWriteWithChangeSet(DatabaseQueryMechanism.java:251)
         at oracle.toplink.queryframework.WriteObjectQuery.executeDatabaseQuery(WriteObjectQuery.java:47)
         at oracle.toplink.queryframework.DatabaseQuery.execute(DatabaseQuery.java:620)
                    ...From the logs, it appears that the ServerSession is disconnecting reconnecting at odd intevals. Sometimes it disconnects within 5 seconds of connecting and sometime within 5 minutes.
    The application makes a call to persistEntity and rthe ServerSession disconnects and reconnects before persstEntity returns, which is when this nullpointer happens.
    public Object persistEntity(Object entity) {
            UnitOfWork uow = getSessionFactory().acquireUnitOfWork();
            Object existingObject = uow.readObject(entity);
            if (existingObject != null)
                throw new RuntimeException("Entity already exists");
            Object newInstance = uow.mergeClone(entity);
            uow.commit();
            return newInstance;
        }So, what is causing the irregular disconnects and is their anything I can do about it?
    If more information is needed, I can provide more of the logs or try to explain further.
    Thanks for your help.

    Thanks for reply.
    Right now, I have no idea what might be causing the disconnects.
    The log file is actually littered with the disconnects/reconnects. They appear to be happening at randowm intervals. Here are a few of them.
    [TopLink Info]: 2008.10.08 05:48:42.845--ServerSession(9009672)--Thread(Thread[AJPRequestHandler-RMICallHandler-5,5,HTTPThreadGroup])--ODSession login successful
    [TopLink Info]: 2008.10.08 05:48:57.231--ServerSession(9009672)--Thread(Thread[AJPRequestHandler-RMICallHandler-6,5,HTTPThreadGroup])--ODSession logout successful
    [TopLink Info]: 2008.10.08 05:48:57.987--ServerSession(27684092)--Thread(Thread[AJPRequestHandler-RMICallHandler-6,5,HTTPThreadGroup])--ODSession login successful
    [TopLink Info]: 2008.10.08 05:48:57.989--ServerSession(27684092)--Thread(Thread[AJPRequestHandler-RMICallHandler-5,5,HTTPThreadGroup])--ODSession logout successful
    [TopLink Info]: 2008.10.08 05:48:58.776--ServerSession(2410561)--Thread(Thread[AJPRequestHandler-RMICallHandler-5,5,HTTPThreadGroup])--ODSession login successful
    [TopLink Info]: 2008.10.08 05:48:58.779--ServerSession(2410561)--Thread(Thread[AJPRequestHandler-RMICallHandler-6,5,HTTPThreadGroup])--ODSession logout successfulThis is my sessions.xml. Would increasing the max-connections value help?
    <?xml version = '1.0' encoding = 'UTF-8'?>
    <!DOCTYPE toplink-configuration PUBLIC "-//Oracle Corp.//DTD TopLink Sessions 9.0.4//EN" "sessions_9_0_4.dtd">
    <toplink-configuration>
       <session>
          <name>ODSession</name>
          <project-xml>META-INF/ODMap.xml</project-xml>
          <session-type>
             <server-session/>
          </session-type>
          <login>
             <driver-class>oracle.jdbc.OracleDriver</driver-class>
             <datasource>jdbc/OLVIMSDS</datasource>
             <platform-class>oracle.toplink.platform.database.oracle.Oracle10Platform</platform-class>
             <uses-external-connection-pool>true</uses-external-connection-pool>
             <uses-external-transaction-controller>true</uses-external-transaction-controller>
          </login>
          <external-transaction-controller-class>oracle.toplink.transaction.oc4j.Oc4jTransactionController</external-transaction-controller-class>
          <enable-logging>true</enable-logging>
          <logging-options>
             <print-session>true</print-session>
             <print-connection>true</print-connection>
             <print-date>true</print-date>
          </logging-options>
       </session>
    </toplink-configuration>This is a chunk from the logs leading up to the nullpointer.
    [TopLink Finest]: 2008.10.08 05:48:53.782--ServerSession(9009672)--Thread(Thread[AJPRequestHandler-RMICallHandler-7,5,HTTPThreadGroup])--reconnecting to external connection pool
    [TopLink Fine]: 2008.10.08 05:48:53.783--ServerSession(9009672)--Connection(19858987)--Thread(Thread[AJPRequestHandler-RMICallHandler-7,5,HTTPThreadGroup])--select category_sequence, base_code, site_code, category, description
    from category
    where (base_code = 'BXUR' or base_code is null)
    and (site_code = 'B' or site_code is null)
    and description != 'NOT IN USE'
    order by category
    [TopLink Finer]: 2008.10.08 05:48:53.787--ClientSession(18496219)--Thread(Thread[AJPRequestHandler-RMICallHandler-7,5,HTTPThreadGroup])--client released
    [TopLink Finer]: 2008.10.08 05:48:53.787--ServerSession(9009672)--Thread(Thread[AJPRequestHandler-RMICallHandler-7,5,HTTPThreadGroup])--acquire unit of work: 14449643
    [TopLink Finer]: 2008.10.08 05:48:53.794--UnitOfWork(14449643)--Thread(Thread[AJPRequestHandler-RMICallHandler-7,5,HTTPThreadGroup])--release unit of work
    [TopLink Finer]: 2008.10.08 05:48:53.794--UnitOfWork(25907110)--Thread(Thread[AJPRequestHandler-RMICallHandler-7,5,HTTPThreadGroup])--TX beforeCompletion callback, status=STATUS_ACTIVE
    [TopLink Finer]: 2008.10.08 05:48:53.794--UnitOfWork(25907110)--Thread(Thread[AJPRequestHandler-RMICallHandler-7,5,HTTPThreadGroup])--begin unit of work commit
    [TopLink Finer]: 2008.10.08 05:48:53.795--UnitOfWork(25907110)--Thread(Thread[AJPRequestHandler-RMICallHandler-7,5,HTTPThreadGroup])--TX afterCompletion callback, status=COMMITTED
    [TopLink Finer]: 2008.10.08 05:48:53.795--UnitOfWork(25907110)--Thread(Thread[AJPRequestHandler-RMICallHandler-7,5,HTTPThreadGroup])--end unit of work commit
    [TopLink Finer]: 2008.10.08 05:48:53.795--UnitOfWork(25907110)--Thread(Thread[AJPRequestHandler-RMICallHandler-7,5,HTTPThreadGroup])--release unit of work
    [TopLink Finest]: 2008.10.08 05:48:57.230--ServerSession(9009672)--Thread(Thread[AJPRequestHandler-RMICallHandler-6,5,HTTPThreadGroup])--sequencing disconnected
    [TopLink Config]: 2008.10.08 05:48:57.231--ServerSession(9009672)--Connection(18573770)--Thread(Thread[AJPRequestHandler-RMICallHandler-6,5,HTTPThreadGroup])--disconnect
    [TopLink Finer]: 2008.10.08 05:48:57.231--ServerSession(9009672)--Thread(Thread[AJPRequestHandler-RMICallHandler-6,5,HTTPThreadGroup])--initialize identitymaps
    [TopLink Info]: 2008.10.08 05:48:57.231--ServerSession(9009672)--Thread(Thread[AJPRequestHandler-RMICallHandler-6,5,HTTPThreadGroup])--ODSession logout successful
    08/10/08 17:48:57 requesterInputText<JOE>
    08/10/08 17:48:57 phoneNumberInputText<123-4567>
    08/10/08 17:48:57 requiredInputDate<Wed Oct 08 17:47:00 GMT 2008>
    08/10/08 17:48:57 inputText1<0>
    08/10/08 17:48:57 statusInputText<0>
    08/10/08 17:48:57 typeInputText<1>
    [TopLink Info]: 2008.10.08 05:48:57.951--ServerSession(27684092)--Thread(Thread[AJPRequestHandler-RMICallHandler-6,5,HTTPThreadGroup])--TopLink, version: Oracle TopLink - 10g Release 3 (10.1.3.3.0) (Build 070608)
    [TopLink Info]: 2008.10.08 05:48:57.952--ServerSession(27684092)--Thread(Thread[AJPRequestHandler-RMICallHandler-6,5,HTTPThreadGroup])--Server: unknown
    [TopLink Config]: 2008.10.08 05:48:57.953--ServerSession(27684092)--Connection(20796893)--Thread(Thread[AJPRequestHandler-RMICallHandler-6,5,HTTPThreadGroup])--connecting(DatabaseLogin(
         platform=>Oracle10Platform
         user name=> ""
         connector=>JNDIConnector datasource name=>jdbc/OLVIMSDS
    [TopLink Config]: 2008.10.08 05:48:57.954--ServerSession(27684092)--Connection(18982962)--Thread(Thread[AJPRequestHandler-RMICallHandler-6,5,HTTPThreadGroup])--Connected: jdbc:oracle:thin:@//10.1.3.21:1521/OLVIMS.uprf021
         User: VQ_USR
         Database: Oracle  Version: Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
         Driver: Oracle JDBC driver  Version: 10.1.0.5.0
    [TopLink Config]: 2008.10.08 05:48:57.955--ServerSession(27684092)--Connection(11106965)--Thread(Thread[AJPRequestHandler-RMICallHandler-6,5,HTTPThreadGroup])--connecting(DatabaseLogin(
         platform=>Oracle10Platform
         user name=> ""
         connector=>JNDIConnector datasource name=>jdbc/OLVIMSDS
    [TopLink Config]: 2008.10.08 05:48:57.956--ServerSession(27684092)--Connection(17381623)--Thread(Thread[AJPRequestHandler-RMICallHandler-6,5,HTTPThreadGroup])--Connected: jdbc:oracle:thin:@//10.1.3.21:1521/OLVIMS.uprf021
         User: VQ_USR
         Database: Oracle  Version: Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
         Driver: Oracle JDBC driver  Version: 10.1.0.5.0
    [TopLink Finest]: 2008.10.08 05:48:57.957--ServerSession(27684092)--Thread(Thread[AJPRequestHandler-RMICallHandler-6,5,HTTPThreadGroup])--sequencing connected, state is Preallocation_NoTransaction_State
    [TopLink Finest]: 2008.10.08 05:48:57.957--ServerSession(27684092)--Thread(Thread[AJPRequestHandler-RMICallHandler-6,5,HTTPThreadGroup])--sequence CATEGORY_SEQ: preallocation size 1
    [TopLink Finest]: 2008.10.08 05:48:57.957--ServerSession(27684092)--Thread(Thread[AJPRequestHandler-RMICallHandler-6,5,HTTPThreadGroup])--sequence EMPLOYEE_SEQ: preallocation size 1
    [TopLink Finest]: 2008.10.08 05:48:57.957--ServerSession(27684092)--Thread(Thread[AJPRequestHandler-RMICallHandler-6,5,HTTPThreadGroup])--sequence CONTROL_NUMBER_SEQ: preallocation size 1
    [TopLink Finest]: 2008.10.08 05:48:57.958--ServerSession(27684092)--Thread(Thread[AJPRequestHandler-RMICallHandler-6,5,HTTPThreadGroup])--sequence GRADE_SEQ: preallocation size 1
    [TopLink Finest]: 2008.10.08 05:48:57.958--ServerSession(27684092)--Thread(Thread[AJPRequestHandler-RMICallHandler-6,5,HTTPThreadGroup])--sequence PROJECT_SEQ: preallocation size 1
    [TopLink Info]: 2008.10.08 05:48:57.987--ServerSession(27684092)--Thread(Thread[AJPRequestHandler-RMICallHandler-6,5,HTTPThreadGroup])--ODSession login successful
    [TopLink Finer]: 2008.10.08 05:48:57.987--ServerSession(27684092)--Thread(Thread[AJPRequestHandler-RMICallHandler-6,5,HTTPThreadGroup])--client acquired
    [TopLink Finest]: 2008.10.08 05:48:57.987--ServerSession(27684092)--Thread(Thread[AJPRequestHandler-RMICallHandler-5,5,HTTPThreadGroup])--sequencing disconnected
    [TopLink Finest]: 2008.10.08 05:48:57.988--ClientSession(8069186)--Thread(Thread[AJPRequestHandler-RMICallHandler-6,5,HTTPThreadGroup])--Execute query ReadAllQuery(olvims.dispatch.datamodel.Employee)
    [TopLink Config]: 2008.10.08 05:48:57.988--ServerSession(27684092)--Connection(25363108)--Thread(Thread[AJPRequestHandler-RMICallHandler-5,5,HTTPThreadGroup])--disconnect
    [TopLink Finer]: 2008.10.08 05:48:57.988--ServerSession(27684092)--Thread(Thread[AJPRequestHandler-RMICallHandler-5,5,HTTPThreadGroup])--initialize identitymaps
    [TopLink Finest]: 2008.10.08 05:48:57.989--ServerSession(27684092)--Thread(Thread[AJPRequestHandler-RMICallHandler-6,5,HTTPThreadGroup])--reconnecting to external connection pool
    [TopLink Info]: 2008.10.08 05:48:57.989--ServerSession(27684092)--Thread(Thread[AJPRequestHandler-RMICallHandler-5,5,HTTPThreadGroup])--ODSession logout successful
    [TopLink Fine]: 2008.10.08 05:48:57.989--ServerSession(27684092)--Connection(4978043)--Thread(Thread[AJPRequestHandler-RMICallHandler-6,5,HTTPThreadGroup])--select employee_id, base_code, site_code from employee where username = 'perf.052'
    [TopLink Finer]: 2008.10.08 05:48:57.996--ClientSession(8069186)--Thread(Thread[AJPRequestHandler-RMICallHandler-6,5,HTTPThreadGroup])--client released
    [TopLink Info]: 2008.10.08 05:48:58.738--ServerSession(2410561)--Thread(Thread[AJPRequestHandler-RMICallHandler-5,5,HTTPThreadGroup])--TopLink, version: Oracle TopLink - 10g Release 3 (10.1.3.3.0) (Build 070608)
    [TopLink Info]: 2008.10.08 05:48:58.739--ServerSession(2410561)--Thread(Thread[AJPRequestHandler-RMICallHandler-5,5,HTTPThreadGroup])--Server: unknown
    [TopLink Config]: 2008.10.08 05:48:58.740--ServerSession(2410561)--Connection(14106674)--Thread(Thread[AJPRequestHandler-RMICallHandler-5,5,HTTPThreadGroup])--connecting(DatabaseLogin(
         platform=>Oracle10Platform
         user name=> ""
         connector=>JNDIConnector datasource name=>jdbc/OLVIMSDS
    [TopLink Config]: 2008.10.08 05:48:58.741--ServerSession(2410561)--Connection(18938560)--Thread(Thread[AJPRequestHandler-RMICallHandler-5,5,HTTPThreadGroup])--Connected: jdbc:oracle:thin:@//10.1.3.21:1521/OLVIMS.uprf021
         User: VQ_USR
         Database: Oracle  Version: Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
         Driver: Oracle JDBC driver  Version: 10.1.0.5.0
    [TopLink Config]: 2008.10.08 05:48:58.742--ServerSession(2410561)--Connection(18143814)--Thread(Thread[AJPRequestHandler-RMICallHandler-5,5,HTTPThreadGroup])--connecting(DatabaseLogin(
         platform=>Oracle10Platform
         user name=> ""
         connector=>JNDIConnector datasource name=>jdbc/OLVIMSDS
    [TopLink Config]: 2008.10.08 05:48:58.743--ServerSession(2410561)--Connection(405074)--Thread(Thread[AJPRequestHandler-RMICallHandler-5,5,HTTPThreadGroup])--Connected: jdbc:oracle:thin:@//10.1.3.21:1521/OLVIMS.uprf021
         User: VQ_USR
         Database: Oracle  Version: Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
         Driver: Oracle JDBC driver  Version: 10.1.0.5.0
    [TopLink Finest]: 2008.10.08 05:48:58.743--ServerSession(2410561)--Thread(Thread[AJPRequestHandler-RMICallHandler-5,5,HTTPThreadGroup])--sequencing connected, state is Preallocation_NoTransaction_State
    [TopLink Finest]: 2008.10.08 05:48:58.744--ServerSession(2410561)--Thread(Thread[AJPRequestHandler-RMICallHandler-5,5,HTTPThreadGroup])--sequence CATEGORY_SEQ: preallocation size 1
    [TopLink Finest]: 2008.10.08 05:48:58.744--ServerSession(2410561)--Thread(Thread[AJPRequestHandler-RMICallHandler-5,5,HTTPThreadGroup])--sequence EMPLOYEE_SEQ: preallocation size 1
    [TopLink Finest]: 2008.10.08 05:48:58.744--ServerSession(2410561)--Thread(Thread[AJPRequestHandler-RMICallHandler-5,5,HTTPThreadGroup])--sequence CONTROL_NUMBER_SEQ: preallocation size 1
    [TopLink Finest]: 2008.10.08 05:48:58.744--ServerSession(2410561)--Thread(Thread[AJPRequestHandler-RMICallHandler-5,5,HTTPThreadGroup])--sequence GRADE_SEQ: preallocation size 1
    [TopLink Finest]: 2008.10.08 05:48:58.744--ServerSession(2410561)--Thread(Thread[AJPRequestHandler-RMICallHandler-5,5,HTTPThreadGroup])--sequence PROJECT_SEQ: preallocation size 1
    [TopLink Info]: 2008.10.08 05:48:58.776--ServerSession(2410561)--Thread(Thread[AJPRequestHandler-RMICallHandler-5,5,HTTPThreadGroup])--ODSession login successful
    [TopLink Finer]: 2008.10.08 05:48:58.777--ServerSession(2410561)--Thread(Thread[AJPRequestHandler-RMICallHandler-5,5,HTTPThreadGroup])--client acquired
    [TopLink Finest]: 2008.10.08 05:48:58.777--ServerSession(2410561)--Thread(Thread[AJPRequestHandler-RMICallHandler-6,5,HTTPThreadGroup])--sequencing disconnected
    [TopLink Finer]: 2008.10.08 05:48:58.777--ClientSession(3848478)--Thread(Thread[AJPRequestHandler-RMICallHandler-5,5,HTTPThreadGroup])--acquire unit of work: 30090810
    [TopLink Config]: 2008.10.08 05:48:58.777--ServerSession(2410561)--Connection(21979837)--Thread(Thread[AJPRequestHandler-RMICallHandler-6,5,HTTPThreadGroup])--disconnect
    [TopLink Finer]: 2008.10.08 05:48:58.778--UnitOfWork(30090810)--Thread(Thread[AJPRequestHandler-RMICallHandler-5,5,HTTPThreadGroup])--TX binding to tx mgr, status=STATUS_ACTIVE
    [TopLink Finer]: 2008.10.08 05:48:58.778--ServerSession(2410561)--Thread(Thread[AJPRequestHandler-RMICallHandler-6,5,HTTPThreadGroup])--initialize identitymaps
    [TopLink Finest]: 2008.10.08 05:48:58.778--UnitOfWork(30090810)--Thread(Thread[AJPRequestHandler-RMICallHandler-5,5,HTTPThreadGroup])--Execute query ReadObjectQuery(olvims.dispatch.datamodel.Request)
    [TopLink Info]: 2008.10.08 05:48:58.779--ServerSession(2410561)--Thread(Thread[AJPRequestHandler-RMICallHandler-6,5,HTTPThreadGroup])--ODSession logout successful
    [TopLink Finest]: 2008.10.08 05:48:58.780--ServerSession(2410561)--Thread(Thread[AJPRequestHandler-RMICallHandler-5,5,HTTPThreadGroup])--reconnecting to external connection pool
    [TopLink Fine]: 2008.10.08 05:48:58.780--ServerSession(2410561)--Connection(247040)--Thread(Thread[AJPRequestHandler-RMICallHandler-5,5,HTTPThreadGroup])--SELECT CONTROL_NUMBER, ESTIMATED_CARGO_WEIGHT, ESTIMATED_MILES, CREDIT_CARD_FLAG, HIGH_VISIBILITY_FLAG, RECURRING_MASTER_FLAG, REQUESTER_PHONE_NUMBER, BASE_CODE, REQUESTED_DATE, SITE_CODE, ESTIMATED_PASSENGERS, CATEGORY_SEQUENCE, PICKUP_LOCATION, RECURRING_CONTROL_NUMBER, DESTINATION, REQUEST_TYPE, LAST_UPDT_DATE, STATUS_CODE, CLOSED_DATE, COMBINED_CONTROL_NUMBER, ESTIMATED_RETURN_DATE, DISPATCHER_EMPLOYEE_ID, LAST_UPDT_USER, PROJECT_NUMBER, REQUIRED_DATE, REIMBURSABLE_CODE, REQUESTER, REQUESTER_GRADE_SEQUENCE, REMARKS, USING_ORG_CODE FROM REQUEST WHERE (CONTROL_NUMBER = NULL)
    [TopLink Finest]: 2008.10.08 05:48:58.784--UnitOfWork(30090810)--Thread(Thread[AJPRequestHandler-RMICallHandler-5,5,HTTPThreadGroup])--Merge clone olvims.dispatch.datamodel.Request@1b47245
    [TopLink Finer]: 2008.10.08 05:48:58.786--UnitOfWork(30090810)--Thread(Thread[AJPRequestHandler-RMICallHandler-5,5,HTTPThreadGroup])--TX beforeCompletion callback, status=STATUS_ACTIVE
    [TopLink Finer]: 2008.10.08 05:48:58.787--UnitOfWork(30090810)--Thread(Thread[AJPRequestHandler-RMICallHandler-5,5,HTTPThreadGroup])--begin unit of work commit
    [TopLink Finer]: 2008.10.08 05:48:58.788--ClientSession(3848478)--Thread(Thread[AJPRequestHandler-RMICallHandler-5,5,HTTPThreadGroup])--TX beginTransaction, status=STATUS_ACTIVE
    [TopLink Finest]: 2008.10.08 05:48:58.788--UnitOfWork(30090810)--Thread(Thread[AJPRequestHandler-RMICallHandler-5,5,HTTPThreadGroup])--Execute query InsertObjectQuery(olvims.dispatch.datamodel.Request@1ba2981)
    [TopLink Warning]: 2008.10.08 05:48:58.790--UnitOfWork(30090810)--Thread(Thread[AJPRequestHandler-RMICallHandler-5,5,HTTPThreadGroup])--java.lang.NullPointerException
         at oracle.toplink.internal.queryframework.DatasourceCallQueryMechanism.insertObject(DatasourceCallQueryMechanism.java:213)
         at oracle.toplink.internal.queryframework.StatementQueryMechanism.insertObject(StatementQueryMechanism.java:156)
         at oracle.toplink.internal.queryframework.StatementQueryMechanism.insertObject(StatementQueryMechanism.java:170)
         at oracle.toplink.internal.queryframework.DatabaseQueryMechanism.insertObjectForWrite(DatabaseQueryMechanism.java:426)
         at oracle.toplink.queryframework.InsertObjectQuery.executeCommit(InsertObjectQuery.java:65)
         at oracle.toplink.queryframework.InsertObjectQuery.executeCommitWithChangeSet(InsertObjectQuery.java:75)
         at oracle.toplink.internal.queryframework.DatabaseQueryMechanism.executeWriteWithChangeSet(DatabaseQueryMechanism.java:251)
         at oracle.toplink.queryframework.WriteObjectQuery.executeDatabaseQuery(WriteObjectQuery.java:47)
         at oracle.toplink.queryframework.DatabaseQuery.execute(DatabaseQuery.java:620)
         at oracle.toplink.queryframework.DatabaseQuery.executeInUnitOfWork(DatabaseQuery.java:542)
         at oracle.toplink.queryframework.ObjectLevelModifyQuery.executeInUnitOfWorkObjectLevelModifyQuery(ObjectLevelModifyQuery.java:100)
         at oracle.toplink.queryframework.ObjectLevelModifyQuery.executeInUnitOfWork(ObjectLevelModifyQuery.java:72)
         at oracle.toplink.publicinterface.UnitOfWork.internalExecuteQuery(UnitOfWork.java:2604)
         at oracle.toplink.publicinterface.Session.executeQuery(Session.java:993)
         at oracle.toplink.publicinterface.Session.executeQuery(Session.java:950)
         at oracle.toplink.internal.sessions.CommitManager.commitNewObjectsForClassWithChangeSet(CommitManager.java:243)
         at oracle.toplink.internal.sessions.CommitManager.commitAllObjectsWithChangeSet(CommitManager.java:162)
         at oracle.toplink.publicinterface.Session.writeAllObjectsWithChangeSet(Session.java:3193)
         at oracle.toplink.publicinterface.UnitOfWork.commitToDatabase(UnitOfWork.java:1293)
         at oracle.toplink.publicinterface.UnitOfWork.commitToDatabaseWithChangeSet(UnitOfWork.java:1389)
         at oracle.toplink.publicinterface.UnitOfWork.issueSQLbeforeCompletion(UnitOfWork.java:2866)
         at oracle.toplink.publicinterface.UnitOfWork.issueSQLbeforeCompletion(UnitOfWork.java:2846)
         at oracle.toplink.transaction.AbstractSynchronizationListener.beforeCompletion(AbstractSynchronizationListener.java:96)
         at oracle.toplink.transaction.JTASynchronizationListener.beforeCompletion(JTASynchronizationListener.java:55)
         at com.evermind.server.ApplicationServerTransaction.callBeforeCompletion(ApplicationServerTransaction.java:1066)
         at com.evermind.server.ApplicationServerTransaction.doCommit(ApplicationServerTransaction.java:275)
         at com.evermind.server.ApplicationServerTransaction.commit(ApplicationServerTransaction.java:162)
         at com.evermind.server.ApplicationServerTransactionManager.commit(ApplicationServerTransactionManager.java:472)
         at com.evermind.server.ejb.EJBTransactionManager.end(EJBTransactionManager.java:132)
         at com.evermind.server.ejb.interceptor.system.TxRequiredInterceptor.invoke(TxRequiredInterceptor.java:57)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
         at com.evermind.server.ejb.interceptor.system.DMSInterceptor.invoke(DMSInterceptor.java:52)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
         at com.evermind.server.ejb.InvocationContextPool.invoke(InvocationContextPool.java:55)
         at com.evermind.server.ejb.StatelessSessionEJBObject.OC4J_invokeMethod(StatelessSessionEJBObject.java:87)
         at ODPublicFacade_LocalProxy_6l476.persistEntity(Unknown Source)
         at sun.reflect.GeneratedMethodAccessor656.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at oracle.adf.model.binding.DCInvokeMethod.invokeMethod(DCInvokeMethod.java:507)
         at oracle.adf.model.binding.DCDataControl.invokeMethod(DCDataControl.java:1795)
         at oracle.adf.model.generic.DCGenericDataControl.invokeMethod(DCGenericDataControl.java:248)
         at oracle.adf.model.binding.DCInvokeMethod.callMethod(DCInvokeMethod.java:219)
         at oracle.jbo.uicli.binding.JUCtrlActionBinding.doIt(JUCtrlActionBinding.java:1289)
         at oracle.adf.model.binding.DCDataControl.invokeOperation(DCDataControl.java:1802)
         at oracle.adf.model.generic.DCGenericDataControl.invokeOperation(DCGenericDataControl.java:266)
         at oracle.adf.model.adapter.AdapterDCService.invokeOperation(AdapterDCService.java:305)
         at oracle.jbo.uicli.binding.JUCtrlActionBinding.invoke(JUCtrlActionBinding.java:627)
         at oracle.adf.controller.v2.lifecycle.PageLifecycleImpl.executeEvent(PageLifecycleImpl.java:378)
         at sun.reflect.GeneratedMethodAccessor488.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at com.sun.faces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:146)
         at oracle.adfinternal.view.faces.model.binding.FacesCtrlActionBinding._execute(FacesCtrlActionBinding.java:128)
         at oracle.adfinternal.view.faces.model.binding.FacesCtrlActionBinding.execute(FacesCtrlActionBinding.java:105)
         at olvims.dispatch.userinterface.backing.operations.NewDispatchRequest.saveButton_action(NewDispatchRequest.java:742)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at com.sun.faces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:146)
         at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:92)
         at oracle.adf.view.faces.component.UIXCommand.broadcast(UIXCommand.java:211)
         at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:287)
         at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:401)
         at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:95)
         at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:245)
         at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:110)
         at javax.faces.webapp.FacesServlet.service(FacesServlet.java:213)
         at com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:65)
         at oracle.webcache.adf.filter.PageCachingFilter.doFilter(PageCachingFilter.java:274)
         at com.evermind.server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:15)
         at oracle.adfinternal.view.faces.webapp.AdfFacesFilterImpl._invokeDoFilter(AdfFacesFilterImpl.java:228)
         at oracle.adfinternal.view.faces.webapp.AdfFacesFilterImpl._doFilterImpl(AdfFacesFilterImpl.java:197)
         at oracle.adfinternal.view.faces.webapp.AdfFacesFilterImpl.doFilter(AdfFacesFilterImpl.java:123)
         at oracle.adf.view.faces.webapp.AdfFacesFilter.doFilter(AdfFacesFilter.java:103)
         at com.evermind.server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:17)
         at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:162)
         at com.evermind.server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:17)
         at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:162)
         at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:621)
         at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:370)
         at com.evermind.server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:875)
         at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:453)
         at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:302)
         at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:190)
         at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260)
         at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
         at java.lang.Thread.run(Thread.java:595)

  • SequencingManager issue

    Hello,
    I receive the error shown below from the SequencingManager. After I got this error, I checked the particular sequence object in the database, it did not show anyting "odd". I then performed an action that required a new number from the sequence via toplink, and it ran fine. I made sure that the sequence object in the database had updated, and it had been. Any ideas on what could cause this error?
    Thanks,
    Jay
    Stacktrace:]
    java.lang.NullPointerException
    at oracle.toplink.internal.sequencing.SequencingManager.releaseLock(SequencingManager.java:492)
    at oracle.toplink.internal.sequencing.SequencingManager$Preallocation_NoAccessor_NoTransaction_State.getNextValue(SequencingManager.java:828)
    at oracle.toplink.internal.sequencing.SequencingManager.getNextValue(SequencingManager.java:325)
    at oracle.toplink.internal.sequencing.ClientSessionSequencing.getNextValue(ClientSessionSequencing.java:76)
    at oracle.toplink.internal.descriptors.ObjectBuilder.assignSequenceNumber(ObjectBuilder.java:127)
    at oracle.toplink.publicinterface.UnitOfWork.assignSequenceNumbers(UnitOfWork.java:336)
    at oracle.toplink.publicinterface.UnitOfWork.collectAndPrepareObjectsForCommit(UnitOfWork.java:636)
    at oracle.toplink.publicinterface.UnitOfWork.commitToDatabaseWithChangeSet(UnitOfWork.java:1099)
    at oracle.toplink.publicinterface.UnitOfWork.commitRootUnitOfWork(UnitOfWork.java:927)
    at oracle.toplink.publicinterface.UnitOfWork.commit(UnitOfWork.java:743)
    at edu.cornell.finsys.web.servlet.travel.EditViewer.processRequest(EditViewer.java:132)
    at edu.cornell.finsys.web.servlet.travel.TravelServlet.processRequest(TravelServlet.java:162)
    at edu.cornell.finsys.web.servlet.FinSysServlet.doPostOrGet(FinSysServlet.java:144)
    at edu.cornell.finsys.web.servlet.authentication.AuthenticatedServlet.doPost(AuthenticatedServlet.java:182)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at jrun.servlet.ServletInvoker.invoke(ServletInvoker.java:91)
    at jrun.servlet.JRunInvokerChain.invokeNext(JRunInvokerChain.java:42)
    at jrun.servlet.JRunRequestDispatcher.invoke(JRunRequestDispatcher.java:252)
    at jrun.servlet.ServletEngineService.dispatch(ServletEngineService.java:527)
    at jrun.servlet.jrpp.JRunProxyService.invokeRunnable(JRunProxyService.java:207)
    at jrunx.scheduler.ThreadPool$DownstreamMetrics.invokeRunnable(ThreadPool.java:348)
    at jrunx.scheduler.ThreadPool$ThreadThrottle.invokeRunnable(ThreadPool.java:451)
    at jrunx.scheduler.ThreadPool$UpstreamMetrics.invokeRunnable(ThreadPool.java:294)
    at jrunx.scheduler.WorkerThread.run(WorkerThread.java:66)

    Hello Jay,
    I see only one scenario leading to this situation:
    Thread 1:
    starts executing SequencingManager.getNextValue method - acquire lock;
    Thread 2:
    Resets sequencing (which results in removing of all the locks);
    Thread 1:
    ends executing SequencingManager.getNextValue method - attempts to release the lock, the lock is missing, NPE.
    Sequencing resetting may be caused by either
    session.logout();
    session.login();or by calling on session.getSequencingControl() one of the following methods: reset, setValueGenerationPolicy, shouldUseNativeSequencing, shouldUseTableSequencing.

Maybe you are looking for