Package org.hsqldb_voltpatches.persist

Examples of org.hsqldb_voltpatches.persist.PersistentStore


            // nothing to do
            return;
        }

        PersistentStore store =
            database.persistentStoreCollection.getStore(this);

        this.store = store;

        DataFileCache cache = null;

        try {
            cache = (TextCache) database.logger.openTextCache(this,
                    dataSource, withReadOnlyData, isReversed);

            store.setCache(cache);

            // read and insert all the rows from the source file
            Row row     = null;
            int nextpos = 0;

            if (((TextCache) cache).ignoreFirst) {
                nextpos += ((TextCache) cache).readHeaderLine();
            }

            while (true) {
                row = (Row) store.get(nextpos, false);

                if (row == null) {
                    break;
                }

                Object[] data = row.getData();

                nextpos = row.getPos() + row.getStorageSize();

                ((RowAVLDiskData) row).setNewNodes();
                systemUpdateIdentityValue(data);
                enforceRowConstraints(session, data);

                for (int i = 0; i < indexList.length; i++) {
                    indexList[i].insert(null, store, row);
                }
            }
        } catch (Exception e) {
            int linenumber = cache == null ? 0
                                           : ((TextCache) cache)
                                               .getLineNumber();

            clearAllData(session);

            if (cache != null) {
                database.logger.closeTextCache(this);
                store.release();
            }

            // everything is in order here.
            // At this point table should either have a valid (old) data
            // source and cache or have an empty source and null cache.
View Full Code Here


     */
    public void disconnect() {

        this.store = null;

        PersistentStore store =
            database.persistentStoreCollection.getStore(this);

        store.release();

        isConnected = false;
    }
View Full Code Here

        return isReversed;
    }

    public void setHeader(String header) {

        PersistentStore store =
            database.persistentStoreCollection.getStore(this);
        TextCache cache = (TextCache) store.getCache();

        if (cache != null && cache.ignoreFirst) {
            cache.setHeader(header);

            return;
View Full Code Here

        throw Error.error(ErrorCode.TEXT_TABLE_HEADER);
    }

    public String getHeader() {

        PersistentStore store =
            database.persistentStoreCollection.getStore(this);
        TextCache cache  = (TextCache) store.getCache();
        String    header = cache == null ? null
                                         : cache.getHeader();

        return header == null ? null
                              : StringConverter.toQuotedString(header, '\"',
View Full Code Here

    Result getResult(Session session) {

        Table           table              = baseTable;
        Result          resultOut          = null;
        RowSetNavigator generatedNavigator = null;
        PersistentStore store = session.sessionData.getRowStore(baseTable);

        if (generatedIndexes != null) {
            resultOut = Result.newUpdateCountResult(generatedResultMetaData,
                    0);
            generatedNavigator = resultOut.getChainedResult().getNavigator();
View Full Code Here

        return persistenceScope == TableBase.SCOPE_SESSION;
    }

    public final RowIterator rowIterator(Session session) {

        PersistentStore store = session.sessionData.getRowStore(this);

        return getPrimaryIndex().firstRow(store);
    }
View Full Code Here

        return newIndex;
    }

    public void clearAllData(Session session) {

        PersistentStore store = session.sessionData.getRowStore(this);

        store.removeAll();
    }
View Full Code Here

        if (getIndexCount() == 0) {
            return true;
        }

        PersistentStore store = session.sessionData.getRowStore(this);

        return getIndex(0).isEmpty(store);
    }
View Full Code Here

                break;
            }

            String          schema = session.getSchemaName(currentSchema);
            Table t = db.schemaManager.getUserTable(session, s, schema);
            PersistentStore store  = db.persistentStoreCollection.getStore(t);
            int             j      = 0;

            for (j = 0; ; j++) {
                if (!readRow(store, t)) {
                    break;
View Full Code Here

        return database.persistentStoreCollection.getStore(table);
    }

    public PersistentStore getSubqueryRowStore(TableBase table) {

        PersistentStore store = persistentStoreCollection.getStore(table);

        store.removeAll();

        return store;
    }
View Full Code Here

TOP

Related Classes of org.hsqldb_voltpatches.persist.PersistentStore

Copyright © 2018 www.massapicom. All rights reserved.
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.