Problems with CommitChanges and object PersistenceState

From: laila paganelli (laila.paganell..mail.com)
Date: Thu Jan 27 2005 - 07:48:20 EST

  • Next message: moraru_et..pymac.com: "Re: strange result of deletequery"

    Hi all,

        I use the same dataContext for several operations and I want to
    commit twice.

        context = org.objectstyle.cayenne.access.DataContext.createDataContext();
        prn = (PendingRawNews)this.dataContext().createAndRegisterNewObject(PendingRawNews.class);
        context.commitChanges();
        
        // ..... create other objects in the same context
        
        context.commitChanges();
            
        After the first commit the object prn is saved on the database,
    but the state is still PersistenceState.NEW, while I expect it to be
    PersistenceState.COMMITTED.
        After the second commit I find one more prn object on database.
        Why? What is wrong?
        
        Thank's
        Laila



    This archive was generated by hypermail 2.0.0 : Thu Jan 27 2005 - 07:48:24 EST