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

(ITS#2112)



I post this as a follow-up to that JNDI bug, because of the numerous mail i 
receive from people having such problem.

I was able to solve the problem, which seems to stand in bad implementation of 
JNDI's internals, and that for me are rooted in the fact that JNDI is not 
deisgned for LDAP in particular, but for anything and everything including 
maybe soon a coffee machine.

Here are the golden rules of JNDI, as of JDK 1.3.1 from Sun:

- the context should never be declared as static
- the context should never be reused once closed
- the context should never be cloned
- the environment passed to the context should not be passed in unsafe ways 
(one should be very careful when copying or cloning it)

some points are obvious, some others are less... especially the last one.
to summarize in another way, a context should be instanciated, with one 
environment created for it, used, and then closed() and thrown away. Any 
other lifecycle is unsafe, unfortunately :-(

-- 
Alexandre Aufrere
-----------------------------------
Inet6 - InetSys S.A.
33, rue Benoit Malon
92150 Suresnes
Tel. 01 41 44 85 41
-----------------------------------