Grab a write lock on the Connection. If another thread already has a write lock then the calling thread will block until the lock is released. The calling thread must call {@link #writeUnlock}when it is done.
Obtain a writer lock containing given metadata.
@param metadata See documentation of metadata parameter in readLock()
@return An instantiated InterProcessReadWriteLock instance
Returns a TableLock for locking the table for exclusive access
@param tableName Table to lock
@param purpose Human readable reason for locking the table
@return A new TableLock object for acquiring a write lock
Acquire a write lock on the object. A write lock assures that the object exists and can be stored/deleted when the transaction commits. It prevents any concurrent updates to the object from this point on. However, it does not guarantee that the object has not been modified in the course of the transaction. For that the object must be loaded with exclusive access.
@param tx The transaction context
@param oid The object's OID
@param timeout The timeout waiting to acquire a lock on theobject (specified in seconds)
@throws LockNotGrantedException Timeout or deadlock occuredattempting to acquire lock on object
@throws ObjectDeletedException The object has been deleted frompersistent storage
@throws PersistenceException An error reported by thepersistence engine
Acquires a write lock on the graph. Calling thread will be blocked until all read locks are released. Several threads can read but only once can write.
@see ReentrantReadWriteLock
@throws IllegalMonitorStateException if the current thread is holding a read lock
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.