problem with manage_importObject
Hi to all! I have a problem using manage_importObject?file=... with zope2.9. In particular: object is successfully imported but if I shutdown and then reboot the server, I don't see anymore imported object. If I import the same object using web form "Import/Export" I have not this strange behavior. anyone can help me? very thanks, Fabio -- Dott. Fabio Marcone 2T srl Telefono +39 - 0871- 540154 Fax +39 - 0871- 571594 Email fabio.marcone(AT)duet.it Indirizzo Viale B. Croce 573 66013 Chieti Scalo (CH) GNU/Linux registered user #400424
--On 12. März 2007 11:00:33 +0100 Fabio Marcone <fabio.marcone@duet.it> wrote:
Hi to all!
I have a problem using manage_importObject?file=... with zope2.9. In particular: object is successfully imported but if I shutdown and then reboot the server, I don't see anymore imported object.
I don't believe that. If I import
the same object using web form "Import/Export" I have not this strange behavior.
There should not be any difference between a GET and POST request. And it fact I can not reproduce it...sounds like a fairy tale. -aj
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
I have a problem using manage_importObject?file=... with zope2.9. In particular: object is successfully imported but if I shutdown and then reboot the server, I don't see anymore imported object. If I import the same object using web form "Import/Export" I have not this strange behavior.
Are you calling manage_importObject from Python code? Are you sure the transaction is committed? If you're calling this in some external script (such as a script run via "zopectl run") without starting a "normal" web request you may have to explicitly commit the transaction. jens -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.5 (Darwin) iD8DBQFF9TnyRAx5nvEhZLIRAr1IAKCS2P+qPqMM4KN7ZX1kbBrYb7SWKwCgroTN syUjFzgeRi6qzRKnEPP0XTI= =tgrL -----END PGP SIGNATURE-----
Jens Vagelpohl wrote:
I have a problem using manage_importObject?file=... with zope2.9. In particular: object is successfully imported but if I shutdown and then reboot the server, I don't see anymore imported object. If I import the same object using web form "Import/Export" I have not this strange behavior.
Are you calling manage_importObject from Python code? Are you sure the transaction is committed? If you're calling this in some external script (such as a script run via "zopectl run") without starting a "normal" web request you may have to explicitly commit the transaction.
jens
perhaps this is the problem... in fact /var/lib/zope2.9/instance/myinstance/var is empty after importObject operation using python script. but the commit has been introduced in zope 2.9? I use the same code in zope2.7 without problem. in a python script I use: zopeClient('http://localhost:9673/manage_importObject?file=app.zexp',myuser,mypassword) where zopeClient is: def zopeClient(url,username,passwd): f = Function(url) f.username = username f.password = passwd apply(f,(),{}) How I can do "commit"? Thanks, Fabio _______________________________________________ Zope maillist - Zope@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 ) -- Dott. Fabio Marcone 2T srl Telefono +39 - 0871- 540154 Fax +39 - 0871- 571594 Email fabio.marcone(AT)duet.it Indirizzo Viale B. Croce 573 66013 Chieti Scalo (CH) GNU/Linux registered user #400424
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
perhaps this is the problem... in fact /var/lib/zope2.9/instance/myinstance/var is empty after importObject operation using python script.
but the commit has been introduced in zope 2.9?
The need to commit a transaction has been part of the ZODB since day 1.
I use the same code in zope2.7 without problem. in a python script I use: zopeClient('http://localhost:9673/manage_importObject? file=app.zexp',myuser,mypassword)
where zopeClient is: def zopeClient(url,username,passwd): f = Function(url) f.username = username f.password = passwd apply(f,(),{})
Maybe the behavior of the old Zope client stuff has changed. I honestly don't know anyone who uses it. Nowadays I would always write scripts that are invoked using "zopectl run", which means you need to have a ZEO-enabled setup, if you don't have it already.
How I can do "commit"?
import transaction transaction.commit() This doesn't work with the Zope client approach, which is basically glorified URL-whacking... jens -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.5 (Darwin) iD8DBQFF9T2WRAx5nvEhZLIRAgOaAJ9SL//QC6OYXXhv80OPT7gCU62/rQCfRzqL 6KIwxhWyr5nObUf2T5o+38g= =VysF -----END PGP SIGNATURE-----
Hello, What about just doing the import yourself: container._importObjectFromFile(f) (rather than using the ZMI's manage_importObject method through a zope client connection) ? Eric BREHAULT On 3/12/07, Fabio Marcone <fabio.marcone@duet.it> wrote:
Jens Vagelpohl wrote:
I have a problem using manage_importObject?file=... with zope2.9. In particular: object is successfully imported but if I shutdown and then reboot the server, I don't see anymore imported object. If I import the same object using web form "Import/Export" I have not this strange behavior.
Are you calling manage_importObject from Python code? Are you sure the transaction is committed? If you're calling this in some external script (such as a script run via "zopectl run") without starting a "normal" web request you may have to explicitly commit the transaction.
jens
perhaps this is the problem... in fact /var/lib/zope2.9/instance/myinstance/var is empty after importObject operation using python script.
but the commit has been introduced in zope 2.9? I use the same code in zope2.7 without problem. in a python script I use: zopeClient(' http://localhost:9673/manage_importObject?file=app.zexp',myuser,mypassword )
where zopeClient is: def zopeClient(url,username,passwd): f = Function(url) f.username = username f.password = passwd apply(f,(),{})
How I can do "commit"?
Thanks, Fabio
_______________________________________________ Zope maillist - Zope@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 )
--
Dott. Fabio Marcone
2T srl Telefono +39 - 0871- 540154 Fax +39 - 0871- 571594 Email fabio.marcone(AT)duet.it Indirizzo Viale B. Croce 573 66013 Chieti Scalo (CH) GNU/Linux registered user #400424 _______________________________________________ Zope maillist - Zope@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 )
Eric Bréhault wrote:
Hello,
What about just doing the import yourself: container._importObjectFromFile(f)
(rather than using the ZMI's manage_importObject method through a zope client connection) ?
Eric BREHAULT
On 3/12/07, Fabio Marcone <fabio.marcone@duet.it> wrote:
Jens Vagelpohl wrote:
I have a problem using manage_importObject?file=... with zope2.9. In particular: object is successfully imported but if I shutdown and then reboot the server, I don't see anymore imported object. If I import the same object using web form "Import/Export" I have not this strange behavior.
Are you calling manage_importObject from Python code? Are you sure the transaction is committed? If you're calling this in some external script (such as a script run via "zopectl run") without starting a "normal" web request you may have to explicitly commit the transaction.
jens
perhaps this is the problem... in fact /var/lib/zope2.9/instance/myinstance/var is empty after importObject operation using python script.
but the commit has been introduced in zope 2.9? I use the same code in zope2.7 without problem. in a python script I use: zopeClient(' http://localhost:9673/manage_importObject?file=app.zexp',myuser,mypassword
)
where zopeClient is: def zopeClient(url,username,passwd): f = Function(url) f.username = username f.password = passwd apply(f,(),{})
How I can do "commit"?
Thanks, Fabio
_______________________________________________ Zope maillist - Zope@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 )
--
Dott. Fabio Marcone
2T srl Telefono +39 - 0871- 540154 Fax +39 - 0871- 571594 Email fabio.marcone(AT)duet.it Indirizzo Viale B. Croce 573 66013 Chieti Scalo (CH) GNU/Linux registered user #400424 _______________________________________________ Zope maillist - Zope@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 )
well, I have no container because my script python is not an external method or a script python in zope. I try with: import Zope2 Zope2.configure(...) app=Zope2.app() app.manage_delObjects(ids="index_html") app.manage_importObject("index_html.zexp") but with no results Now I'm trying with urllib2 and urlopen with authentication but when I reboot the machine, zope application disappeared. do you know a method to commit http transaction in zope? any suggests? Thanks, Fabio -- Dott. Fabio Marcone 2T srl Telefono +39 - 0871- 540154 Fax +39 - 0871- 571594 Email fabio.marcone(AT)duet.it Indirizzo Viale B. Croce 573 66013 Chieti Scalo (CH) GNU/Linux registered user #400424
--On 12. März 2007 18:51:57 +0100 Fabio Marcone <fabio.marcone@duet.it> wrote:
well, I have no container because my script python is not an external method or a script python in zope.
I try with: import Zope2
Zope2.configure(...)
app=Zope2.app() app.manage_delObjects(ids="index_html") app.manage_importObject("index_html.zexp")
but with no results
Please read the posting of Jens carefully. You *must* commit. -aj
thanks, I solved using Zope2 and transaction modules like Jens wrote me. Fabio Andreas Jung wrote:
--On 12. März 2007 18:51:57 +0100 Fabio Marcone <fabio.marcone@duet.it> wrote:
well, I have no container because my script python is not an external method or a script python in zope.
I try with: import Zope2
Zope2.configure(...)
app=Zope2.app() app.manage_delObjects(ids="index_html") app.manage_importObject("index_html.zexp")
but with no results
Please read the posting of Jens carefully. You *must* commit.
-aj
-- Dott. Fabio Marcone 2T srl Telefono +39 - 0871- 540154 Fax +39 - 0871- 571594 Email fabio.marcone(AT)duet.it Indirizzo Viale B. Croce 573 66013 Chieti Scalo (CH) GNU/Linux registered user #400424
participants (4)
-
Andreas Jung -
Eric Bréhault -
Fabio Marcone -
Jens Vagelpohl