[Zope] ZODB transaction ?!
Matei Conovici
Matei Conovici <cmatei@roedu.net>
Sat, 21 Aug 1999 02:21:15 +0300 (EET DST)
Hi!
I'm trying to create a folder and put some images in it. My DTML looks
somewhat like this:
<!--#call "manage_addFolder('somefolder')" -->
<!--#with "_['somefolder']" -->
<!--#call "manage_addImage('zz.gif', imagefile)" -->
<!--#/with -->
My problem is that, sometimes the above works but mostly it doesn't :-),
and I get something like this:
--
Error Type: AttributeError
Error Value: commit_sub
[...]
Traceback (innermost last):
File /root/Zope-2.0.0b5-linux2-x86/lib/python/ZPublisher/Publish.py,
line 209, in publish_module
File /root/Zope-2.0.0b5-linux2-x86/lib/python/ZPublisher/Publish.py,
line 179, in publish
File /root/Zope-2.0.0b5-linux2-x86/lib/python/Zope/__init__.py, line
199, in zpublisher_exception_hook
(Object: ElementWithAttributes)
File /root/Zope-2.0.0b5-linux2-x86/lib/python/ZPublisher/Publish.py,
line 169, in publish
File /root/Zope-2.0.0b5-linux2-x86/lib/python/ZODB/Transaction.py,
line 247, in commit
AttributeError: (see above)
--
I assume I'm getting this because the transaction with the ZODB for
_addFolder does not get (correctly) commit()-ed and the folder object
is not yet there when I try to add the immages.
This happens with current b5 version and b1 as well...
I would _really_ appreciate some hints here :-)
Thanks,
--
Matei CONOVICI, cmatei@roedu.net
PS: As a general zope question, is it possible to explicitly ask for
commit() in a SQL method ?