[omniORB] Authentication; Garbage Collection

IxokaI ixokai at gmail.com
Thu Jul 22 10:20:33 BST 2004


> > > 2) Garbage collection
> >
> > Have you thought about using default servants? Most of my interfaces
> > that are thin wrappers around entities in a database end up becoming a
> > default servant. That way you have one servant for however many
> > references you create, and the servant just operates on a different
> > row depending on what ObjectID you give the reference.
> 
> I just looked up Default Servants in the spec. (again, I'm totally new to
> CORBA) and as I understood it, this works well for light-weight wrappers.
> However my person objects have a lot of state at the moment, since they
> basically internalize all the relevant DB data (which can be alot, because
> there is also a sort of "history" associated to the person which documents
> changes to various attributes) into their state. Maybe this is the wrong
> way to go?

Default servants don't need to be stateless, they just have to store
their state differently and key it off of the "ObjectId" for the
reference. My Elements are similar to your Persons. They each
represent a unique entity in the database, which is actually gathered
from multiple tables, including history, and lots of other stuff. They
are lazy and only obtain something when its asked for, but still.

The "State" is stored in a _data["element-number"] dictionary. So,
_data["element-number"]["slug"] internally. The reason I ended up
doing this is that there are thousands and thousands of elements in
the database and many clients may a huge chunk of references at a
time. I don't want it twenty thousand objects loaded in memory, only
the data the client wants :)

I moved "commit" operations out of the element and into the session
object, since the actions going on here may be complex and involving
multiple objects; each session has a connection to the database that
they can commit or rollback via methods on the session object.

You appear to like the interceptor solution (.. I do too, I didn't
know we could do that in the omniORBpy. I might use that for
something..), so you may not need this at all. I'm just responding
with more info on default servants in case you find it useful in the
future. I love them :)

> BTW: You have a gmail account, lucky bastard! :)

Ebay. :) You can buy them for like $1-$5 now. I love it, especially
for mailing lists.



More information about the omniORB-list mailing list