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);
}