[Ur] Generalizing transactions

Marc Weber marco-oweber at gmx.de
Wed Dec 1 05:44:26 EST 2010


Excerpts from Karn Kallio's message of Tue Nov 30 16:24:43 +0100 2010:
> Adam, now that somebody ( Marc Weber ) is working on an application ( payment 
> gateway ) where the transaction model of Ur/Web does not cleanly apply, is 
> there a chance of you generalizing Ur/Web transactions in a safe, principled 
> way ( that allows representing the semantics of the application's effectful 
> operations within Ur/Web )?  For example, I think that the problem of leaving 
> a permanent record of an event ( e.g. receiving an order and not removing it 
> on failure rollback ) could be handled with a SAGA that has a null 
> compensation for the process of writing the record.

Karn Kallio: I don't know yet whether I'm going to implement them all -
or writing some interfaces to reuse existing code.

SAGA? Wikipedia is refering to:
  * SAGA (computing), a Simple API for Grid Applications
  * SAGA GIS, a geographic information system
Do you talk about any of these two?


The manual says:
"context is the type of state that persists across handling a client request"

So it looks like I can use uw_(set,get)_global and uw_malloc to keep
caches.

I can use the uw_set_global rollback / commit handler to set a flag to
"succeeded" or "failed" in the data structure.
I know that the free handler will be called after the request finished
(giving up (fatal error) or suceeding). The flag will tell me whether I
have to trace a failure in a logfile.

Do you want users to print to stderr for logging - or do you want to
introduce a logging function which also adds time stamps etc? (good idea
IMHO) - Does it already exist?

Marc Weber



More information about the Ur mailing list