cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From John Huss <johnth...@gmail.com>
Subject Re: Order of insert/update/delete operations
Date Wed, 02 Aug 2017 03:41:23 GMT
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