2 Replies Latest reply on Jul 15, 2002 4:11 AM by tdang

    javax.ejb.DuplicateKeyException

    tdang

      Hi!

      I deployed the test bean and am testing it. The task of the client is creating a new record in database. The client will write somes messages on the System.out.

      At the first time, the messages of the client look like this:

      - Got context
      - Got reference
      - Product "P001" successfully created

      Then I controlled the database and I wonder why the product was not inserted. So I started the client again, then I got the DuplicateKeyException. The error messages:

      Got context
      Got reference
      javax.ejb.DuplicateKeyException: Entity with primary key "P001" already exists

      I controlled the database once again, but there is nothing. I started the whole machine again, but the problem is still there.

      Where did JBoss insert the data?

      I am using DB2 and JBoss 3.0

      Regards.

        • 1. Re: javax.ejb.DuplicateKeyException
          joelvogt

          Sorry but by 'controlled the database' that means looked at your table for the inserted record?
          Have you configured the DB2 db to work with jboss or is it using the default Data source?

          • 2. Re: javax.ejb.DuplicateKeyException
            tdang

            I configured the db2-datasource, but JBoss used the default one, because at deployment time there was an error with my db2-datasource.

            Now I am trying to configure my db2-datasource correctly.