[Zope] Very Strange problem with Z SQL or ??
Dieter Maurer
dieter@handshake.de
Fri, 20 Sep 2002 20:50:21 +0200
Oliver Marx writes:
> ....
> Now I use the ID to select data from the DB, so the user can see the
> object created. This Z SQL object works perfectly when I test it. But
> when I use it in my python script - it returns empty every second time!?
>
> That is first it returns empty, but if I refresh the page once more the
> correct data is displayed.
Indeed strange. Looks like a synchronization problem:
Are the creation of the id and your Python Script call related in
some way: e.g. done in different requests (transactions) at
about the same time?
Then, it would be possible that the Python Scripts still
sees old state.
Another potential problem:
Maybe, your DA (database adapter) uses connection pooling and
assigns one connection to the id creation and a different one
to the script (this would be a bug!).
In this case, too, the Python script would see stale state.
After the commit at the end of the request, everything would
be ok again.
Dieter