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


C# LockMode类代码示例

本文整理汇总了C#中LockMode的典型用法代码示例。如果您正苦于以下问题:C# LockMode类的具体用法?C# LockMode怎么用?C# LockMode使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: CollectionFetchReturn

		public CollectionFetchReturn(string alias, NonScalarReturn owner, string ownerProperty,
		                             ICollectionAliases collectionAliases, IEntityAliases elementEntityAliases,
		                             LockMode lockMode) : base(owner, ownerProperty, alias, lockMode)
		{
			this.collectionAliases = collectionAliases;
			this.elementEntityAliases = elementEntityAliases;
		}
开发者ID:KaraokeStu,项目名称:nhibernate-core,代码行数:7,代码来源:CollectionFetchReturn.cs

示例2: SQLQueryJoinReturn

		public SQLQueryJoinReturn(string alias, string ownerAlias, string ownerProperty, IDictionary propertyResults,
		                          LockMode lockMode)
			: base(alias, propertyResults, lockMode)
		{
			this.ownerAlias = ownerAlias;
			this.ownerProperty = ownerProperty;
		}
开发者ID:Novthirteen,项目名称:sconit_timesseiko,代码行数:7,代码来源:SQLQueryJoinReturn.cs

示例3: InitStatementString

		private void InitStatementString(SqlString projection,SqlString condition,
			string orderBy,string groupBy,LockMode lockMode)
		{
			int joins = CountEntityPersisters(associations);
			Suffixes = BasicLoader.GenerateSuffixes(joins + 1);
			JoinFragment ojf = MergeOuterJoins(associations);

			SqlString selectClause = projection
			                         ??
			                         new SqlString(persister.SelectFragment(alias, Suffixes[joins]) + SelectString(associations));
			
			SqlSelectBuilder select = new SqlSelectBuilder(Factory)
				.SetLockMode(lockMode)
				.SetSelectClause(selectClause)
				.SetFromClause(Dialect.AppendLockHint(lockMode, persister.FromTableFragment(alias)) +persister.FromJoinFragment(alias, true, true))
				.SetWhereClause(condition)
				.SetOuterJoins(ojf.ToFromFragmentString,ojf.ToWhereFragmentString + WhereFragment)
				.SetOrderByClause(OrderBy(associations, orderBy))
				.SetGroupByClause(groupBy);

			if (Factory.Settings.IsCommentsEnabled)
				select.SetComment(Comment);

			SqlString = select.ToSqlString();
		}
开发者ID:pallmall,项目名称:WCell,代码行数:25,代码来源:AbstractEntityJoinWalker.cs

示例4: InitProjection

		protected void InitProjection(SqlString projectionString, SqlString whereString,
			string orderByString, string groupByString, LockMode lockMode)
		{
			WalkEntityTree(persister, Alias);
			Persisters = new ILoadable[0];
			InitStatementString(projectionString, whereString, orderByString, groupByString, lockMode);
		}
开发者ID:pallmall,项目名称:WCell,代码行数:7,代码来源:AbstractEntityJoinWalker.cs

示例5: wait

        private void wait(LockMode mode)
        {
            WaitContext ctx;
            lock (typeof(PersistentResource)) 
            {
                ctx = freeContexts;
                if (ctx == null) 
                {
                    ctx = new WaitContext();
                } 
                else 
                {
                    freeContexts = ctx.next;
                }
                ctx.next = null;
            }
            if (queueStart != null) 
            { 
                queueEnd = queueEnd.next = ctx;
            } 
            else 
            { 
                queueStart = queueEnd = ctx;
            }                            
            ctx.mode = mode;
 
            Monitor.Exit(this);
            ctx.evt.WaitOne();

            lock (typeof(PersistentResource)) 
            {
                ctx.next = freeContexts;
                freeContexts = ctx;
            }
        }
开发者ID:yan122725529,项目名称:TripRobot.Crawler,代码行数:35,代码来源:PersistentResource.cs

示例6: SQLQueryCollectionReturn

		public SQLQueryCollectionReturn(string alias, string ownerClass, string ownerProperty, IDictionary propertyResults,
		                                LockMode lockMode)
			: base(alias, propertyResults, lockMode)
		{
			this.ownerEntityName = ownerClass;
			this.ownerProperty = ownerProperty;
		}
开发者ID:Novthirteen,项目名称:sconit_timesseiko,代码行数:7,代码来源:SQLQueryCollectionReturn.cs

示例7: EntityLoader

		public EntityLoader(
			IOuterJoinLoadable persister,
			string[] uniqueKey,
			IType uniqueKeyType,
			int batchSize,
			LockMode lockMode,
			ISessionFactoryImplementor factory,
			IDictionary enabledFilters)
			: base(persister, uniqueKeyType, factory, enabledFilters)
		{
			JoinWalker walker = new EntityJoinWalker(
				persister,
				uniqueKey,
				uniqueKeyType,
				batchSize,
				lockMode,
				factory,
				enabledFilters
				);
			InitFromWalker(walker);

			PostInstantiate();

			batchLoader = batchSize > 1;

			log.Debug("Static select for entity " + entityName + ": " + SqlString);
		}
开发者ID:Novthirteen,项目名称:sconit_timesseiko,代码行数:27,代码来源:EntityLoader.cs

示例8: InitAll

		protected void InitAll(
			SqlString whereString,
			string orderByString,
			LockMode lockMode)
		{
			WalkEntityTree(persister, Alias);
			IList allAssociations = new ArrayList();
			foreach (object obj in associations)
			{
				allAssociations.Add(obj);
			}
			allAssociations.Add(
				new OuterJoinableAssociation(
					persister.EntityType,
					null,
					null,
					alias,
					JoinType.LeftOuterJoin,
					Factory,
					CollectionHelper.EmptyMap
					));

			InitPersisters(allAssociations, lockMode);
			InitStatementString(whereString, orderByString, lockMode);
		}
开发者ID:Novthirteen,项目名称:sconit_timesseiko,代码行数:25,代码来源:AbstractEntityJoinWalker.cs

示例9: RefreshEvent

		public RefreshEvent(object entity, LockMode lockMode, IEventSource source)
			: this(entity, source)
		{
			if (lockMode == null)
				throw new ArgumentNullException("lockMode", "Attempt to generate refresh event with null lock mode");

			this.lockMode = lockMode;
		}
开发者ID:jlevitt,项目名称:nhibernate-core,代码行数:8,代码来源:RefreshEvent.cs

示例10: InitStatementString

		private void InitStatementString(
			SqlString condition,
			string orderBy,
			LockMode lockMode)

		{
			InitStatementString(null, condition, orderBy, "", lockMode);
		}
开发者ID:Novthirteen,项目名称:sconit_timesseiko,代码行数:8,代码来源:AbstractEntityJoinWalker.cs

示例11: SimpleEntityLoader

		public SimpleEntityLoader( ILoadable persister, SqlString sql, LockMode lockMode )
		{
			this.persister = new ILoadable[ ] {persister};
			this.idType = persister.IdentifierType;
			this.sql = sql;
			this.lockMode = new LockMode[ ] {lockMode};
			PostInstantiate();
		}
开发者ID:rcarrillopadron,项目名称:nhibernate-1.0.2.0,代码行数:8,代码来源:SimpleEntityLoader.cs

示例12: DisposableReaderWriterLock

 /// <summary>
 /// .ctor
 /// </summary>
 /// <param name="alock">Lock to handle</param>
 /// <param name="timeout">timeout to acquire lock</param>
 /// <param name="mode">Lock mode</param>
 public DisposableReaderWriterLock(ReaderWriterLock alock, TimeSpan timeout, LockMode mode = LockMode.Read)
 {
     ParametersValidator.IsNotNull(alock, ()=>alock);
     _lock = alock;
     _timeout = timeout;
     _mode = mode;
     AcquireLock();
     Logger.TraceFormat("lock created timeout={0}, mode ={1}", timeout, mode);
 }
开发者ID:sergey-prokofiev,项目名称:sp-tools,代码行数:15,代码来源:DisposableReaderWriterLock.cs

示例13: CollectionReturn

		public CollectionReturn(string alias, string ownerEntityName, string ownerProperty,
		                        ICollectionAliases collectionAliases, IEntityAliases elementEntityAliases, LockMode lockMode)
			: base(alias, lockMode)
		{
			this.ownerEntityName = ownerEntityName;
			this.ownerProperty = ownerProperty;
			this.collectionAliases = collectionAliases;
			this.elementEntityAliases = elementEntityAliases;
		}
开发者ID:marchlud,项目名称:nhibernate-core,代码行数:9,代码来源:CollectionReturn.cs

示例14: SetLockModeEvent

        /**
         * Construct a SetLockModeEvent
         *
         * @param methodSig tells us which overload of setLockMode to use
         * @param lockMode the lock mode we'll set when the event fires
         * @param alias the alias for which we'll set the lcok mode when the event
         * fires.  Can be null.
         */
        private SetLockModeEvent(
			MethodSig methodSig,
			LockMode lockMode,
			/*@Nullable*/ string alias)
        {
            this.methodSig = methodSig;
            this.lockMode = lockMode;
            this.alias = alias;
        }
开发者ID:spib,项目名称:nhcontrib,代码行数:17,代码来源:SetLockModeEvent.cs

示例15: NonScalarReturn

		public NonScalarReturn(string alias, LockMode lockMode)
		{
			this.alias = alias;
			if (alias == null)
			{
				throw new HibernateException("alias must be specified");
			}
			this.lockMode = lockMode;
		}
开发者ID:Novthirteen,项目名称:sconit_timesseiko,代码行数:9,代码来源:NonScalarReturn.cs


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