}
// The map of mutexes is keyed by the name of this persistent.
// Try to find it first, If not found, create a new mutex and
// add it to the map for this and future use.
Mutex dbMutex = null;
if ((dbMutex = (Mutex) dbLocks.get(dbKeyName)) == null)
{
if (log.isDebugEnabled())
{
log.debug("Creating new mutex for " + dbKeyName);
}
dbMutex = new Mutex();
dbLocks.put(dbKeyName, dbMutex);
}
//Got handle to mutex, now acquire it
try
{
dbMutex.acquire();
}
catch (InterruptedException ie)
{
throw new PersistenceException(ie);
}