cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kumar <kumar9885035...@gmail.com>
Subject Re: How to fire multiple sql statements as one transaction.
Date Tue, 27 Dec 2016 17:29:20 GMT
OK. Let me try. But can we rollback if there is a failure?

On Tue, Dec 27, 2016 at 10:54 PM, Mike Kienenberger <mkienenb@gmail.com>
wrote:

> I am not using 4.0, but it looks like it would be:
>
> Integer result = runtime.performInTransaction(() -> {
>
> /// run your queries here
>
>     // return an arbitrary result or null if we don't care about the result
>     return 5;
> });
>
>
>
> On Tue, Dec 27, 2016 at 12:22 PM, Kumar <kumar9885035454@gmail.com> wrote:
> > I'm using 4.0 and have gone through those docs but couldn't find what i
> > need. Can you please help me out? I just want to fire multiple native sql
> > statements using (SQLExce).
> >
> > On Tue, Dec 27, 2016 at 8:53 PM, Mike Kienenberger <mkienenb@gmail.com>
> > wrote:
> >
> >> I don't remember what version of Apache Cayenne you are using, but you
> >> can find the documentation on transactions at these two URLs.
> >>
> >> https://cayenne.apache.org/docs/3.0/understanding-transactions.html
> >>
> >> https://cayenne.apache.org/docs/4.0/cayenne-guide/persistent-objects-
> >> objectcontext.html#transactions
> >>
> >>
> >> On Tue, Dec 27, 2016 at 9:29 AM, Kumar <kumar9885035454@gmail.com>
> wrote:
> >> > Hey
> >> >
> >> > I have few native sql queries(some inserts, some updates). I want to
> fire
> >> > all at once. I mean to say if success then everything should be
> success
> >> > else none. If one is failed then do i have a chance to rollback?
> >> >
> >> > Thanks
> >> > Kumar
> >>
>

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