Skip to content

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

@GoogleCodeExporter

Description

@GoogleCodeExporter
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

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions