[Borges-users] Transactions

Patrick Roemer sangamon at t-online.de
Wed Apr 14 01:06:11 EDT 2004


Hi,

as a newbie to Borges (and continuations in general) I'm playing around
with my very first toy project: A simple quiz structured in rounds.
While attending a round, the player should be able to skip back and
forth between the questions and correct his answers, but after
committing the last answer of the round, he should not be able to enter
this round again to 'update' his results.

I thought that Transactions were the way to go, but they don't seem to
behave as I naively expected: In the TransactionTest provided with the
distribution I would have expected that I could not go back from
'outside child' to 'inside child'. Consequently, in my quiz that looks
basically like this:

def go
 # rounds, quiz, result and goodbye call the respective components
 begin
  roundidx=rounds
  session.isolate do
   @results.add(roundidx,quiz(roundidx))
  end
 end while(result(roundidx))
 goodbye
end

it's still possible to go back and update the results until a perfect
score is reached. So I think I haven't groked the Transaction concept
yet (at least). Could anybody please point me to an example on how to
use them correctly and/or an alternative way to implement this behavior?

TIA,
Patrick


More information about the Borges-users mailing list