本文整理汇总了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;
}
示例2: SQLQueryJoinReturn
public SQLQueryJoinReturn(string alias, string ownerAlias, string ownerProperty, IDictionary propertyResults,
LockMode lockMode)
: base(alias, propertyResults, lockMode)
{
this.ownerAlias = ownerAlias;
this.ownerProperty = ownerProperty;
}
示例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();
}
示例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);
}
示例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;
}
}
示例6: SQLQueryCollectionReturn
public SQLQueryCollectionReturn(string alias, string ownerClass, string ownerProperty, IDictionary propertyResults,
LockMode lockMode)
: base(alias, propertyResults, lockMode)
{
this.ownerEntityName = ownerClass;
this.ownerProperty = ownerProperty;
}
示例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);
}
示例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);
}
示例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;
}
示例10: InitStatementString
private void InitStatementString(
SqlString condition,
string orderBy,
LockMode lockMode)
{
InitStatementString(null, condition, orderBy, "", lockMode);
}
示例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();
}
示例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);
}
示例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;
}
示例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;
}
示例15: NonScalarReturn
public NonScalarReturn(string alias, LockMode lockMode)
{
this.alias = alias;
if (alias == null)
{
throw new HibernateException("alias must be specified");
}
this.lockMode = lockMode;
}