Package org.exist.storage.lock

Examples of org.exist.storage.lock.Lock.release()


        final Thread thread = Thread.currentThread();
        for(int idx = 0; idx < documentCount; idx++) {
            d = nodes[documentOffsets[idx]].getDocument();
            dlock = d.getUpdateLock();
            if(exclusive)
                {dlock.release(Lock.WRITE_LOCK);}
            else if (dlock.isLockedForRead(thread))
                {dlock.release(Lock.READ_LOCK);}
        }
    }
View Full Code Here


            d = nodes[documentOffsets[idx]].getDocument();
            dlock = d.getUpdateLock();
            if(exclusive)
                {dlock.release(Lock.WRITE_LOCK);}
            else if (dlock.isLockedForRead(thread))
                {dlock.release(Lock.READ_LOCK);}
        }
    }

    /**
     * The method <code>getCollectionIterator</code>
View Full Code Here

            if(values[idx] == null || values[idx] == REMOVED)
                {continue;}
            d = (DocumentImpl)values[idx];
            dlock = d.getUpdateLock();
            if(exclusive)
                {dlock.release(Lock.WRITE_LOCK);}
            else if (dlock.isLockedForRead(thread))
                {dlock.release(Lock.READ_LOCK);}
        }
    }
View Full Code Here

            d = (DocumentImpl)values[idx];
            dlock = d.getUpdateLock();
            if(exclusive)
                {dlock.release(Lock.WRITE_LOCK);}
            else if (dlock.isLockedForRead(thread))
                {dlock.release(Lock.READ_LOCK);}
        }
    }

    @Override
    public String toString() {
View Full Code Here

    }

    public void unlock(boolean exclusive) {
        final Lock dlock = doc.getUpdateLock();
        if(exclusive)
            {dlock.release(Lock.WRITE_LOCK);}
        else if (dlock.isLockedForRead(Thread.currentThread()))
            {dlock.release(Lock.READ_LOCK);}
    }

    public boolean equalDocs(DocumentSet other) {
View Full Code Here

            //TODO : throw an exception ? -pb
        } catch (final DBException e) {
            LOG.error(e.getMessage(), e);
            //TODO : throw an exception ? -pb
        } finally {
            lock.release(Lock.WRITE_LOCK);
        }
    }

    @Override
    public void remove() throws DBException {
View Full Code Here

            file.setCurrentDocument(document);
            return start();
        } catch(final ReadOnlyException e) {
            LOG.error(e.getMessage(), e);
        } finally {
            lock.release(mode);
        }
        return null;
    }
}
View Full Code Here

            } catch (final IOException e) {
                LOG.error(e.getMessage() + "' in '" + dbTokens.getFile().getName() +
                    "' (inverted index)", e);
                //TODO : throw exception ? -pb
            } finally {
                lock.release(Lock.WRITE_LOCK);
                os.clear();
            }
        }

        public void dropIndex(DocumentImpl document) {
View Full Code Here

                    } catch (final ReadOnlyException e) {
                        LOG.error(e.getMessage() + " in '" +
                            dbTokens.getFile().getName() + "'", e);
                        //TODO : throw exception ? -pb
                    } finally {
                        lock.release(Lock.WRITE_LOCK);
                        os.clear();
                    }
                }
                words[currentSection].clear();
            }
View Full Code Here

                    } catch (final IOException e) {
                        LOG.error(e.getMessage() + "' in '" +
                            dbTokens.getFile().getName() + "' (inverted index)", e);
                        //TODO : throw exception ? -pb
                    } finally {
                        lock.release(Lock.WRITE_LOCK);
                        os.clear();
                    }
                }
                words[currentSection].clear();
            }
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.