[Zope] PopyDA and DBMS Transactions

2000-12-18 Thread Paolo Quaglia

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.
[EMAIL PROTECTED]



___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




Re: [Zope] PopyDA and DBMS Transactions

2000-12-18 Thread Ivan Cornell

Paolo Quaglia wrote:

 I have two DTML Documents:

 first DTML: now called D1
 dtml-var header
 ...1st sql statement: select * from customers where name='white'

As I understand it, to exclusively lock a table in postgresql, use SELECT
 FOR UPDATE, eg:

...1st sql statement: select * from customers where name='white' for update of
customers

Regards,
Ivan


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )