/** * 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(); } }
/** * Get the value of the specified user defined variable. This method always returns a value; it * returns ValueNull.INSTANCE if the variable doesn't exist. * * @param name the variable name * @return the value, or NULL */ public Value getVariable(String name) { initVariables(); Value v = variables.get(name); return v == null ? ValueNull.INSTANCE : v; }