Examples of DBException


Examples of xbird.storage.DbException

            for(BucketEntry<HashBucket> e : _cache) {
                HashBucket node = e.getValue();
                try {
                    node.write();
                } catch (IOException ioe) {
                    throw new DbException(ioe);
                }
            }
        }
        if(clear) {
            _cache.clear();
View Full Code Here

Examples of xbird.storage.DbException

            HashBucket bucket = loadRecordedBucket(pageNum);
            if(bucket != null) {
                return bucket.findValue(key);
            }
        } catch (IOException e) {
            throw new DbException(e);
        }
        return null;
    }
View Full Code Here

Examples of xbird.storage.DbException

        try {
            ensureResourceOpen();
            HashBucket bucket = seekInsertionBucket(key);
            return bucket.addValue(key, value);
        } catch (IOException e) {
            throw new DbException(e);
        }
    }
View Full Code Here

Examples of xbird.storage.DbException

            HashBucket bucket = loadRecordedBucket(pageNum);
            if(bucket != null) {
                return bucket.removeValue(key);
            }
        } catch (IOException e) {
            throw new DbException(e);
        }
        return null;
    }
View Full Code Here

Examples of xbird.storage.DbException

        }
        File file = new File(col.getDirectory(), col.getCollectionName()
                + DbCollection.QNAMES_FILE_SUFFIX);
        if(file.exists()) {
            if(!file.delete()) {
                throw new DbException("Could not delete symbol file: " + file.getAbsolutePath());
            }
        }
        if(file.canWrite()) {
            throw new IllegalStateException("Does not have write permission for "
                    + file.getAbsolutePath());
        }
        try {
            ObjectOutputStream oos = new ObjectOutputStream(new FileOutputStream(file));
            oos.writeObject(this);
            oos.flush();
            oos.close();
        } catch (FileNotFoundException fe) {
            throw new DbException(fe);
        } catch (IOException ioe) {
            throw new DbException(ioe);
        }
    }
View Full Code Here

Examples of xbird.storage.DbException

    public boolean create(boolean close) throws DbException {
        ensureResourceOpen();
        try {
            _fileHeader.write();
        } catch (IOException e) {
            throw new DbException(e);
        }
        if(close) {
            close();
        } else {
            this._opened = true;
View Full Code Here

Examples of xbird.storage.DbException

        ensureResourceOpen();
        if(exists()) {
            try {
                _fileHeader.read();
            } catch (IOException e) {
                throw new DbException(e);
            }
            this._opened = true;
            return true;
        } else {
            this._opened = false;
View Full Code Here

Examples of xbird.storage.DbException

    protected final RandomAccessFile ensureResourceOpen() throws DbException {
        if(_raf == null) {
            try {
                this._raf = new RandomAccessFile(_file, "rw");
            } catch (FileNotFoundException e) {
                throw new DbException(e);
            }
        }
        if(_fc == null) {
            this._fc = _raf.getChannel();
        }
View Full Code Here

Examples of xbird.storage.DbException

            // close resources
            try {
                _raf.close();
                _fc.close();
            } catch (IOException e) {
                throw new DbException(e);
            }
            reset();
            return true;
        } else {
            return false;
View Full Code Here

Examples of xbird.storage.DbException

        }
    }

    protected final void checkOpened() throws DbException {
        if(!_opened) {
            throw new DbException("Not opened");
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.