[Zope] Forcing Zope transaction commit

m.bizzarri at icube.it m.bizzarri at icube.it
Tue Jul 19 03:36:31 EDT 2005


It would be better if you explain what you're trying to obtain. Inside a
single *Zope* transaction, all the queries are inside the same *RDBMS*
transaction.

Therefore, the second sql method should see the effects of the first
one. If that is not the case, review what is actually happening (i.e.
the first query may be failing even though you did not detect it).

Regards
Marco




On Mon, Jul 18, 2005 at 09:14:26PM -0700, David H wrote:
> 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 at 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 )

-- 
Marco Bizzarri - Amministratore Delegato - Icube S.r.l.
Sede:   Via Ridolfi 15 - 56124 Pisa (PI), Italia 
E-mail: m.bizzarri at icube.it		WWW: www.icube.it	
Tel: 	(+39) 050 97 02 07		Fax: (+39) 050 31 36 588	
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://mail.zope.org/pipermail/zope/attachments/20050719/2159d538/attachment.bin


More information about the Zope mailing list