_multithreaded = ( ! EJBHelper.isManaged());
if (_multithreaded) {
_cacheLock =
new SemaphoreImpl("PersistenceManagerImpl.cacheLock"); // NOI18N
_fieldUpdateLock =
new SemaphoreImpl("PersistenceManagerImpl.fieldUpdateLock"); // NOI18N
} else {
if (_jta == null) {
// Non-transactional PersistenceManager can be used in a multithreaded
// environment.
_cacheLock =
new SemaphoreImpl("PersistenceManagerImpl.cacheLock"); // NOI18N
} else {
_cacheLock =
new NullSemaphore("PersistenceManagerImpl.cacheLock"); // NOI18N
}
_fieldUpdateLock =