Search in sources :

Example 1 with LockFactory

use of org.apache.derby.iapi.services.locks.LockFactory in project derby by apache.

the class LockTable method next.

/**
 *		@see java.sql.ResultSet#next
 *		@exception SQLException if no transaction context can be found, or other
 *		Derby internal errors are encountered.
 */
public boolean next() throws SQLException {
    try {
        if (!initialized) {
            LanguageConnectionContext lcc = ConnectionUtil.getCurrentLCC();
            tc = lcc.getTransactionExecute();
            LockFactory lf = tc.getAccessManager().getLockFactory();
            lockTable = lf.makeVirtualLockTable();
            initialized = true;
            tabInfo = new TableNameInfo(lcc, true);
        }
        currentRow = null;
        if (lockTable != null) {
            while (lockTable.hasMoreElements() && (currentRow == null)) {
                currentRow = dumpLock((Latch) lockTable.nextElement());
            }
        }
    } catch (StandardException se) {
        throw PublicAPI.wrapStandardException(se);
    }
    return (currentRow != null);
}
Also used : StandardException(org.apache.derby.shared.common.error.StandardException) LanguageConnectionContext(org.apache.derby.iapi.sql.conn.LanguageConnectionContext) TableNameInfo(org.apache.derby.impl.services.locks.TableNameInfo) Latch(org.apache.derby.iapi.services.locks.Latch) LockFactory(org.apache.derby.iapi.services.locks.LockFactory)

Aggregations

Latch (org.apache.derby.iapi.services.locks.Latch)1 LockFactory (org.apache.derby.iapi.services.locks.LockFactory)1 LanguageConnectionContext (org.apache.derby.iapi.sql.conn.LanguageConnectionContext)1 TableNameInfo (org.apache.derby.impl.services.locks.TableNameInfo)1 StandardException (org.apache.derby.shared.common.error.StandardException)1