Re: JNDIAdaptor and openChannels
Re: JNDIAdaptor and openChannels
- Subject: Re: JNDIAdaptor and openChannels
- From: Timmy <email@hidden>
- Date: Thu, 11 May 2006 11:52:45 -0700
On May 11, 2006, at 10:55 AM, Chuck Hill wrote:
On May 11, 2006, at 10:26 AM, Timmy wrote:
Everyone:
I'm a bit of a WebObjects (and java) newbie so I am just throwing
this out as a general consensus type question. My app is using
ldap authentication but, beyond that, is also correlating ldap
users to a person object in an SQL database. These separate uses
happen in pretty quick succession since authentication and setting
the user are all part of logging in. This all works as it should
right now however, I've been frustrated during development with
how often I have gotten errors related to open channels -
something I never see with the jdbc adaptor.
That is rather odd. Do you have any other information as to when
these happen? This is usually (or should be) the result of
starting another LDAP query in the same thread before the current
one has completed.
This may be exactly what is happening. I have ldap modeled and used
EOModeler to reverse engineer. So, the model framework has the
"manager's" connection credentials. Those credentials would be used
when I first ask for a user matching uid (with
EOUtilities.objectMatchingKeyAndValue). I then programmatically
create a new adaptor.connectionDictionary with the user's credentials
and call adaptor.assertConnectionDictionaryIsValid(). Between these
two requests have a method to closeAllChannels. This all happens in
the same method. I guess I assumed that the first request would be
like a query, then it would be done with its business.
There is also a notification that you can register for and create
more channels as needed.
EODatabaseContext.DatabaseChannelNeededNotification
See http://tuvix.apple.com/documentation/WebObjects/
Enterprise_Objects/Connecting/chapter_10_section_9.html
I am quite sure that I am not employing the most scalable use of
the adaptor - or am I? I of course have a method to close all
channels but I end up having to call that (in ugly fashion) all
over the place to ensure that everything works. And I am concerned
that I'll have problems when users are concurrently opening
channels to login and get registered with the session.
Well, it does sound as if something is wrong.
I've noticed Chuck's book seems to favor staying away from the
jndi adaptor for auth which will probably help this problem. But
as my use of objects from ldap increases (it will) I want to use
the best practices for working with those objects.
Anyone have any thoughts from experience with the adaptor?
I just avoided using the JNDI adaptor for authentication as that is
not the "right" way to do it WRT LDAP. It _will_ work if you are
OK with doing an LDAP query instead of a bind. I do use the JNDI
adaptor for authorization and it does get called a lot for that. I
have not seen the problems you are describing. My guess is that
you have done something wrong, probably in an EOF method that you
have overridden. Have you used awakeFromFetch anywhere?
No, definitely haven't done that. I may have done something wrong
with regard to modeling ldap as well because I've seen some other
posts relating to properly representing the ldap tree in EOModeler.
Chuck
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden