Re: to-one relationship not set

From: Cris Daniluk (cris.danilu..mail.com)
Date: Fri Jan 13 2006 - 13:31:20 EST

  • Next message: Ahmed Mohombe: "Re: Nested DataContexts - web scenarios needed"

    Figured it out... somehow the DbRelationship type for the
    ObjRelationship got changed. I had a weird problem with the modeler in
    1.2M7 where a ton of relationships got hosed after doing a sync. It is
    possible that this happened at that time. Whatever triggered that
    behavior hasn't happened since, though.

    Cris

    On 1/13/06, Cris Daniluk <cris.danilu..mail.com> wrote:
    > I am committing a new DataObject which has a populated to-one
    > relationship to an existing object of the same type. The relationship
    > is required. On commit, I am getting a SQLException. Not only is the
    > value set properly, but if it weren't, it should be a
    > ValidationException from Cayenne.
    >
    > I am going to dig in and see if I can figure out the cause, but
    > thought I would mention it here to see if someone else has encountered
    > it. Incidentally, this isn't happening for all to-one relationships.
    >
    > INFO [http-8080-Processor25]
    > (org.objectstyle.cayenne.access.QueryLogger:336) - 2006-01-13
    > 13:07:39,043 INSERT INTO ...
    > INFO [http-8080-Processor25]
    > (org.objectstyle.cayenne.access.QueryLogger:358) - 2006-01-13
    > 13:07:39,043 [batch bind: ...]
    > INFO [http-8080-Processor25]
    > (org.objectstyle.cayenne.access.QueryLogger:433) - 2006-01-13
    > 13:07:39,152 *** error.
    > java.sql.SQLException: ORA-01400: cannot insert NULL into ...
    >
    > at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
    > at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:289)
    > at oracle.jdbc.ttc7.Oall7.receive(Oall7.java:579)
    > at oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java:1894)
    > at oracle.jdbc.ttc7.TTC7Protocol.parseExecuteFetch(TTC7Protocol.java:1094)
    > at oracle.jdbc.driver.OracleStatement.executeNonQuery(OracleStatement.java:2132)
    > at oracle.jdbc.driver.OracleStatement.doExecuteOther(OracleStatement.java:2015)
    > at oracle.jdbc.driver.OraclePreparedStatement.executeBatch(OraclePreparedStatement.java:4125)
    > at org.objectstyle.cayenne.access.jdbc.BatchAction.runAsBatch(BatchAction.java:164)
    > at org.objectstyle.cayenne.access.jdbc.BatchAction.performAction(BatchAction.java:114)
    > at org.objectstyle.cayenne.access.DataNodeQueryAction.runQuery(DataNodeQueryAction.java:95)
    > at org.objectstyle.cayenne.access.DataNode.performQueries(DataNode.java:321)
    > at org.objectstyle.cayenne.access.DataContextCommitAction.commit(DataContextCommitAction.java:172)
    > at org.objectstyle.cayenne.access.DataContext.commitChanges(DataContext.java:990)
    > ...
    >



    This archive was generated by hypermail 2.0.0 : Fri Jan 13 2006 - 13:31:23 EST