Hi list,

At times (it seems) necessary to force a Zope transaction commit. This might occur between two zSQL calls where the second depends on the first's *SQL* transaction's availability but the first has not yet been commited because the *Zope* transaction that includes both zSQL calls has not yet been commited.


I handled this with a call to an external script as below, eg

. zSql1()
. pyCommit() zSql2()
Publish new page

Here's pyCommit()

# ...............................................................
# Extenstion/pyCommit.py
# ...............................................................
from ZODB import FileStorage,DB

def commit( self ):
  t = get_transaction() # ZODB builtin
  if t:
     t.commit()
# ...............................................................

Thats it. And it solved my problem. Is there a reason why this is a bad idea, all things being equal? A better way to do it, when needed?

Thanks,
David

_______________________________________________
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - http://mail.zope.org/mailman/listinfo/zope-announce
http://mail.zope.org/mailman/listinfo/zope-dev )

Reply via email to