com.ptc.windchill.counterpart
Class cUploadLock
java.lang.Object
com.ptc.windchill.counterpart.cUploadLock
- final class cUploadLock
- extends Object
Responsible for synchronization between threads and processes. Oracle locking is used
behind the scene. As a workaround we engage the Oracle lock in another thread. Certain
processing queue APIs don't like to be called within a transaction. They deadlock and fail.
Different thread will ensure that a different connection to Oracle is used, not interfeering with
the queue operation.
Constructor Summary |
cUploadLock(boolean wait)
Takes out an exclusive lock either waiting for it or only if the lock is available |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
fSyncObject
private static final Object fSyncObject
fLock
private static volatile cUploadLock fLock
fPersistentLock
private static Persistable fPersistentLock
fReleased
private volatile boolean fReleased
fEngaged
private volatile boolean fEngaged
fTried
private volatile boolean fTried
fError
private volatile boolean fError
cUploadLock
public cUploadLock(boolean wait)
throws CounterPartUploadBusyException
- Takes out an exclusive lock either waiting for it or only if the lock is available
runLoop
private static void runLoop()
- Background thread loops infinitely and processes one lock request at a time
lockOracle
private static void lockOracle()
throws WTException
- Throws:
WTException
getPersistentLock
private static Persistable getPersistentLock()
throws WTException
- Throws:
WTException
getPersistentLockFromOracle
private static Persistable getPersistentLockFromOracle()
throws WTException
- Throws:
WTException
waitOnSyncObject
private static void waitOnSyncObject()
release
public void release()
- Releases the lock. Other threads can now proceed.