On 4/9/06, Eric Hawthorne <[EMAIL PROTECTED]> wrote:
> voter = Voter.get(someId)
> ...
> hub.begin()  <-- supposed to start a transaction
>
> ballot = Ballot(district.id, encryptedAnswers)
> voter.hasVoted = True
>
> hub.commit()
> hub.end()
>
> So how could it happen that the database examined after this
> shows that the ballot row has been created but that the
> voter.has_voted has value 0 (i.e. False). That's what
> happened. This is very bad.

I'd make a couple of recommendations here:

1) Turn on logging by added ?debug=1 to your database URI. Run it and
see the output. Pay attention to the connection numbers used.

2) Put the hub.begin() at the beginning.

I'd agree that this is a bit suspicious.

By the way, TurboGears 0.9 does the hub.begin, commit and end
implicitly at the beginning and end of the request.

Kevin


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid0944&bid$1720&dat1642
_______________________________________________
sqlobject-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss

Reply via email to