[omniORB] Porting old (BOA based) Python code to omniORB

Gary Pennington Gary.Pennington@uk.sun.com
Wed, 23 Aug 2000 15:50:12 +0100


Hi,

I've just started using omniORB and I'm trying to port some existing
Python code from an older ORB, Fnorb.

I'm trying to decide whether it's best to do a straightforward port, or
whether I should try to work out some of the new features of the POA
(I've never worked with a POA enabled ORB before) and would appreciate
some advice on the best way to proceed.

Here's my problem domain, all advice welcome.

I need a server to be able to provide persistent references to objects
which represent users. The server must be able to
create/retrieve/delete/update users based on supplied parameters and
these users should outlive the existence of the server.

Currently I implement this with a User factory which provides an
interface for adding users, deleting users etc. The factory stores all
updates to user objects in a database (actually a shelf based on
BerkelyDB for Python).

In the existing code I do something like the following when adding a new
user :-

<security stuff...>
Check database for user
    if exists already throw exception
create user and put in database
Activate reference for user
Return reference to client


To get a user :-

<security stuff...>
check to see if there is an active reference for the user <HOW DO THIS
USING POA?>
if there is return it
    if not get user from DB
        if no user return error
        else
            activate user and return reference


Does the above approach make any sense when using a POA? Or should I be
looking at doing something a little fancier with my own POA and using
object activations?

Gary