DB2 Sequence Problem

From: Mario Linke (Mario.Link..tudent.Uni-Magdeburg.DE)
Date: Thu Aug 28 2003 - 04:08:37 EDT

  • Next message: Andrus Adamchik: "Re: DB2 Sequence Problem"

    Hi,

    I make in Java:

    Artist art1 = (Artist) ctxt.createAndRegisterNewObject("Artist");
    art1.set...
    ctxt.commitChanges(Level.WARN);

    Artist art2 = (Artist) ctxt.createAndRegisterNewObject("Artist");
    art2.set...
    ctxt.commitChanges(Level.WARN);

    and the outtput is:

    WARN QueryLogger: --- will run 1 query
    WARN QueryLogger: INSERT INTO ARTIST (ARTIST_ID, ARTIST_NAME,
    DATE_OF_BIRTH) VALUES (?,?,?)
    WARN QueryLogger: [bind: 55 'Artist_1', '1970-01-01']
    WARN QueryLogger: +++ transaction committed

    WARN QueryLogger: --- will run 1 query
    WARN QueryLogger: INSERT INTO ARTIST (ARTIST_ID, ARTIST_NAME,
    DATE_OF_BIRTH) VALUSE (?,?,?)
    WARN QueryLogger: [bind 56, 'Artist_2', '1970-01-01']
    WARN QueryLogger: +++ transaction commited

    th problem:

    the query: SELECT NEXTVAL FOR S_ARTIST FROM SYSIBM.SYSDUMMY1
    is ONCE execute
    -> the database sequence is 55 and not 56, how in the example by the art2
    generated.

    By the next insert i become a error.

    Is this a cache problem?

    Mario.



    This archive was generated by hypermail 2.0.0 : Thu Aug 28 2003 - 04:02:23 EDT