cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Lon Varscsak <lon.varsc...@gmail.com>
Subject Re: Order of insert/update/delete operations
Date Mon, 07 Aug 2017 22:27:10 GMT
I don’t really have that as an option…the fact that this is going on is
kind of hidden deeper down in my framework.  I learned that WOnder handles
this as a special case by looking at deletes that are also in inserts and
changing the order.  I’m not sure how I’d pull something like this off in
Cayenne.

Andrus originally had suggested a pretty fancy idea (from an email thread a
year ago that I had forgotten about), but that’s way above my pay grade. :P

-Lon

On Tue, Aug 1, 2017 at 8:41 PM, John Huss <johnthuss@gmail.com> wrote:

> In this case, I'd do your work inside an explicitly started transaction
> (don't remember the API offhand).
>
> 1) Start transaction
> 2) Perform your deletes (or whatever you need to happen first)
> 3) Commit the ObjectContext
> 4) Perform your other work
> 5) Commit the ObjectContext
> 6) Finish the transaction
>
>
> On Tue, Aug 1, 2017 at 7:40 PM Lon Varscsak <lon.varscsak@gmail.com>
> wrote:
>
> > Unfortunately, no…legacy structures.
> >
> > On Tue, Aug 1, 2017 at 4:33 PM, Aristedes Maniatis <ari@maniatis.org>
> > wrote:
> >
> > > On 2/8/17 9:12AM, Lon Varscsak wrote:
> > > > In this case, because it’s an object with the same PK as a previously
> > > > deleted object, technically I’d need deletes to happen for this row
> > > > *first* before
> > > > doing the update.
> > >
> > > Are you able to change the schema so you don't have meaningful primary
> > > keys here?
> > >
> > > Ari
> > >
> > >
> > > --
> > > -------------------------->
> > > Aristedes Maniatis
> > > GPG fingerprint CBFB 84B4 738D 4E87 5E5C  5EFA EF6A 7D2E 3E49 102A
> > >
> >
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message