[Zope] PopyDA and DBMS Transactions

Paolo Quaglia paolo@sitek.it
Mon, 18 Dec 2000 14:36:54 +0100


Hi
I heve finally installed the PopyDA0.7 that is a Multithreaded DA (multiple
concurrent access on the DBMS)

Now I'm doing tests to verify the DBMS transactions (Postgress support DB
transations):
But something doesn't work as expected:

I summarize my tests:

I have two DTML Documents:

first DTML: now called D1
<dtml-var header>
...1st sql statement: select * from customers where name='white'
...time.sleep(10) #external function that invokea the sleep function (10
sec)
...2dn sql statement: update customer set descr='Updated 1' where
customer='white'
<dtml-var footer>

Second DTML: now called D2
<dtml-var header>
...sql statement: update customer set descr='Updated 2' where
customer='white'
<dtml-var footer>

with two browser I called:
D1 and then D2

My expected Behaviour was:
-With the first statement of D1, Postgres would locks the table
The update of D2 has to wait to write because the table is locked
only when D1 has finished, D2 commit
As result the updated field has to result "Update 2" and not 'Update 1"

With the option Auto-commit mode ON the Behaviour was:
-D2 autocommit without waiting the end of D1! (as espected with autocomm.
off)
As result the updated field has to result "Update 1" (because D1 ended after
D1)

With the option Auto-commit mode OFF the Behaviour was:
-D2 autocommit without waiting the end of D1!!!!!!!!!! Why??????!?!??!?
-When D1 finished an error occurs:

Error Type: ProgrammingError
Error Value: ERROR: Can't serialize access due to concurrent update

As result the updated field has to result "Update 2" FAULT!!


HOW CAN I HAVE TO DO in order to build a concurrent transaction Application
with Popy and Postgress???

Thank you Very Much for your Help!


Paolo Quaglia
Information Technology Coordinator
Sitek S.p.A.
paolo@sitek.it