com.caucho.db.store
Class Lock

java.lang.Object
  extended by com.caucho.db.store.Lock

public final class Lock
extends java.lang.Object

Locking for tables/etc.


Constructor Summary
Lock(java.lang.String id)
           
 
Method Summary
 java.lang.String getId()
          Returns the lock identifier.
 boolean lockReadAndWriteNoWait()
          Tries to get a write lock, but does not wait if other threads are reading or writing.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Lock

public Lock(java.lang.String id)
Method Detail

getId

public java.lang.String getId()
Returns the lock identifier.


lockReadAndWriteNoWait

public boolean lockReadAndWriteNoWait()
                               throws java.sql.SQLException
Tries to get a write lock, but does not wait if other threads are reading or writing. insert() uses this call to avoid blocking when allocating a new row.

Returns:
true if the write was successful
Throws:
java.sql.SQLException

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object