Search in sources :

Example 1 with TableBase

use of org.hsqldb_voltpatches.TableBase in project voltdb by VoltDB.

the class PersistentStoreCollectionSession method getStore.

public PersistentStore getStore(Object key) {
    try {
        TableBase table = (TableBase) key;
        PersistentStore store;
        switch(table.persistenceScope) {
            case TableBase.SCOPE_STATEMENT:
                store = (PersistentStore) rowStoreMapStatement.get(table.getPersistenceId());
                if (store == null) {
                    store = session.database.logger.newStore(session, this, table, true);
                }
                return store;
            case TableBase.SCOPE_TRANSACTION:
                store = (PersistentStore) rowStoreMapTransaction.get(table.getPersistenceId());
                if (store == null) {
                    store = session.database.logger.newStore(session, this, table, true);
                }
                return store;
            case TableBase.SCOPE_SESSION:
                store = (PersistentStore) rowStoreMapSession.get(table.getPersistenceId());
                if (store == null) {
                    store = session.database.logger.newStore(session, this, table, true);
                }
                return store;
        }
    } catch (HsqlException e) {
    }
    throw Error.runtimeError(ErrorCode.U_S0500, "PSCS");
}
Also used : TableBase(org.hsqldb_voltpatches.TableBase) HsqlException(org.hsqldb_voltpatches.HsqlException)

Aggregations

HsqlException (org.hsqldb_voltpatches.HsqlException)1 TableBase (org.hsqldb_voltpatches.TableBase)1