On Sunday 09 April 2006 18:57, Eric Hawthorne wrote:
> I have a MYSQL InnoDB database.
> 
> I have a table called Voter with an important BoolCol attribute
> called hasVoted, and another table called Ballot that records
> the voter's choices.
> 
> I go:
> 
> 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.

Did you disable autocommit in the connection?

Also, I don't know the hub api, but when using t=transaction() I had to pass
the transaction to the calls, e.g. ballot = Ballot(..., connection = t).
Setting debug and debugOutput to True in the connection object is a 
good way to see the actual SQL being generated, and whether it's being
issued inside the transaction or in another connection.

-- 
David Faure -- [EMAIL PROTECTED], [EMAIL PROTECTED]
KDE/KOffice developer, Qt consultancy projects
Klarälvdalens Datakonsult AB, Platform-independent software solutions



-------------------------------------------------------
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