weird behaviour with commit?

From: Hefest (Hefes..mail.com)
Date: Thu Aug 04 2005 - 14:56:36 EDT

  • Next message: Mike Kienenberger: "Re: weird behaviour with commit?"

    Hi everyone,

    I do something along the following lines:

    x= dc.createAndRegisterNewObject(MyClass.class);

    y.setSomeProperty("newValue");
    y.setToMyClass(x);
    dc.commitChanges();

    The problem is that "x" isn't linked with "o" after doing the commit so
    at the moment I improvise doing

    x = dc.createAndRegisterNewObject(MyClass.class);
    dc.commitChanges(); // this commit makes the y.setToMyClass(x) work
    like intended

    y.setSomeProperty("newValue");
    y.setToMyClass(x);
    dc.commitChanges();

    This is a fairly ugly hack, acceptible, but I'd like to avoid it.
    Is this the intended cayenne behaviour or is it the result of using a
    not-yet-stable version (1.2b4)? I'm using MSSQL, jtds 1.0...I don't know
    if anything else is relevant.

    Also, while I'm on topic: commitChanges() is a transactive operation -
    right?

    Thanks in advance,
    Tomislav



    This archive was generated by hypermail 2.0.0 : Thu Aug 04 2005 - 14:37:49 EDT