I'm using the Unboundid In-Memory Directory Server in my application, and so far it works great (like it so much more than Apache DS). But, when my application is done, and I want to shutdown the server, it seems to "hang", i.e. the shutDown() command gets executed, but the thread won't stop.
InMemoryDirectoryServerConfig configuration = new InMemoryDirectoryServerConfig(baseDNs);
configuration.setListenerConfigs(InMemoryListenerConfig.createLDAPConfig("default", port));
configuration.setSchema(null);
server = new InMemoryDirectoryServer(configuration);
server.startListening();
LDAPConnection ldapConnection = new LDAPConnection("localhost", PORT);
// lots of processing the LDAP data
ldapConnection.close();
server.shutDown("default", true);
It executes without throwing an exeption or something, but still it won't shutDown.
The funny thing is, if I execute the above code w/o the processing, it works.
EDIT
The processing coding basically calls ldapConnection.search()
and ldapConnection.getEntry()
several times to obtain some user and group information. It then creates objects using this information and then inserts them into a DB.
EDIT 2
It makes no difference if shutDown("default",true)
or shutDown(true)
is called. I'm going to test the other things you mentioned later.