DirContextHolder contextHolder = (DirContextHolder) TransactionSynchronizationManager .getResource(target); DirContext ctx = null;  if (contextHolder != null) { ctx = contextHolder.getCtx(); }  if (ctx == null) { ctx = target.getReadOnlyContext(); if (contextHolder != null) { contextHolder.setCtx(ctx); } } return getTransactionAwareDirContextProxy(ctx, target);
return getReadWriteContext();
    public DirContext getReadOnlyContext() throws DataAccessException {        DirContextHolder contextHolder = (DirContextHolder) TransactionSynchronizationManager                .getResource(target);        DirContext ctx = null;        if (contextHolder != null) {            ctx = contextHolder.getCtx();        }        if (ctx == null) {            ctx = target.getReadOnlyContext();            if (contextHolder != null) {                contextHolder.setCtx(ctx);            }        }        return getTransactionAwareDirContextProxy(ctx, target);    }