예제 #1
0
 private void removeTemporaryLobs(boolean onTimeout) {
   if (temporaryLobs != null) {
     for (Value v : temporaryLobs) {
       if (!v.isLinkedToTable()) {
         v.remove();
       }
     }
     temporaryLobs.clear();
   }
   if (temporaryResultLobs != null && temporaryResultLobs.size() > 0) {
     long keepYoungerThan = System.currentTimeMillis() - database.getSettings().lobTimeout;
     while (temporaryResultLobs.size() > 0) {
       TimeoutValue tv = temporaryResultLobs.getFirst();
       if (onTimeout && tv.created >= keepYoungerThan) {
         break;
       }
       Value v = temporaryResultLobs.removeFirst().value;
       if (!v.isLinkedToTable()) {
         v.remove();
       }
     }
   }
 }
예제 #2
0
 private void endTransaction() {
   if (removeLobMap != null && removeLobMap.size() > 0) {
     if (database.getMvStore() == null) {
       // need to flush the transaction log, because we can't unlink
       // lobs if the commit record is not written
       database.flush();
     }
     for (Value v : removeLobMap.values()) {
       v.remove();
     }
     removeLobMap = null;
   }
   unlockAll();
 }
예제 #3
0
 /**
  * Set the value of the given variable for this session.
  *
  * @param name the name of the variable (may not be null)
  * @param value the new value (may not be null)
  */
 public void setVariable(String name, Value value) {
   initVariables();
   modificationId++;
   Value old;
   if (value == ValueNull.INSTANCE) {
     old = variables.remove(name);
   } else {
     // link LOB values, to make sure we have our own object
     value = value.copy(database, LobStorageFrontend.TABLE_ID_SESSION_VARIABLE);
     old = variables.put(name, value);
   }
   if (old != null) {
     // remove the old value (in case it is a lob)
     old.remove();
   }
 }