Hello I've something like: <dtml-call "insert(REQUEST)"> <dtml-call "RESPONSE.redirect(REQUEST['myform'])"> In the myform I'd like to show the values I've inserted with a ZSQL-Method. This form uses also a ZSQL-Method, to show the data inserted before. The problem is, that sometimes the values are not shown in the form. When I reload the page, the values are there. How do I asure, that the transaction is made to the db, before I show the form? Regards Dieter
Dieter Fischer wrote at 2003-5-29 15:02 +0200:
I've something like:
<dtml-call "insert(REQUEST)"> <dtml-call "RESPONSE.redirect(REQUEST['myform'])">
In the myform I'd like to show the values I've inserted with a ZSQL-Method. This form uses also a ZSQL-Method, to show the data inserted before. The problem is, that sometimes the values are not shown in the form. When I reload the page, the values are there.
How do I asure, that the transaction is made to the db, before I show the form?
This should be the case, unless your database system behaves unexpectedly. At the end of the request, Zope calls a "commit" for the affected databases. When such a "commit" only returns when the transaction is committed (in my view, this is required to be compliant with the serializability isolation level), then the "redirect" will see the committed data because Zope sends the response (with the "redirect") only after the "commit" returns. We have recently seen several case, where "commit"s were lost. In our case, this was due to bugs in some of our products that registered the DA's too late with the transaction. Maybe, one of the products you use has a similar problem? Dieter
Hallo Dieter Thanks to your reply.
We have recently seen several case, where "commit"s were lost. In our case, this was due to bugs in some of our products that registered the DA's too late with the transaction.
Currently I'm trying to create a product, which (should) work(s) with several databases. So I've tested it now against ODBC (ZODBCDA/M$-Access) and PostgreSQL (ZPsycopgDA). The problem occures only with ODBC.
Maybe, one of the products you use has a similar problem?
Aparently yes. The product I'm using is : ZODBCDA-3.1.0b2-win32-py21.tgz (83116 bytes) Date: 2001/11/15 Version: 3.1.0b2 for Python 2.1 (Development) Because it's distributed as a BINARY release, I've no chance (I don't even have the knowledge, i supose) to fix it. I'm using ODBC just for the case, a customer insists to have M$-Access. So I hope, nobody does ;-) Regards Dieter
Dieter Fischer wrote at 2003-5-30 12:02 +0200:
... Currently I'm trying to create a product, which (should) work(s) with several databases. So I've tested it now against ODBC (ZODBCDA/M$-Access) and PostgreSQL (ZPsycopgDA). The problem occures only with ODBC.
The problem might be M$-Access (I would not be astonished to learn that it implements transactions in the way you have described (i.e. the transaction does not see its own changes)). Otherwise, "ZODBCDA" has a number of known problems (loosing "commit"s does not belong to this set, though). If possible, drop it in favour of (e.g.) ZmxODBCDA. Dieter
participants (2)
-
Dieter Fischer -
Dieter Maurer