Rolling back vs deleteobject

From: Marek Šab (msab..uk.cvut.cz)
Date: Fri Feb 12 2010 - 12:18:35 EST

  • Next message: Nishant Neeraj: "Adding Unique Column to a Table"

    Hi all,

    I would like to know your opininon on this (example adding user):

      try {
                 getObjectContext().commitChanges();
                 return user;
             } catch (CayenneRuntimeException cre) {
                 //getObjectContext().deleteObject(u);
                 getObjectContext().rollbackChanges();
             }

    I was using deleteObject method but that didn't reccure so foreign key
    objects were left just like that in context, rollback does the trick for
    me. I'm not sure how exactly this rollback works when I'm using
    getThreadObjectContext - will it be unique for every user session on
    webserver?? I hope it's not shared amongst them. And what's the
    difference from the "local" version of rollback?

    Thanks in advance,

    regards,

    Marek



    This archive was generated by hypermail 2.0.0 : Fri Feb 12 2010 - 12:19:01 EST