예제 #1
0
 public virtual void Test3()
 {
     NeoDatis.Odb.Core.Transaction.ICache cache = NeoDatis.Odb.Impl.Core.Transaction.CacheFactory
                                                  .GetLocalCache(null, "temp");
     NeoDatis.Odb.Core.Layers.Layer2.Meta.ClassInfo ci = new NeoDatis.Odb.Core.Layers.Layer2.Meta.ClassInfo
                                                             (this.GetType().FullName);
     ci.SetPosition(1);
     NeoDatis.Odb.Core.Layers.Layer2.Meta.ObjectInfoHeader oih1 = new NeoDatis.Odb.Core.Layers.Layer2.Meta.ObjectInfoHeader
                                                                      ();
     NeoDatis.Odb.Core.Layers.Layer2.Meta.ObjectInfoHeader oih2 = new NeoDatis.Odb.Core.Layers.Layer2.Meta.ObjectInfoHeader
                                                                      ();
     NeoDatis.Odb.Core.Layers.Layer2.Meta.ObjectInfoHeader oih3 = new NeoDatis.Odb.Core.Layers.Layer2.Meta.ObjectInfoHeader
                                                                      ();
     oih1.SetOid(NeoDatis.Odb.Core.Oid.OIDFactory.BuildObjectOID(1));
     oih2.SetOid(NeoDatis.Odb.Core.Oid.OIDFactory.BuildObjectOID(10));
     oih3.SetOid(NeoDatis.Odb.Core.Oid.OIDFactory.BuildObjectOID(100));
     NeoDatis.Odb.Core.Layers.Layer2.Meta.NonNativeObjectInfo nnoi1 = new NeoDatis.Odb.Core.Layers.Layer2.Meta.NonNativeObjectInfo
                                                                          (oih1, ci);
     NeoDatis.Odb.Core.Layers.Layer2.Meta.NonNativeObjectInfo nnoi2 = new NeoDatis.Odb.Core.Layers.Layer2.Meta.NonNativeObjectInfo
                                                                          (oih2, ci);
     NeoDatis.Odb.Core.Layers.Layer2.Meta.NonNativeObjectInfo nnoi3 = new NeoDatis.Odb.Core.Layers.Layer2.Meta.NonNativeObjectInfo
                                                                          (oih3, ci);
     cache.StartReadingObjectInfoWithOid(NeoDatis.Odb.Core.Oid.OIDFactory.BuildObjectOID
                                             (1), nnoi1);
     cache.StartReadingObjectInfoWithOid(NeoDatis.Odb.Core.Oid.OIDFactory.BuildObjectOID
                                             (10), nnoi2);
     cache.StartReadingObjectInfoWithOid(NeoDatis.Odb.Core.Oid.OIDFactory.BuildObjectOID
                                             (100), nnoi3);
     AssertTrue(cache.IsReadingObjectInfoWithOid(NeoDatis.Odb.Core.Oid.OIDFactory.BuildObjectOID
                                                     (1)));
     AssertTrue(cache.IsReadingObjectInfoWithOid(NeoDatis.Odb.Core.Oid.OIDFactory.BuildObjectOID
                                                     (10)));
     AssertTrue(cache.IsReadingObjectInfoWithOid(NeoDatis.Odb.Core.Oid.OIDFactory.BuildObjectOID
                                                     (100)));
     cache.EndReadingObjectInfo(nnoi1.GetOid());
     cache.EndReadingObjectInfo(nnoi2.GetOid());
     cache.EndReadingObjectInfo(nnoi3.GetOid());
     AssertFalse(cache.IsReadingObjectInfoWithOid(NeoDatis.Odb.Core.Oid.OIDFactory.BuildObjectOID
                                                      (1)));
     AssertFalse(cache.IsReadingObjectInfoWithOid(NeoDatis.Odb.Core.Oid.OIDFactory.BuildObjectOID
                                                      (10)));
     AssertFalse(cache.IsReadingObjectInfoWithOid(NeoDatis.Odb.Core.Oid.OIDFactory.BuildObjectOID
                                                      (100)));
 }
예제 #2
0
		/// <exception cref="System.IO.IOException"></exception>
		public virtual void Test3()
		{
			NeoDatis.Odb.Core.Transaction.ICache cache = NeoDatis.Odb.Impl.Core.Transaction.CacheFactory
				.GetLocalCache(null, "temp");
			NeoDatis.Odb.Core.Layers.Layer2.Meta.ClassInfo ci = new NeoDatis.Odb.Core.Layers.Layer2.Meta.ClassInfo
				(this.GetType().FullName);
			ci.SetPosition(1);
			NeoDatis.Odb.Core.Layers.Layer2.Meta.ObjectInfoHeader oih1 = new NeoDatis.Odb.Core.Layers.Layer2.Meta.ObjectInfoHeader
				();
			NeoDatis.Odb.Core.Layers.Layer2.Meta.ObjectInfoHeader oih2 = new NeoDatis.Odb.Core.Layers.Layer2.Meta.ObjectInfoHeader
				();
			NeoDatis.Odb.Core.Layers.Layer2.Meta.ObjectInfoHeader oih3 = new NeoDatis.Odb.Core.Layers.Layer2.Meta.ObjectInfoHeader
				();
			oih1.SetOid(NeoDatis.Odb.Core.Oid.OIDFactory.BuildObjectOID(1));
			oih2.SetOid(NeoDatis.Odb.Core.Oid.OIDFactory.BuildObjectOID(10));
			oih3.SetOid(NeoDatis.Odb.Core.Oid.OIDFactory.BuildObjectOID(100));
			NeoDatis.Odb.Core.Layers.Layer2.Meta.NonNativeObjectInfo nnoi1 = new NeoDatis.Odb.Core.Layers.Layer2.Meta.NonNativeObjectInfo
				(oih1, ci);
			NeoDatis.Odb.Core.Layers.Layer2.Meta.NonNativeObjectInfo nnoi2 = new NeoDatis.Odb.Core.Layers.Layer2.Meta.NonNativeObjectInfo
				(oih2, ci);
			NeoDatis.Odb.Core.Layers.Layer2.Meta.NonNativeObjectInfo nnoi3 = new NeoDatis.Odb.Core.Layers.Layer2.Meta.NonNativeObjectInfo
				(oih3, ci);
			cache.StartReadingObjectInfoWithOid(NeoDatis.Odb.Core.Oid.OIDFactory.BuildObjectOID
				(1), nnoi1);
			cache.StartReadingObjectInfoWithOid(NeoDatis.Odb.Core.Oid.OIDFactory.BuildObjectOID
				(10), nnoi2);
			cache.StartReadingObjectInfoWithOid(NeoDatis.Odb.Core.Oid.OIDFactory.BuildObjectOID
				(100), nnoi3);
			AssertTrue(cache.IsReadingObjectInfoWithOid(NeoDatis.Odb.Core.Oid.OIDFactory.BuildObjectOID
				(1)));
			AssertTrue(cache.IsReadingObjectInfoWithOid(NeoDatis.Odb.Core.Oid.OIDFactory.BuildObjectOID
				(10)));
			AssertTrue(cache.IsReadingObjectInfoWithOid(NeoDatis.Odb.Core.Oid.OIDFactory.BuildObjectOID
				(100)));
			cache.EndReadingObjectInfo(nnoi1.GetOid());
			cache.EndReadingObjectInfo(nnoi2.GetOid());
			cache.EndReadingObjectInfo(nnoi3.GetOid());
			AssertFalse(cache.IsReadingObjectInfoWithOid(NeoDatis.Odb.Core.Oid.OIDFactory.BuildObjectOID
				(1)));
			AssertFalse(cache.IsReadingObjectInfoWithOid(NeoDatis.Odb.Core.Oid.OIDFactory.BuildObjectOID
				(10)));
			AssertFalse(cache.IsReadingObjectInfoWithOid(NeoDatis.Odb.Core.Oid.OIDFactory.BuildObjectOID
				(100)));
		}