DuplicateKeyException using CMP entity bean with blob field, with WLS 7 SP4 - Weblogic

This is a discussion on DuplicateKeyException using CMP entity bean with blob field, with WLS 7 SP4 - Weblogic ; I have recently upgrade from weblogic 7.0 SP1 to SP4, and am running load tests. With SP4, and large volumes, I'm seeing DuplicateKeyException when attempting to create a particular CMP bean that has a blob field. When the volume is ...

+ Reply to Thread
Results 1 to 5 of 5

Thread: DuplicateKeyException using CMP entity bean with blob field, with WLS 7 SP4

  1. DuplicateKeyException using CMP entity bean with blob field, with WLS 7 SP4


    I have recently upgrade from weblogic 7.0 SP1 to SP4, and am running load tests.


    With SP4, and large volumes, I'm seeing DuplicateKeyException when attempting
    to create a particular CMP bean that has a blob field. When the volume is low,
    everything is fine, but I'm not consistently getting a DuplicateKeyException half
    way through the code.

    From the log file, I can see that there has been 200+ instance of this bean created,
    both the with blob field being null, and with the blob field containing actual
    objects. There is nothing special about the one that fails.

    Here's part of the stack trace that I'm getting:
    at com.rubiconsoft.VariableDOBean_nuajtz__WebLogic_CM P_RDBMS.__WL_create(VariableDOBean_nuajtz__WebLogi c_CMP_RDBMS.java:2262)
    at com.rubiconsoft.VariableDOBean_nuajtz__WebLogic_CM P_RDBMS.ejbPostCreate(VariableDOBean_nuajtz__WebLo gic_CMP_RDBMS.java:2152)
    at java.lang.reflect.Method.invoke(Native Method)
    at weblogic.ejb20.manager.DBManager.create(DBManager. java:1023)
    at weblogic.ejb20.manager.DBManager.localCreate(DBMan ager.java:904)
    at weblogic.ejb20.internal.EntityEJBLocalHome.create( EntityEJBLocalHome.java:180)
    at com.rubiconsoft.VariableDOBean_nuajtz_LocalHomeImp l.create(VariableDOBean_nuajtz_LocalHomeImpl.java: 98)
    at
    com.rubiconsoft.TemplateMgmtBOBean.createVariable( TemplateMgmtBOBean.java:2496)


  2. Re: DuplicateKeyException using CMP entity bean with blob field, with WLS 7 SP4


    The Blob may or may not be related to the problem.

    Are the primary keys generated ? How are the primary key values assigned ?

    -thorick


  3. Re: DuplicateKeyException using CMP entity bean with blob field, with WLS 7 SP4


    The primary keys are generated with our own sequence generator, which queries Oracle
    database for a value with seqence.nextval. It retrieves numbers in chunks and
    dole it out. The method is not synchronized, so conceivably it can give out duplicate
    numbers under high load and high concurrent usage. However, the error that I'm
    getting is just part of a very large transaction that is done only once.

    I have printed out the id for all those that have sucessfully created, and they
    are different from the one that is throwing the error. The ejbCreate methods
    generates the number, called the setId() abstract method, then created the PK
    object to return with the getId() method.
    The PK object in this particular case is just a wrapper class. The Id field is
    a BigDecimal.

    -Vina
    "thorick" wrote:
    >
    >The Blob may or may not be related to the problem.
    >
    >Are the primary keys generated ? How are the primary key values assigned
    >?
    >
    >-thorick
    >



  4. Re: DuplicateKeyException using CMP entity bean with blob field, with WLS 7 SP4


    If you're getting duplicate key exceptions and you're generating
    your own keys, then the problem is probably related to the key generator.
    Is there any reason why you can't use the Oracle Sequence based
    Automatic Key Generation feature that comes with WebLogic CMP ?

    -thorick




  5. Re: DuplicateKeyException using CMP entity bean with blob field, with WLS 7 SP4


    The sequence generator shipped only returns Integer or Long (only Integer when
    we wrote our own). I have tried to print out the sequence used while this error
    is occuring and did not see any duplicate.

    Something that I noticed while running in SP1 (that did not encounter this error),
    is that when this long transaction is going - which involved creating lots of
    entitiy beans, db queries, sending a message to JMS, and a MDB picking it up and
    executing, there are multiple JTS Inflight transactions for the same method.
    Each of them is started 3 minutes apart from each other (which is the transaction
    timeout time of this particular method).


    "thorick" wrote:
    >
    >If you're getting duplicate key exceptions and you're generating
    >your own keys, then the problem is probably related to the key generator.
    >Is there any reason why you can't use the Oracle Sequence based
    >Automatic Key Generation feature that comes with WebLogic CMP ?
    >
    >-thorick
    >
    >
    >



+ Reply to Thread