Examples of DeferredUpdate


Examples of org.fusesource.hawtdb.internal.page.DeferredUpdate

        Update update = updates == null ? null : updates.get(page);
        if( update != null ) {
            if( update.freed() ) {
                throw new PagingException("That page was freed.");
            }
            DeferredUpdate deferred = update.deferredUpdate();
            if( deferred != null ) {
                return deferred.<T>value();
            } else {
                throw new PagingException("That page was updated with the 'put' method.");
            }
        }
       
View Full Code Here

Examples of org.fusesource.hawtdb.internal.page.DeferredUpdate

    public <T> void put(PagedAccessor<T> marshaller, int page, T value) {
        assertOpen();
        ConcurrentHashMap<Integer, Update> updates = getUpdates();
        Update update = updates.get(page);
        DeferredUpdate deferred = null;
        if (update == null) {
            // This is the first time this transaction updates the page...
            snapshot();
            deferred = deferred();
            updates.put(page, deferred);
        } else {
            // We have updated it before...
            if( update.freed() ) {
                throw new PagingException("You should never try to update a page that has been freed.");
            }
            deferred = update.deferredUpdate();
            if( deferred==null ) {
                deferred = deferred(update);
                updates.put(page, deferred);
            }
        }
        deferred.note("put "+page);
        deferred.put(value, marshaller);
    }
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.