示例#1
0
  public StatefulBuffer readStatefulBufferById(Transaction trans, int id, boolean lastCommitted) {
    if (id <= 0) {
      throw new IllegalArgumentException("id=" + id);
    }

    Slot slot =
        lastCommitted ? trans.idSystem().committedSlot(id) : trans.idSystem().currentSlot(id);

    if (DTrace.enabled) {
      DTrace.SLOT_READ.logLength(id, slot);
    }

    return readStatefulBufferBySlot(trans, id, slot);
  }
示例#2
0
  public final boolean delete4(
      Transaction transaction, ObjectReference ref, Object obj, int cascade, boolean userCall) {
    int id = ref.getID();
    StatefulBuffer reader = readStatefulBufferById(transaction, id);
    if (reader != null) {
      if (obj != null) {
        if ((!showInternalClasses()) && Const4.CLASS_INTERNAL.isAssignableFrom(obj.getClass())) {
          return false;
        }
      }
      reader.setCascadeDeletes(cascade);
      transaction.idSystem().notifySlotDeleted(id, SlotChangeFactory.USER_OBJECTS);
      ClassMetadata classMetadata = ref.classMetadata();
      classMetadata.delete(reader, obj);

      return true;
    }
    return false;
  }
示例#3
0
 @Override
 public boolean isDeleted(Transaction trans, int id) {
   return trans.idSystem().isDeleted(id);
 }
示例#4
0
 public final Slot allocateSlotForNewUserObject(Transaction trans, int id, int length) {
   Slot slot = allocateSlot(length);
   trans.idSystem().notifySlotCreated(id, slot, SlotChangeFactory.USER_OBJECTS);
   return slot;
 }
示例#5
0
 public final void rollback1(Transaction trans) {
   trans.rollback();
 }
示例#6
0
 public final int idForNewUserObject(Transaction trans) {
   return trans.idSystem().newId(SlotChangeFactory.USER_OBJECTS);
 }
示例#7
0
 public void commit1(Transaction trans) {
   trans.commit();
 }
 private Object containerLock() {
   _transaction.container().checkClosed();
   return _transaction.container().lock();
 }
 public ObjectReference reference() {
   final HardObjectReference hardRef =
       _transaction.container().getHardObjectReferenceById(_transaction, _id);
   return hardRef._reference;
 }
 public ObjectContainerBase stream() {
   return _transaction.container();
 }
 private ReflectClass reflectorFor(Transaction trans, final Object obj) {
   return trans.container().reflector().forObject(obj);
 }