public Slot AllocateSlotForNewUserObject(Transaction trans, int id, int length)
        {
            Slot slot = AllocateSlot(length);

            trans.IdSystem().NotifySlotCreated(id, slot, SlotChangeFactory.UserObjects);
            return(slot);
        }
        public sealed override ByteArrayBuffer ReadBufferById(Transaction trans, int id,
                                                              bool lastCommitted)
        {
            if (id <= 0)
            {
                throw new ArgumentException();
            }
            Slot slot = lastCommitted ? trans.IdSystem().CommittedSlot(id) : trans.IdSystem()
                        .CurrentSlot(id);

            if (DTrace.enabled)
            {
                DTrace.SlotRead.LogLength(id, slot);
            }
            return(ReadBufferBySlot(slot));
        }
        public override StatefulBuffer ReadStatefulBufferById(Transaction trans, int id,
                                                              bool lastCommitted)
        {
            if (id <= 0)
            {
                throw new ArgumentException("id=" + id);
            }
            Slot slot = lastCommitted ? trans.IdSystem().CommittedSlot(id) : trans.IdSystem()
                        .CurrentSlot(id);

            if (DTrace.enabled)
            {
                DTrace.SlotRead.LogLength(id, slot);
            }
            return(ReadStatefulBufferBySlot(trans, id, slot));
        }
        public sealed override bool Delete4(Transaction transaction, ObjectReference @ref
                                            , object obj, int cascade, bool userCall)
        {
            int            id     = @ref.GetID();
            StatefulBuffer reader = ReadStatefulBufferById(transaction, id);

            if (reader != null)
            {
                if (obj != null)
                {
                    if ((!ShowInternalClasses()) && Const4.ClassInternal.IsAssignableFrom(obj.GetType
                                                                                              ()))
                    {
                        return(false);
                    }
                }
                reader.SetCascadeDeletes(cascade);
                transaction.IdSystem().NotifySlotDeleted(id, SlotChangeFactory.UserObjects);
                ClassMetadata classMetadata = @ref.ClassMetadata();
                classMetadata.Delete(reader, obj);
                return(true);
            }
            return(false);
        }
 public virtual ITransactionalIdSystem IdSystem(Transaction trans)
 {
     return(trans.IdSystem());
 }
Esempio n. 6
0
		public virtual ITransactionalIdSystem IdSystem(Transaction trans)
		{
			return trans.IdSystem();
		}
 public sealed override int IdForNewUserObject(Transaction trans)
 {
     return(trans.IdSystem().NewId(SlotChangeFactory.UserObjects));
 }
Esempio n. 8
0
		public Slot AllocateSlotForNewUserObject(Transaction trans, int id, int length)
		{
			Slot slot = AllocateSlot(length);
			trans.IdSystem().NotifySlotCreated(id, slot, SlotChangeFactory.UserObjects);
			return slot;
		}
 public override bool IsDeleted(Transaction trans, int id)
 {
     return(trans.IdSystem().IsDeleted(id));
 }
Esempio n. 10
0
		public override StatefulBuffer ReadStatefulBufferById(Transaction trans, int id, 
			bool lastCommitted)
		{
			if (id <= 0)
			{
				throw new ArgumentException("id=" + id);
			}
			Slot slot = lastCommitted ? trans.IdSystem().CommittedSlot(id) : trans.IdSystem()
				.CurrentSlot(id);
			if (DTrace.enabled)
			{
				DTrace.SlotRead.LogLength(id, slot);
			}
			return ReadStatefulBufferBySlot(trans, id, slot);
		}
Esempio n. 11
0
		public sealed override ByteArrayBuffer ReadBufferById(Transaction trans, int id, 
			bool lastCommitted)
		{
			if (id <= 0)
			{
				throw new ArgumentException();
			}
			Slot slot = lastCommitted ? trans.IdSystem().CommittedSlot(id) : trans.IdSystem()
				.CurrentSlot(id);
			if (DTrace.enabled)
			{
				DTrace.SlotRead.LogLength(id, slot);
			}
			return ReadBufferBySlot(slot);
		}
Esempio n. 12
0
		public sealed override int IdForNewUserObject(Transaction trans)
		{
			return trans.IdSystem().NewId(SlotChangeFactory.UserObjects);
		}
Esempio n. 13
0
		public sealed override bool Delete4(Transaction transaction, ObjectReference @ref
			, object obj, int cascade, bool userCall)
		{
			int id = @ref.GetID();
			StatefulBuffer reader = ReadStatefulBufferById(transaction, id);
			if (reader != null)
			{
				if (obj != null)
				{
					if ((!ShowInternalClasses()) && Const4.ClassInternal.IsAssignableFrom(obj.GetType
						()))
					{
						return false;
					}
				}
				reader.SetCascadeDeletes(cascade);
				transaction.IdSystem().NotifySlotDeleted(id, SlotChangeFactory.UserObjects);
				ClassMetadata classMetadata = @ref.ClassMetadata();
				classMetadata.Delete(reader, obj);
				return true;
			}
			return false;
		}
Esempio n. 14
0
		public override bool IsDeleted(Transaction trans, int id)
		{
			return trans.IdSystem().IsDeleted(id);
		}