comp.lang.ada
 help / color / mirror / Atom feed
From: Jacob Sparre Andersen <sparre@nbi.dk>
Subject: Re: Handling transactions?
Date: Wed, 29 Jul 2015 08:51:54 +0200
Date: 2015-07-29T08:51:54+02:00	[thread overview]
Message-ID: <87k2tj8nhx.fsf@adaheads.sparre-andersen.dk> (raw)
In-Reply-To: d075fc4c-083d-4654-b04a-15f84c8511c9@googlegroups.com

EGarrulo <egarrulo@gmail.com> writes:

> What is the Ada idiom to handle transactions in procedures?

To copy the data into the transaction procedure on start and out on
successful completion:

   procedure Transaction (Data: in out Some_Type) is
      Local : Some_Type := Data;
   begin
      Local.Obj_1.A;
      Local.Obj_2.B;
      Local.Obj_3.C;
      Local.Obj_4.D;

      Data := Local; --  commit
   end Transaction;

Greetings,

Jacob
-- 
"... but it was, on the other hand, very good at being a slow
 and dim-witted pupil."
"I had no idea they were supposed to be in short supply"


      parent reply	other threads:[~2015-07-29  6:51 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-27 12:21 Handling transactions? EGarrulo
2015-07-27 14:16 ` Björn Lundin
2015-07-27 14:38   ` EGarrulo
2015-07-27 14:53     ` Simon Wright
2015-07-27 16:38       ` David Botton
2015-07-27 18:15         ` EGarrulo
2015-07-28  0:10           ` Randy Brukardt
2015-07-28  5:33             ` J-P. Rosen
2015-07-28  6:45             ` Dmitry A. Kazakov
2015-07-28 20:23               ` Randy Brukardt
2015-07-28  2:41         ` Norman Worth
2015-07-29  6:51 ` Jacob Sparre Andersen [this message]
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox