} else { log.debug("Leaving transactional context open");
    public static void doCloseConnection(DirContext context,            ContextSource contextSource) throws NamingException {        DirContextHolder transactionContextHolder = (DirContextHolder) TransactionSynchronizationManager                .getResource(contextSource);        if (transactionContextHolder == null                || transactionContextHolder.getCtx() != context) {            // This is not the transactional context or the transaction is            // no longer active - we should close it.            context.close();        }    }