Thank you all for the RTFM reminder. Wow, cant believe i missed that one. Anyway, that clears up the issue about why unBind() clears the session.
On Fri, Jul 25, 2014 at 6:29 AM, Emmanuel Lécharny <[email protected]> wrote: > Le 25/07/2014 00:23, Theisen, Lucas a écrit : > > Hi, > > > > I am running into some sort of race condition when calling unBind(). > Same for me. > > Investigating... > > I still think this race condition is a problem as, it appears, does emmanuel. Would you like me to add a unit test to the suite of test cases for this? I currently have the above code in the LdapConnectionPoolTest class, but have not committed the code. > are you using the PoolableLdapConnectionFactory? > if yes, then this is likely due to the destroyObject() method closing the connection Yes, i am using the PoolableLdapConnectionFactory, but the test code above just checks out one connection and loops through bind/unBind. So I dont really see the pool having an impact on this. I could find another place to put this unit test where it does not use the pool at all to be certain if that would be better. Also, due to the fact that unBind() is supposed to close the session, and I was unable to find anything in the RFC about bind() opening a session, perhaps it is unreasonable to assume that it is possible to "rebind" as i have outlined. Perhaps the connection object should become permanently invalid after the unBind() operation. If this is the case, we can probably ignore this though something still feels funny about this not working... Async can be quite painful at times... no? What do you think?
