if (log.isDebugEnabled()) { log.debug("returning " + pkValue + " for " + ename); }
    private static Long cachedPkValue(String ename) {        Stack s = cacheStack(ename);        if (s.empty()) {            synchronized (entityLock(ename)) {                //we need to check again because after entering the                // synchronized statement                //it might be possible that another thread filled the stack                // already                //this is very likeley for entities which are heavily generated                // such as                //Download entities. These are generated by the                // RSRequestHandler, a ResourceRequestHandler                //subclass which logs every resource download. As                // resourcedownloading is always                //multithreadded this means that two new Download primary keys                // might be needed                //within a millisecond, got it?                //If we do not do this then its also OK, it just means that the                // stack has about 2000                //objects and not only 1000 ones                if (s.empty()) {                    fillPkCache(s, ename);                }            }        }        Long pkValue = (Long) s.pop();        if (log.isDebugEnabled()) {            log.debug("returning " + pkValue + " for " + ename);        }        return pkValue;    }