Hi Kieron,

Your idea to use LDAP isn't a bad one.  But, as you've identified you have
the problem of maintaining in the LDAP directory the same hierarchy that
you're maintaining in memory in the CORBA or EJB server.  Also, traversing
LDAP is likely to be slower than traversing the in memory version.

So, depending on your needs, you have two options.  Your first pass actually
isn't a bad way to go if the contents of the hierarchy change very often
and/or your need to federate the hierarchy (for high availability reasons)
is low.  A stateful SessionBean which is responsible for navigating through
a CORBA proxy to get this information for you isn't a bad idea.  It provides
a level of indirection that allows you to change (from the client's
perspective) the implementation while the navigation APIs remain constant.

Having said that, your clients can use the same navigation API's on that
stateful SessionBean while its implementation is based on JNDI/LDAP (or even
JNDI/CosNaming).  If you use JNDI/CosNaming, then the matter of
synchronizing the naming service with the hierarchy becomes trivial.  Just
write a simple singleton that is used by each CORBA servant node in the
hierarchy to update the CosNaming whenever updates happen in memory (you can
do the same if you're using LDAP, but you'll have to find a suitable API for
LDAP).  Then, your stateful session bean can use any combination of
in-memory traversal and JNDI based traversal.

For instance, you might design it so that your naming service is federated
(and possible replicated) and the first time a stateful SessionBean does
navigation on nodes to a certain depth (this could be configurable) it will
use the naming service.  But, after that, for more complex navigation, the
SessionBean is going to use calls on the CORBA proxy to do efficient
in-memory navigation.

I know that I really didn't answer which was best, mainly because the "best"
solution depends upon your usage scenarios.  In general, delegating to the
proxy to do in-memory navigation will be very efficient and very fast, but
may suffer from single point of failure issues.  Using a directory service
approach will be slower but you can partition the hierarchy (and possibly
replicate it) but navigation will be slower.  So, in these instances, I tend
to try and find a way to get the best of both worlds by organizing access in
such a way that it is only painful to get the first few references (but
you're guaranteed to get them) and things are very fast after that.

I hope this helps.


Cheers,

Patrick


********************************************
Persistence  - The Engine for E-Commerce
********************************************

Patrick Ravenel
Director, Distributed Computing Systems
Persistence Software, Inc.

[EMAIL PROTECTED]
http://www.persistence.com

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to