[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: Some code suggestions...

On 05/25/2013 04:24 PM, Emmanuel Lecharny wrote:
Hi Shawn,

I will use this mailing list for comments, suggestions and questions
regarding the code base, so that it will benefit to everyone interested.

I have a couple of suggestions I already mentionned in a chat, but it's
better to have them recorded here :

Hello Emmanuel.  Welcome to the fortress mailing list.

On 05/25/2013 04:24 PM, Emmanuel Lecharny wrote:
1) You may want ot use the LDAP connection pool to replace the pool you
are using. Mots of the LDAP API has an implementation of a pool, even
JNDI (but you don't want to suffer using it , do you ?)

Willing to consider. Where can I find more information on the pool you recommend?

On 05/25/2013 04:24 PM, Emmanuel Lecharny wrote:
2) It would be better to get the connection immediately before using it,
and to release it as soon as you are done with it. For instance, the
connection could be get just before calling the dataProvider and
released just after. Not really a huge improvment, but assuming that
you may have thousands of requests per second, this may become an

The current pattern followed in the Fortress DAO's is as follows:

// inside any DAO method:
    1. getAdminConnection();
    2. build up the ldap attribute set or search filter
    3. perform the ldap operation
catch (LDAPException e)
   // perform error handling
   4. closeAdminConnection(ld);

This change you are suggesting is to delay opening the connection until the beginning of step 3? Seems doable and yes it should save a few cycles of holding a connection needlessly.

shawn.mckinney@jts.us is my new email address