Re: Jim Fulton : Extensible compound statements -- new exec flavor

Jim Fulton (jfulton@disqvarsa.er.usgs.GOV)
Fri, 3 Feb 1995 17:27:01 GMT

>>>>> "Ty" == Ty Sarna <endicor@crl.com> writes:
In article <3gpqks$9ro@crl10.crl.com> endicor@crl.com (Ty Sarna) writes:

> In article <JFULTON.95Feb1130947@disqvarsa.er.usgs.gov>,
> Jim Fulton <jfulton@disqvarsa.er.usgs.GOV> wrote:
>>
>> >>>>> "Ty" == Ty Sarna <tsarna@endicor.com> writes:
>> In article <D355o7.I83@endicor.com> tsarna@endicor.com (Ty Sarna)
>> writes:
>>
>> > In article <9501281121.AA16443=guido@guppie.cwi.nl>,
>> > <Guido.van.Rossum@cwi.nl> wrote:
>>
>> In my transaction model, there are THREE ways to exit:
>>
>> 1. Normal completion (need to commit)
>> 2. Python exception (need to abort)
>> 3. Transaction aborted by transaction processing system, independent
>> of transaction code execution (already aborted).

> OK. I considered this outside the scope of the transaction wrapper. I was
> intending to handle that outside of the transaction block as a standard
> exception.

But, your __leave__ function needs to know whether to commit,
rollback, or neither. Also, if you make the user handle this in the
except block, you are exposing details of the transaction protocol.
For example, different protocols or transaction implementations may
treat a Transaction.AbortException as either a notification that the
transaction was aborted (the exception handler should not abort) or a
notification that the transaction should be aborted (the exception
handler should abort).

>> Other applications may have different requirements. I'd like to see
>> an approach that works for many different applications.

> Ditto. I'm not wedded to my scheme. Yours can do what I want (and more,
> like a cleaner syntax for threads), so I'd be happy to go with it. I do
> agree with Guido that "exec" may not be the best keyword. I think "enter"
> is better, but it applies better to my model than yours. I sort of like
> "with", but it could be confusing to those who are familiar with that
> keyword's totally different use in Pascal.

> Actually, how about "as"? As in "execute this code as a transaction (or
> thread, or whatever). "as transaction: ....", "as thread:", etc. Anyone?

I really don't care what keyword is used.

--
-- Jim Fulton      jfulton@mailqvarsa.er.usgs.gov    (703) 648-5622
                   U.S. Geological Survey, Reston VA  22092 
This message is being posted to obtain or provide technical information
relating to my duties at the U.S. Geological Survey.