Luke Opperman wrote:
Quoting John Speno <[EMAIL PROTECTED]>:
As all of our sqlobjects have 'cacheValues = False' set. Obviously,
this didn't help the transaction problem before the fix, bu should
the fix introduced in r1581 to cache.py fix our inconsistency problems?
The fix in r1581 was originally written in order to allow using
cacheValues=True with Transactions. So if you're using False to avoid the
consistency problems, r1581 should allow you to go back to
cacheValues=True.
Kevin's message below (referenced in the tracker patch that 1581
implemented)
describes the consistency problem:
http://pythonpaste.org/archives/message/20051129.172427.0ec7941f.en.html
The problem I was seeing was similar to this, but not the same. The
stale values were not coming from sqlobject caching at all, but from the
MVCC in postgresql...
It would go something like this I believe:
Thread A starts a transaction:
* autocommit off #btw, why?
* begin
* do stuff
* commit
at this point, autocommit is still off, and a new transaction is
started. With postgresql it is easy to see that something went wrong,
as a 'ps' on the server will show 'idle in transaction' instead of 'idle'.
now if thread B does a simple
* update foo set bar=2 where id=1
and Thread A does a foo.get(1), it will not see the new value as it is
still in its own transaction. In my case, you could hit reload on the
page and the values would switch back and forth depending on which
database connection you landed on.
Using transactions for all reads will get around this problem, but the
root cause is that autocommit was getting turned off and you would get a
transaction without asking for one.
--
- Justin
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
sqlobject-discuss mailing list
sqlobject-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss