[Zope] Is there a way to force a commit ??

Pavlos Christoforou pavlos@gaaros.msrc.sunysb.edu
Wed, 13 Oct 1999 23:09:00 -0400 (EDT)


On Wed, 13 Oct 1999, Cayce Ullman wrote:

> 
> I have noticed others asking questions similar
> to this, but have not seen an answer.  It seems
> that it is not possible to change the properties of
> a newly cloned zClass within the same DTML in one
> click.  Common sentiment seems to think that the 
> newly created object is not yet set down or commited. 
> Is there any way to force a commit, maybe using 
> dtml-try, or an external method, or something?

The Transaction mechanism registers a global method get_transaction. In
regular python you could do something like:
get_transaction().commit()
to commit the trnasaction.

However I am not sure how this would interfere with Zope's automatic
transaction management. I think you should need at least an immediate:
get_transaction().begin()
after the commit as Zope will automatically commit again at the end of the
request. 


Pavlos