Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AbstractContext#close should not remove all bound objects, at least not in shared mode #12

Open
GoogleCodeExporter opened this issue Mar 14, 2015 · 0 comments

Comments

@GoogleCodeExporter
Copy link

The usage pattern for JNDI is:

   InitialContext initialContext = new InitialContext( env )
   try {
         // do something with the context;
   }
   catch ( Exception e ) {
         // handle exceptions
   }
   finally {
        // cleanup resources
    initialContext.close();
   }

In case a shared context is used (org.osjava.sj.jndi.shared=true) the second 
client won't see any bound instances, since the first client (registering the 
object) calls close() in its finally block.

The question really comes down to what the semantics of InitialContext#close() 
is. The javadocs is not really clear about this. See also 
http://stackoverflow.com/questions/5120961/context-and-initialcontext-should-i-b
e-calling-the-close-method-on-these-obje

Original issue reported on code.google.com by hardy.fe...@gmail.com on 12 Aug 2011 at 1:14

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant