Re: [Zope-dev] why does my externalmethod generate a ZODB transaction
Hi, answering to myself, cause nobody else could find the reason in the code I provided, because I didn't include the real culprit. Here is the very much abreviatet version, which also generates a transaction: def workform(self,REQUEST): "Die Masken EinAusgabe" self.form=REQUEST.form-- this does it return "this generated a transaction" So don't modify the "self" of an external method. Mit freundlichen Grüßen Joachim Schmitz AixtraWare, Ing. Büro für Internetanwendungen Hüsgenstr. 33a, D-52457 Aldenhoven Telefon: +49-2464-8851, FAX: +49-2464-905163 ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
RE: [Zope-dev] why does my externalmethod generate a ZODB transaction
Any method called directly through the web (e.g. like this one, which I assume is through an HTTP POST) will be bounded in a transaction. Why would you not want this to happen? -Original Message- From: Joachim Schmitz [mailto:[EMAIL PROTECTED]] Sent: Thursday, July 06, 2000 3:30 AM To: zope-dev Subject: Re: [Zope-dev] why does my externalmethod generate a ZODB transaction Hi, answering to myself, cause nobody else could find the reason in the code I provided, because I didn't include the real culprit. Here is the very much abreviatet version, which also generates a transaction: def workform(self,REQUEST): "Die Masken EinAusgabe" self.form=REQUEST.form-- this does it return "this generated a transaction" So don't modify the "self" of an external method. Mit freundlichen Grüßen Joachim Schmitz AixtraWare, Ing. Büro für Internetanwendungen Hüsgenstr. 33a, D-52457 Aldenhoven Telefon: +49-2464-8851, FAX: +49-2464-905163 ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope ) ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
[Zope-dev] why does my externalmethod generate a ZODB transaction
Hi, I wrote an external method from which I call a ZSQL-method, this runs fine and returns the correct results, but when I look at the ZODB transactions, I see that for each call of the method a transaction is recorded. Even worse, when I make an error in my method, the folder from which I invoked the method is no longer accesseble. I have to undo the transaction first, that's how I found out that there is a transaction happening. here is the code of the External-method: import string import sys sys.path[0:0]=["/usr/local/Zope-2.1.4/Extensions"] from DocumentTemplate import * def dump(self,EA,**kwa): #return EA,kwa s = "br" if hasattr(self,EA): ea = apply(getattr(self,EA),(),kwa) #return ea._names,"br",ea._schema ead = ea.__dict__ for r in ead.keys(): s = s + r + "br" i=getattr(ea,r) if type(i) == type([]) and len(i) 0: s = s + str(i) + " br " for n in i: s = s + str(n) + " | " s=s+"br" elif type(i) == type({}): s = s + str(i) + " br " for n in i.items(): s = s + str(n) + " | " s=s+"br" return s def workform(self,REQUEST): "Die Masken EinAusgabe" scol = "movie_id" sval = "a%" srel = "like" return dump(self,"Row_search",scol=scol,sval=sval,srel=srel) this dumps the result of the ZSQL-method, I call it from a dtml-method "testForm" like this: dtml-var standard_html_header dtml-var "RForm(REQUEST)"--- this calls workform dtml-var standard_html_footer when invoking this like .../Movies/testForm I have an entry in the undoable transactions: ...Movies/testForm by super on Jul 4 at 21:21:31 By the way why is the day one day off the machine REDhat 6.2 Zope-2.1.4 has the correct date and shows now: Wed Jul 5 21:49:01 CEST 2000 Mit freundlichen Grüßen Joachim Schmitz AixtraWare, Ing. Büro für Internetanwendungen Hüsgenstr. 33a, D-52457 Aldenhoven Telefon: +49-2464-8851, FAX: +49-2464-905163 ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )