Re: [Zope-dev] why does an error in my externalmethod ...

2000-07-06 Thread Dieter Maurer

Joachim Schmitz writes:
 > 
 > make the folder from which it was invoked inaccessable ?
 > 
 > continuing work on my external, I removed all modifications of self, so no
 > transactions or better modifications of the ZODB took place. During the
 > development cycle: editing the external methods, testing it through
 > calling it through the browser, after editing the method the call of
 > /Movies/testForm resulted in a not found error.
 > also I cannot enter the folder "Movies", if I click on it in the
 > managementscreen, I also get the not found error. There is no transaction
 > to undo, I restarted Zope no luck, I tried to delete the folder and get
 > the error:
 > 
 > Error Type: SystemError
 > Error Value: Failed to import class setrecord from module __main__

 > 

 > The class setrecord is in my external-method. I luckily had packed zodb
 > shortly before that, and it is just a testserver. So I copied the
 > Data.fs.old to Data.fs. Till now I could not reproduce the error. I still
 > have the corrupted Data.fs. 

You should be very careful, not to store instances of
classes defined in external method files in the ZODB.

The reason:
  These Python files are not imported in a standard way,
  but instead they are read and executed.

  Therefore, the unpickler is not able to find the
  classes module, you get the problem you reported.


When you need to store class instances in the ZODB,
you should define these classes in a standard
package. The "Shared" packages is designed for this
purpose. Create an appropiately named subpackage (e.g.
company name) and put your modules there.


In your case, you may have written to a persistent object
unintentionally.


Dieter

___
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 an error in my externalmethod ...

2000-07-06 Thread Joachim Schmitz


make the folder from which it was invoked inaccessable ?

continuing work on my external, I removed all modifications of self, so no
transactions or better modifications of the ZODB took place. During the
development cycle: editing the external methods, testing it through
calling it through the browser, after editing the method the call of
.../Movies/testForm resulted in a not found error.
also I cannot enter the folder "Movies", if I click on it in the
managementscreen, I also get the not found error. There is no transaction
to undo, I restarted Zope no luck, I tried to delete the folder and get
the error:

Error Type: SystemError
Error Value: Failed to import class setrecord from module __main__

(Object: manage_delObjects)
File /usr/local/Zope-2.1.4/lib/python/ZPublisher/Publish.py, line 102, in
call_object
(Object: manage_delObjects)
File /usr/local/Zope-2.1.4/lib/python/OFS/ObjectManager.py, line 395, in
manage_delObjects
(Object: ElementWithAttributes)
File /usr/local/Zope-2.1.4/lib/python/OFS/ObjectManager.py, line 267, in
_delObject
(Object: ElementWithAttributes)
File /usr/local/Zope-2.1.4/lib/python/ZODB/Connection.py, line 396, in 
setstate
SystemError: (see above)
 
The class setrecord is in my external-method. I luckily had packed zodb
shortly before that, and it is just a testserver. So I copied the
Data.fs.old to Data.fs. Till now I could not reproduce the error. I still
have the corrupted Data.fs. 

But I had that occure before, after making an error in the external
method, the calling folder was not accessible anymore. But there I also
had modified self, so I had a transaction which I could "undo".  


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 )