[Zope] Zope,Python,Corba - which way to go
Jeff Rush
Jeff Rush" <jrush@timecastle.net
Fri, 22 Oct 99 17:25:26 -0500
On Fri, 22 Oct 1999 14:45:33 +0200, Marco Stipek wrote:
>I'm currently working on a project, which requires to have access to a
>Corba ORB (currently Fnorb is used).
>Does anyone played a little bit with Corba, Python and Zope?
I have played a little with Fnorb + Zope, creating a product called
ZCorbaIF. Your provide an Naming Service URL when you create
an instance of it, and it makes the methods of that CORBA object
available to Zope. It is modeled after the ZSQL stuff, but is not
usable in a general fashion yet. It's little more than a proto-toy
right now.
>My following Questions are not completely answered for me yet:
>a) How to handle the Corbaclient in a multi threaded environment.
Fnorb supports multi-threaded clients and servers, if you select
the Threading model in it's configuration file (or cmdline option).
>b) I think it's a bad Idea to use an Extension Method. Thus every
>Clientrequest leads to the same process of getting the ref and than
>getting an object handle throughout a factory. If I understand right
>ZClasses and Products are initialized at Zope server start time. Then
>I think is best to use them for doing the initial Job (getting
>references) and presenting them through a well defined Interface.
Perhaps this is what you are referring to, but you can copy the
client interface .py files that Fnorb generates into the Zope
Extension directory ($SOFTWARE_HOME/Extensions or
$INSTANCE_HOME/Extensions) and invoke the CORBA
methods that way. You would store the stringified object ref
as persistent data in your Zope object, and then convert it to
an object handle each time -- this is not that slow as it does not
involve a network call -- the stringified form is just unpacked and
turned into a (host, port, obj) instance.
This works but is not my preferred way, long term.
>c) How exactly is the life circle of:
> - Product Objects
> - External Method Objects
> - ZClasses
>
>Maybe you have some hints or links for me, or could something tell
>about your own experiences.
The -true- solution to this is to write a proper Zope Connector.
While Zope comes with an SQL one, it does support the creation
of others. The sharing of a CORBA object reference across multiple
threads is the kind of thing Zope Connectors are designed for, just
as they share an SQL database session across Zope threads.
However, (A) how to do so is not (yet) documented and (B) as I
understand from Michel Pelletier, the connector architecture is
undergoing major redesign with their client-paid work to
*efficiently* multithread and support sub-transactions for the
Sysbase SQL API.
(A) doesn't stop me but because of (B) I've set my CORBA work
aside for a couple of months, to let things develop in this area.
Zope is still quite new and has plenty of gaps just waiting to be
filled. That is the excitement of it.
But considering that my core accounting system is CORBA
and Bobo (old ZPublisher) based, CORBA support in Zope is
very important to me so that I can migrate my financial apps into
Zope, therefore a seamless CORBA (Z)Product will be forthcoming,
probably in December.
-Jeff Rush