[Twisted-web] Twisted and SQLAlchemy Cache Problem

Magnus Hult magnus at spotify.com
Wed Jun 13 09:56:23 EDT 2007


Thanks for your swift reply!

On 6/13/07, Manlio Perillo <manlio_perillo at libero.it> wrote:
> Magnus Hult ha scritto:
> > When executing the following program, changes in the database (other
> > than those made by this program) aren't visible until it is restarted,
> > due to some form of SQLAlchemy caching:
>
> Are you using PostgreSQL?

Yes, I am. With psycopg2.

> [...]
> The solution is: make sure to add a commit after every select.

It doesn't seem to help though. In fact, the following little program

t = objectstore.create_transaction()
m = model.MyModel.get(1)
print m.some_column
t.commit()
sys.stdin.readline()
t = objectstore.create_transaction()
m = model.MyModel.get(1)
print m.some_column
t.commit()

only seems to execute one select statement. The other result seems to
be taken from the cache. If this is the case, then this question would
rather belong in an SQLAlchemy mailing list, I guess.

> You can read a discussion with the psycopg author in the
> it.comp.lang.python newsgroup:
> http://groups.google.com/group/it.comp.lang.python/browse_thread/thread/bf98fd21e78958e4

Yes, I could, if I could read Italian. :)



More information about the Twisted-web mailing list