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

Reply via email to