Uploaded image for project: 'OJB'
  1. OJB
  2. OJB-52

KeyConstraintViolatedException during store

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Invalid
    • 1.0.3
    • 1.0.4
    • None
    • None
    • ojb 1.0.3, hsqldb from ojb-blank, enriched with junit, ojb-junit
      java 1.4.2_04

    Description

      Hi,
      I am getting a KeyConstraintViolatedException during store of an object structure.
      I supplied a test that shows this. Can someone verify that this is really a bug?

      The actual exception message was this:
      testThree(TestArguments)org.apache.ojb.broker.KeyConstraintViolatedException: SQL failure while insert object data for class Someclass, PK of the given object is [ Id=1], object was **Someclass ** Id: 1 text:some attribute, exception message is [Integrity constraint violation: SOMECLASS_FK_1 table: OTHERCLASS in statement [INSERT INTO Someclass (Id,otherclassID,text) VALUES (1,2,'some attribute') ]], SQL code [23000]
      at org.apache.ojb.broker.accesslayer.JdbcAccessImpl.executeInsert(JdbcAccessImpl.java:266)
      at org.apache.ojb.broker.core.PersistenceBrokerImpl.storeToDb(PersistenceBrokerImpl.java:1754)

      Attachments

        1. TestArguments.java
          4 kB
          Micha K
        2. TestArguments.java
          4 kB
          Micha K

        Activity

          People

            Unassigned Unassigned
            msok Micha K
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: