Package org.hsqldb.persist

Examples of org.hsqldb.persist.DataSpaceManager


                    // memory database
                    if (cache == null) {
                        return Result.updateZeroResult;
                    }

                    DataSpaceManager dataSpace = cache.spaceManager;
                    int tableSpaceID = dataSpace.getNewTableSpaceID();

                    table.setSpaceID(tableSpaceID);

                    // if cache exists, a memory table can get a space id
                    // it can then be converted to cached
                    if (!table.isCached()) {
                        return Result.updateZeroResult;
                    }

                    TableSpaceManager tableSpace =
                        dataSpace.getTableSpace(tableSpaceID);
                    PersistentStore store = table.getRowStore(session);

                    store.setSpaceManager(tableSpace);

                    return Result.updateZeroResult;
                } catch (HsqlException e) {
                    return Result.newErrorResult(e, sql);
                }
            }
            case StatementTypes.SET_TABLE_SET_TABLESPACE : {
                try {
                    HsqlName name    = (HsqlName) parameters[0];
                    int      spaceid = ((Integer) parameters[1]).intValue();
                    Table table =
                        session.database.schemaManager.getTable(session,
                            name.name, name.schema.name);
                    DataFileCache cache = session.database.logger.getCache();

                    if (!session.isProcessingScript()) {
                        return Result.updateZeroResult;
                    }

                    if (table.getTableType() != TableBase.CACHED_TABLE) {
                        return Result.updateZeroResult;
                    }

                    if (cache == null) {
                        return Result.updateZeroResult;
                    }

                    if (table.getSpaceID()
                            != DataSpaceManager.tableIdDefault) {
                        return Result.updateZeroResult;
                    }

                    table.setSpaceID(spaceid);

                    DataSpaceManager dataSpace = cache.spaceManager;
                    TableSpaceManager tableSpace =
                        dataSpace.getTableSpace(spaceid);
                    PersistentStore store = table.getRowStore(session);

                    store.setSpaceManager(tableSpace);

                    return Result.updateZeroResult;
View Full Code Here

TOP

Related Classes of org.hsqldb.persist.DataSpaceManager

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.