directory-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Emmanuel Lécharny <elecha...@gmail.com>
Subject Re: DirectoryService.getSession thread safe
Date Fri, 23 Nov 2012 10:20:40 GMT
Le 11/23/12 11:00 AM, Eugene Prokopiev a écrit :
> Hi,
>
> Is it possible to use DirectoryService.getSession (or getAdminSession) from
> different threads inside tha same JVM with embedded ApacheDS or I need to
> use network connection?

It's thread safe. Every operation started with getSession() will go
though the OperationManager() which guarantee a protected access to the
backend :

            // Call the Add method
            Interceptor head = directoryService.getInterceptor(
addContext.getNextInterceptor() );

            try
            {
                lockWrite();

                head.add( addContext );
            }
            finally
            {
                unlockWrite();
            }


-- 
Regards,
Cordialement,
Emmanuel Lécharny
www.iktek.com 


Mime
View raw message