当前位置: 首页>>代码示例>>C#>>正文


C# NeoDatis.GetId方法代码示例

本文整理汇总了C#中NeoDatis.GetId方法的典型用法代码示例。如果您正苦于以下问题:C# NeoDatis.GetId方法的具体用法?C# NeoDatis.GetId怎么用?C# NeoDatis.GetId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在NeoDatis的用法示例。


在下文中一共展示了NeoDatis.GetId方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: SetChildAt

		public override void SetChildAt(NeoDatis.Btree.IBTreeNode child, int index)
		{
			if (child != null)
			{
				if (child.GetId() == null)
				{
					btree.GetPersister().SaveNode(child);
				}
				childrenOids[index] = (NeoDatis.Odb.OID)child.GetId();
				child.SetParent(this);
			}
			else
			{
				childrenOids[index] = null;
			}
		}
开发者ID:Orvid,项目名称:SQLInterfaceCollection,代码行数:16,代码来源:ODBBTreeNodeMultiple.cs

示例2: AbstractObjectInfo

		public AbstractObjectInfo(NeoDatis.Odb.Core.Layers.Layer2.Meta.ODBType type)
		{
			if (type != null)
			{
				this.odbTypeId = type.GetId();
			}
			this.odbType = type;
		}
开发者ID:Orvid,项目名称:SQLInterfaceCollection,代码行数:8,代码来源:AbstractObjectInfo.cs

示例3: AddSession

		public virtual void AddSession(NeoDatis.Odb.Core.Transaction.ISession session)
		{
			string id = NeoDatis.Tool.Wrappers.OdbThread.GetCurrentThreadName() + session.GetBaseIdentification
				();
			sessions.Add(id, session);
			if (NeoDatis.Odb.OdbConfiguration.IsDebugEnabled(LogId))
			{
				NeoDatis.Tool.DLogger.Debug("Associating id = " + id + " to session " + session.GetId
					());
			}
		}
开发者ID:Orvid,项目名称:SQLInterfaceCollection,代码行数:11,代码来源:SessionManager.cs

示例4: AddClass

		public virtual void AddClass(NeoDatis.Odb.Core.Layers.Layer2.Meta.ClassInfo classInfo
			)
		{
			if (classInfo.IsSystemClass())
			{
				rapidAccessForSystemClassesByName.Add(classInfo.GetFullClassName(), classInfo);
			}
			else
			{
				rapidAccessForUserClassesByName.Add(classInfo.GetFullClassName(), classInfo);
			}
			rapidAccessForClassesByOid.Add(classInfo.GetId(), classInfo);
			allClassInfos.Add(classInfo);
		}
开发者ID:Orvid,项目名称:SQLInterfaceCollection,代码行数:14,代码来源:MetaModel.cs

示例5: SlowGetUserClassInfoIndex

		/// <summary>This method is only used by the odb explorer.</summary>
		/// <remarks>
		/// This method is only used by the odb explorer. So there is no too much
		/// problem with performance issue.
		/// </remarks>
		/// <param name="ci"></param>
		/// <returns>The index of the class info</returns>
		public virtual int SlowGetUserClassInfoIndex(NeoDatis.Odb.Core.Layers.Layer2.Meta.ClassInfo
			 ci)
		{
			System.Collections.IEnumerator iterator = rapidAccessForUserClassesByName.Values.
				GetEnumerator();
			int i = 0;
			NeoDatis.Odb.Core.Layers.Layer2.Meta.ClassInfo ci2 = null;
			while (iterator.MoveNext())
			{
				ci2 = (NeoDatis.Odb.Core.Layers.Layer2.Meta.ClassInfo)iterator.Current;
				if (ci2.GetId() == ci.GetId())
				{
					return i;
				}
				i++;
			}
			throw new NeoDatis.Odb.ODBRuntimeException(NeoDatis.Odb.Core.NeoDatisError.ClassInfoDoesNotExistInMetaModel
				.AddParameter(ci.GetFullClassName()));
		}
开发者ID:Orvid,项目名称:SQLInterfaceCollection,代码行数:26,代码来源:MetaModel.cs

示例6: SaveBTree

		public virtual NeoDatis.Odb.OID SaveBTree(NeoDatis.Btree.IBTree treeToSave)
		{
			nbSaveTree++;
			try
			{
				NeoDatis.Odb.OID oid = (NeoDatis.Odb.OID)treeToSave.GetId();
				if (oid == null)
				{
					// first get the oid. -2 : it could be any value
					oid = engine.GetObjectWriter().GetIdManager().GetNextObjectId(-2);
					treeToSave.SetId(oid);
					oid = engine.Store(oid, treeToSave);
					if (NeoDatis.Odb.OdbConfiguration.IsDebugEnabled(LogId))
					{
						NeoDatis.Tool.DLogger.Debug("Saved btree " + treeToSave.GetId() + " with id " + oid
							 + " and  root " + treeToSave.GetRoot());
					}
					if (this.tree == null)
					{
						this.tree = treeToSave;
					}
					oids.Add(oid, treeToSave);
				}
				else
				{
					oids.Add(oid, treeToSave);
					AddModifiedOid(oid);
				}
				return oid;
			}
			catch (System.Exception e)
			{
				throw new NeoDatis.Odb.ODBRuntimeException(NeoDatis.Btree.BTreeError.InternalError
					, e);
			}
		}
开发者ID:Orvid,项目名称:SQLInterfaceCollection,代码行数:36,代码来源:LazyODBBTreePersister.cs

示例7: SaveNode

		/// <summary>
		/// saves the bree node Only puts the current node in an 'modified Node' map
		/// to be saved on commit
		/// </summary>
		public virtual object SaveNode(NeoDatis.Btree.IBTreeNode node)
		{
			NeoDatis.Odb.OID oid = null;
			// Here we only save the node if it does not have id,
			// else we just save into the hashmap
			if (node.GetId() == NeoDatis.Odb.Impl.Core.Layers.Layer3.Engine.StorageEngineConstant
				.NullObjectId)
			{
				try
				{
					nbSaveNodes++;
					// first get the oid. : -2:it could be any value
					oid = engine.GetObjectWriter().GetIdManager().GetNextObjectId(-2);
					node.SetId(oid);
					oid = engine.Store(oid, node);
					if (NeoDatis.Odb.OdbConfiguration.IsDebugEnabled(LogId))
					{
						NeoDatis.Tool.DLogger.Debug("Saved node id " + oid);
					}
					// + " : " +
					// node.toString());
					if (tree != null && node.GetBTree() == null)
					{
						node.SetBTree(tree);
					}
					oids.Add(oid, node);
					return oid;
				}
				catch (System.Exception e)
				{
					throw new NeoDatis.Odb.ODBRuntimeException(NeoDatis.Btree.BTreeError.InternalError
						.AddParameter("While saving node"), e);
				}
			}
			nbSaveNodesInCache++;
			oid = (NeoDatis.Odb.OID)node.GetId();
			oids.Add(oid, node);
			AddModifiedOid(oid);
			return oid;
		}
开发者ID:Orvid,项目名称:SQLInterfaceCollection,代码行数:44,代码来源:LazyODBBTreePersister.cs

示例8:

		private NeoDatis.Odb.Core.Layers.Layer2.Meta.ArrayObjectInfo IntropectAtomicNativeArray
			(object array, NeoDatis.Odb.Core.Layers.Layer2.Meta.ODBType type)
		{
			int length = NeoDatis.Tool.Wrappers.OdbReflection.GetArrayLength(array);
			NeoDatis.Odb.Core.Layers.Layer2.Meta.AtomicNativeObjectInfo anoi = null;
			object[] arrayCopy = new object[length];
			int typeId = 0;
			for (int i = 0; i < length; i++)
			{
				object o = NeoDatis.Tool.Wrappers.OdbReflection.GetArrayElement(array, i);
				if (o != null)
				{
					// If object is not null, try to get the exact type
					typeId = NeoDatis.Odb.Core.Layers.Layer2.Meta.ODBType.GetFromClass(o.GetType()).GetId
						();
					anoi = new NeoDatis.Odb.Core.Layers.Layer2.Meta.AtomicNativeObjectInfo(o, typeId);
					arrayCopy[i] = anoi;
				}
				else
				{
					// Else take the declared type
					arrayCopy[i] = new NeoDatis.Odb.Core.Layers.Layer2.Meta.NullNativeObjectInfo(type
						.GetId());
				}
			}
			NeoDatis.Odb.Core.Layers.Layer2.Meta.ArrayObjectInfo aoi = new NeoDatis.Odb.Core.Layers.Layer2.Meta.ArrayObjectInfo
				(arrayCopy, NeoDatis.Odb.Core.Layers.Layer2.Meta.ODBType.Array, type.GetId());
			return aoi;
		}
开发者ID:Orvid,项目名称:SQLInterfaceCollection,代码行数:29,代码来源:LocalObjectIntrospector.cs

示例9: RemoveConnection

		public virtual void RemoveConnection(NeoDatis.Odb.Core.Server.Connection.IConnection
			 connection)
		{
			connections.Remove(connection.GetId());
		}
开发者ID:Orvid,项目名称:SQLInterfaceCollection,代码行数:5,代码来源:ConnectionManager.cs

示例10: WriteClassAttributeInfo

		/// <summary>Writes a class attribute info, an attribute of a class</summary>
		/// <param name="cai"></param>
		/// <param name="writeInTransaction"></param>
		/// <></>
		private void WriteClassAttributeInfo(NeoDatis.Odb.Core.Layers.Layer2.Meta.ClassAttributeInfo
			 cai, bool writeInTransaction)
		{
			fsi.WriteInt(cai.GetId(), writeInTransaction, "attribute id");
			fsi.WriteBoolean(cai.IsNative(), writeInTransaction);
			if (cai.IsNative())
			{
				fsi.WriteInt(cai.GetAttributeType().GetId(), writeInTransaction, "att odb type id"
					);
				if (cai.GetAttributeType().IsArray())
				{
					fsi.WriteInt(cai.GetAttributeType().GetSubType().GetId(), writeInTransaction, "att array sub type"
						);
					// when the attribute is not native, then write its class info
					// position
					if (cai.GetAttributeType().GetSubType().IsNonNative())
					{
						fsi.WriteLong(storageEngine.GetSession(true).GetMetaModel().GetClassInfo(cai.GetAttributeType
							().GetSubType().GetName(), true).GetId().GetObjectId(), writeInTransaction, "class info id of array subtype"
							, NeoDatis.Odb.Impl.Core.Transaction.DefaultWriteAction.DataWriteAction);
					}
				}
				// For enum, we write the class info id of the enum class
				if (cai.GetAttributeType().IsEnum())
				{
					fsi.WriteLong(storageEngine.GetSession(true).GetMetaModel().GetClassInfo(cai.GetFullClassname
						(), true).GetId().GetObjectId(), writeInTransaction, "class info id", NeoDatis.Odb.Impl.Core.Transaction.DefaultWriteAction
						.DataWriteAction);
				}
			}
			else
			{
				fsi.WriteLong(storageEngine.GetSession(true).GetMetaModel().GetClassInfo(cai.GetFullClassname
					(), true).GetId().GetObjectId(), writeInTransaction, "class info id", NeoDatis.Odb.Impl.Core.Transaction.DefaultWriteAction
					.DataWriteAction);
			}
			fsi.WriteString(cai.GetName(), false, writeInTransaction);
			fsi.WriteBoolean(cai.IsIndex(), writeInTransaction);
		}
开发者ID:Orvid,项目名称:SQLInterfaceCollection,代码行数:43,代码来源:AbstractObjectWriter.cs

示例11: WriteClassInfoHeader

		public virtual void WriteClassInfoHeader(NeoDatis.Odb.Core.Layers.Layer2.Meta.ClassInfo
			 classInfo, long position, bool writeInTransaction)
		{
			NeoDatis.Odb.OID classId = classInfo.GetId();
			if (classId == null)
			{
				classId = idManager.GetNextClassId(position);
				classInfo.SetId(classId);
			}
			else
			{
				idManager.UpdateClassPositionForId(classId, position, true);
			}
			fsi.SetWritePosition(position, writeInTransaction);
			if (NeoDatis.Odb.OdbConfiguration.IsDebugEnabled(LogId))
			{
				NeoDatis.Tool.DLogger.Debug(DepthToSpaces() + "Writing new Class info header at "
					 + position + " : " + classInfo.ToString());
			}
			// Real value of block size is only known at the end of the writing
			fsi.WriteInt(0, writeInTransaction, "block size");
			fsi.WriteByte(NeoDatis.Odb.Impl.Core.Layers.Layer3.Block.BlockTypes.BlockTypeClassHeader
				, writeInTransaction, "class header block type");
			fsi.WriteByte(classInfo.GetClassCategory(), writeInTransaction, "Class info category"
				);
			fsi.WriteLong(classId.GetObjectId(), writeInTransaction, "class id", NeoDatis.Odb.Impl.Core.Transaction.DefaultWriteAction
				.DataWriteAction);
			WriteOid(classInfo.GetPreviousClassOID(), writeInTransaction, "prev class oid", NeoDatis.Odb.Impl.Core.Transaction.DefaultWriteAction
				.DataWriteAction);
			WriteOid(classInfo.GetNextClassOID(), writeInTransaction, "next class oid", NeoDatis.Odb.Impl.Core.Transaction.DefaultWriteAction
				.DataWriteAction);
			fsi.WriteLong(classInfo.GetCommitedZoneInfo().GetNbObjects(), writeInTransaction, 
				"class nb objects", NeoDatis.Odb.Impl.Core.Transaction.DefaultWriteAction.DataWriteAction
				);
			WriteOid(classInfo.GetCommitedZoneInfo().first, writeInTransaction, "class first obj pos"
				, NeoDatis.Odb.Impl.Core.Transaction.DefaultWriteAction.DataWriteAction);
			WriteOid(classInfo.GetCommitedZoneInfo().last, writeInTransaction, "class last obj pos"
				, NeoDatis.Odb.Impl.Core.Transaction.DefaultWriteAction.DataWriteAction);
			// FIXME : append extra info if not empty (.net compatibility)
			fsi.WriteString(classInfo.GetFullClassName(), false, writeInTransaction);
			fsi.WriteInt(classInfo.GetMaxAttributeId(), writeInTransaction, "Max attribute id"
				);
			if (classInfo.GetAttributesDefinitionPosition() != -1)
			{
				fsi.WriteLong(classInfo.GetAttributesDefinitionPosition(), writeInTransaction, "class att def pos"
					, NeoDatis.Odb.Impl.Core.Transaction.DefaultWriteAction.DataWriteAction);
			}
			else
			{
				// @todo check this
				fsi.WriteLong(-1, writeInTransaction, "class att def pos", NeoDatis.Odb.Impl.Core.Transaction.DefaultWriteAction
					.DataWriteAction);
			}
			int blockSize = (int)(fsi.GetPosition() - position);
			WriteBlockSizeAt(position, blockSize, writeInTransaction, classInfo);
		}
开发者ID:Orvid,项目名称:SQLInterfaceCollection,代码行数:56,代码来源:AbstractObjectWriter.cs

示例12: PersistClass

		/// <summary>Persist a single class info - This method is used by the XML Importer.</summary>
		/// <remarks>Persist a single class info - This method is used by the XML Importer.</remarks>
		public virtual NeoDatis.Odb.Core.Layers.Layer2.Meta.ClassInfo PersistClass(NeoDatis.Odb.Core.Layers.Layer2.Meta.ClassInfo
			 newClassInfo, int lastClassInfoIndex, bool addClass, bool addDependentClasses)
		{
			NeoDatis.Odb.Core.Layers.Layer2.Meta.MetaModel metaModel = GetSession().GetMetaModel
				();
			NeoDatis.Odb.OID classInfoId = newClassInfo.GetId();
			if (classInfoId == null)
			{
				classInfoId = GetIdManager().GetNextClassId(-1);
				newClassInfo.SetId(classInfoId);
			}
			long writePosition = fsi.GetAvailablePosition();
			newClassInfo.SetPosition(writePosition);
			GetIdManager().UpdateClassPositionForId(classInfoId, writePosition, true);
			if (NeoDatis.Odb.OdbConfiguration.IsDebugEnabled(LogId))
			{
				NeoDatis.Tool.DLogger.Debug("Persisting class into database : " + newClassInfo.GetFullClassName
					() + " with oid " + classInfoId + " at pos " + writePosition);
				NeoDatis.Tool.DLogger.Debug("class " + newClassInfo.GetFullClassName() + " has " 
					+ newClassInfo.GetNumberOfAttributes() + " attributes : " + newClassInfo.GetAttributes
					());
			}
			// The class info oid is created in ObjectWriter.writeClassInfoHeader
			if (metaModel.GetNumberOfClasses() > 0 && lastClassInfoIndex != -2)
			{
				NeoDatis.Odb.Core.Layers.Layer2.Meta.ClassInfo lastClassinfo = null;
				if (lastClassInfoIndex == -1)
				{
					lastClassinfo = metaModel.GetLastClassInfo();
				}
				else
				{
					lastClassinfo = metaModel.GetClassInfo(lastClassInfoIndex);
				}
				lastClassinfo.SetNextClassOID(newClassInfo.GetId());
				if (NeoDatis.Odb.OdbConfiguration.IsDebugEnabled(LogId))
				{
					NeoDatis.Tool.DLogger.Debug("changing next class oid. of class info " + lastClassinfo
						.GetFullClassName() + " @ " + lastClassinfo.GetPosition() + " + offset " + NeoDatis.Odb.Impl.Core.Layers.Layer3.Engine.StorageEngineConstant
						.ClassOffsetNextClassPosition + " to " + newClassInfo.GetId() + "(" + newClassInfo
						.GetFullClassName() + ")");
				}
				fsi.SetWritePosition(lastClassinfo.GetPosition() + NeoDatis.Odb.Impl.Core.Layers.Layer3.Engine.StorageEngineConstant
					.ClassOffsetNextClassPosition, true);
				fsi.WriteLong(newClassInfo.GetId().GetObjectId(), true, "next class oid", NeoDatis.Odb.Impl.Core.Transaction.DefaultWriteAction
					.PointerWriteAction);
				newClassInfo.SetPreviousClassOID(lastClassinfo.GetId());
			}
			if (addClass)
			{
				metaModel.AddClass(newClassInfo);
			}
			// updates number of classes
			WriteNumberOfClasses(metaModel.GetNumberOfClasses(), true);
			// If it is the first class , updates the first class OID
			if (newClassInfo.GetPreviousClassOID() == null)
			{
				WriteFirstClassInfoOID(newClassInfo.GetId(), true);
			}
			// Writes the header of the class - out of transaction (FIXME why out of
			// transaction)
			WriteClassInfoHeader(newClassInfo, writePosition, false);
			if (addDependentClasses)
			{
				NeoDatis.Tool.Wrappers.List.IOdbList<NeoDatis.Odb.Core.Layers.Layer2.Meta.ClassAttributeInfo
					> dependingAttributes = newClassInfo.GetAllNonNativeAttributes();
				NeoDatis.Odb.Core.Layers.Layer2.Meta.ClassAttributeInfo cai = null;
				for (int i = 0; i < dependingAttributes.Count; i++)
				{
					cai = dependingAttributes[i];
					try
					{
						NeoDatis.Odb.Core.Layers.Layer2.Meta.ClassInfo existingCI = metaModel.GetClassInfo
							(cai.GetFullClassname(), false);
						if (existingCI == null)
						{
							// TODO check if this getClassInfo is ok. Maybe, should
							// use
							// a buffered one
							AddClasses(classIntrospector.Introspect(cai.GetFullClassname(), true));
						}
						else
						{
							// Even,if it exist,take the one from metamodel
							cai.SetClassInfo(existingCI);
						}
					}
					catch (System.Exception e)
					{
						throw new NeoDatis.Odb.ODBRuntimeException(NeoDatis.Odb.Core.NeoDatisError.ClassIntrospectionError
							.AddParameter(cai.GetFullClassname()), e);
					}
				}
			}
			WriteClassInfoBody(newClassInfo, fsi.GetAvailablePosition(), true);
			return newClassInfo;
		}
开发者ID:Orvid,项目名称:SQLInterfaceCollection,代码行数:99,代码来源:AbstractObjectWriter.cs

示例13: ManageNewObjectPointers

		/// <summary>Updates pointers of objects, Only changes uncommitted info pointers</summary>
		/// <param name="objectInfo">The meta representation of the object being inserted</param>
		/// <param name="classInfo">The class of the object being inserted</param>
		/// <param name="position">The position where the object is being inserted @</param>
		private void ManageNewObjectPointers(NeoDatis.Odb.Core.Layers.Layer2.Meta.NonNativeObjectInfo
			 objectInfo, NeoDatis.Odb.Core.Layers.Layer2.Meta.ClassInfo classInfo, long position
			, NeoDatis.Odb.Core.Layers.Layer2.Meta.MetaModel metaModel)
		{
			NeoDatis.Odb.Core.Transaction.ICache cache = storageEngine.GetSession(true).GetCache
				();
			bool isFirstUncommitedObject = !classInfo.GetUncommittedZoneInfo().HasObjects();
			// if it is the first uncommitted object
			if (isFirstUncommitedObject)
			{
				classInfo.GetUncommittedZoneInfo().first = objectInfo.GetOid();
				NeoDatis.Odb.OID lastCommittedObjectOid = classInfo.GetCommitedZoneInfo().last;
				if (lastCommittedObjectOid != null)
				{
					// Also updates the last committed object next object oid in
					// memory to connect the committed
					// zone with unconnected for THIS transaction (only in memory)
					NeoDatis.Odb.Core.Layers.Layer2.Meta.ObjectInfoHeader oih = cache.GetObjectInfoHeaderFromOid
						(lastCommittedObjectOid, true);
					oih.SetNextObjectOID(objectInfo.GetOid());
					// And sets the previous oid of the current object with the last
					// committed oid
					objectInfo.SetPreviousInstanceOID(lastCommittedObjectOid);
				}
			}
			else
			{
				// Gets the last object, updates its (next object)
				// pointer to the new object and updates the class info 'last
				// uncommitted object
				// oid' field
				NeoDatis.Odb.Core.Layers.Layer2.Meta.ObjectInfoHeader oip = classInfo.GetLastObjectInfoHeader
					();
				if (oip == null)
				{
					throw new NeoDatis.Odb.ODBRuntimeException(NeoDatis.Odb.Core.NeoDatisError.InternalError
						.AddParameter("last OIP is null in manageNewObjectPointers oid=" + objectInfo.GetOid
						()));
				}
				if (oip.GetNextObjectOID() != objectInfo.GetOid())
				{
					oip.SetNextObjectOID(objectInfo.GetOid());
					// Here we are working in unconnected zone, so this
					// can be done without transaction: actually
					// write in database file
					UpdateNextObjectFieldOfObjectInfo(oip.GetOid(), oip.GetNextObjectOID(), false);
					objectInfo.SetPreviousInstanceOID(oip.GetOid());
					// Resets the class info oid: In some case,
					// (client // server) it may be -1.
					oip.SetClassInfoId(classInfo.GetId());
					// object info oip has been changed, we must put it
					// in the cache to turn this change available for current
					// transaction until the commit
					storageEngine.GetSession(true).GetCache().AddObjectInfo(oip);
				}
			}
			// always set the new last object oid and the number of objects
			classInfo.GetUncommittedZoneInfo().last = objectInfo.GetOid();
			classInfo.GetUncommittedZoneInfo().IncreaseNbObjects();
			// Then updates the last info pointers of the class info
			// with this new created object
			// At this moment, the objectInfo.getHeader() do not have the
			// attribute ids.
			// but later in this code, the attributes will be set, so the class
			// info also will have them
			classInfo.SetLastObjectInfoHeader(objectInfo.GetHeader());
			// // Saves the fact that something has changed in the class (number of
			// objects and/or last object oid)
			storageEngine.GetSession(true).GetMetaModel().AddChangedClass(classInfo);
		}
开发者ID:Orvid,项目名称:SQLInterfaceCollection,代码行数:74,代码来源:AbstractObjectWriter.cs

示例14: LockOidForConnection

		/// <exception cref="System.Exception"></exception>
		public virtual void LockOidForConnection(NeoDatis.Odb.OID oid, NeoDatis.Odb.Core.Server.Connection.IConnection
			 connection)
		{
			lock (this)
			{
				long start = NeoDatis.Tool.Wrappers.OdbTime.GetCurrentTimeInMs();
				if (NeoDatis.Odb.OdbConfiguration.IsDebugEnabled(LogId))
				{
					start = NeoDatis.Tool.Wrappers.OdbTime.GetCurrentTimeInMs();
					NeoDatis.Tool.DLogger.Debug("Trying to lock object with oid " + oid + " - id=" + 
						connection.GetId());
				}
				try
				{
					NeoDatis.Odb.Core.Server.Connection.IConnection c = lockedOids[oid];
					if (c == null)
					{
						lockedOids.Add(oid, connection);
						return;
					}
					// If oid is locked for by the passed connection, no problem, it is not considered as being locked
					if (c != null && c.Equals(connection))
					{
						return;
					}
					while (c != null)
					{
						NeoDatis.Tool.Wrappers.OdbThread.Sleep(10);
						c = lockedOids[oid];
					}
					lockedOids.Add(oid, connection);
				}
				finally
				{
					if (NeoDatis.Odb.OdbConfiguration.IsDebugEnabled(LogId))
					{
						NeoDatis.Tool.DLogger.Debug("Object with oid " + oid + " locked (" + (NeoDatis.Tool.Wrappers.OdbTime
							.GetCurrentTimeInMs() - start) + "ms) - " + connection.GetId());
					}
				}
			}
		}
开发者ID:Orvid,项目名称:SQLInterfaceCollection,代码行数:43,代码来源:ConnectionManager.cs

示例15: IntrospectCollection

		protected virtual NeoDatis.Odb.Core.Layers.Layer2.Meta.AbstractObjectInfo GetNativeObjectInfoInternal
			(NeoDatis.Odb.Core.Layers.Layer2.Meta.ODBType type, object o, bool recursive
			, System.Collections.Generic.IDictionary<object, NeoDatis.Odb.Core.Layers.Layer2.Meta.NonNativeObjectInfo
			> alreadyReadObjects, NeoDatis.Odb.Core.Layers.Layer1.Introspector.IIntrospectionCallback
			 callback)
		{
			NeoDatis.Odb.Core.Layers.Layer2.Meta.AbstractObjectInfo aoi = null;
			if (type.IsAtomicNative())
			{
				if (o == null)
				{
					aoi = new NeoDatis.Odb.Core.Layers.Layer2.Meta.NullNativeObjectInfo(type.GetId());
				}
				else
				{
					aoi = new NeoDatis.Odb.Core.Layers.Layer2.Meta.AtomicNativeObjectInfo(o, type
						.GetId());
				}
			}
			else
			{
				if (type.IsCollection())
				{
					aoi = IntrospectCollection((System.Collections.ICollection)o, recursive, alreadyReadObjects
						, type, callback);
				}
				else
				{
					if (type.IsArray())
					{
						if (o == null)
						{
							aoi = new NeoDatis.Odb.Core.Layers.Layer2.Meta.ArrayObjectInfo(null);
						}
						else
						{
							// Gets the type of the elements of the array
							string realArrayClassName = OdbClassUtil.GetFullName(o.GetType().GetElementType());
							NeoDatis.Odb.Core.Layers.Layer2.Meta.ArrayObjectInfo aroi = null;
							if (recursive)
							{
								aroi = IntrospectArray(o, recursive, alreadyReadObjects, type, callback);
							}
							else
							{
								aroi = new NeoDatis.Odb.Core.Layers.Layer2.Meta.ArrayObjectInfo((object[])o
									);
							}
							aroi.SetRealArrayComponentClassName(realArrayClassName);
							aoi = aroi;
						}
					}
					else
					{
						if (type.IsMap())
						{
							if (o == null)
							{
								aoi = new NeoDatis.Odb.Core.Layers.Layer2.Meta.MapObjectInfo(null, type, type.GetDefaultInstanciationClass
									().FullName);
							}
							else
							{
								MapObjectInfo moi = null;
								string realMapClassName = OdbClassUtil.GetFullName(o.GetType());
                                bool isGeneric = o.GetType().IsGenericType;
                                if (isGeneric)
                                {
                                    moi = new MapObjectInfo(IntrospectGenericMap((System.Collections.Generic.IDictionary<object,object>)o, recursive, alreadyReadObjects, callback), type, realMapClassName);
                                }
                                else
                                {
                                    moi = new MapObjectInfo(IntrospectNonGenericMap((System.Collections.IDictionary)o, recursive, alreadyReadObjects, callback), type, realMapClassName);
                                }
								if (realMapClassName.IndexOf("$") != -1)
								{
									moi.SetRealMapClassName(OdbClassUtil.GetFullName(type.GetDefaultInstanciationClass()));
								}
								aoi = moi;
							}
						}
						else
						{
							if (type.IsEnum())
							{
								System.Enum enumObject = (System.Enum)o;
								if (enumObject == null)
								{
									aoi = new NeoDatis.Odb.Core.Layers.Layer2.Meta.NullNativeObjectInfo(type.GetSize(
										));
								}
								else
								{
                                    Type t = enumObject.GetType();
                                    string enumClassName = enumObject == null ? null : OdbClassUtil.GetFullName(enumObject.GetType());
									// Here we must check if the enum is already in the meta model. Enum must be stored in the meta
									// model to optimize its storing as we need to keep track of the enum class
									// for each enum stored. So instead of storing the enum class name, we can store enum class id, a long
									// instead of the full enum class name string
									NeoDatis.Odb.Core.Layers.Layer2.Meta.ClassInfo ci = GetClassInfo(enumClassName);
//.........这里部分代码省略.........
开发者ID:Orvid,项目名称:SQLInterfaceCollection,代码行数:101,代码来源:LocalObjectIntrospector.cs


注:本文中的NeoDatis.GetId方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。