From: <dav...@us...> - 2009-04-19 15:15:45
|
Revision: 4191 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=4191&view=rev Author: davybrion Date: 2009-04-19 15:15:43 +0000 (Sun, 19 Apr 2009) Log Message: ----------- changed the FutureBatch class to require a SessionImpl instance instead of an ISession instance Modified Paths: -------------- trunk/nhibernate/src/NHibernate/Impl/FutureBatch.cs trunk/nhibernate/src/NHibernate/Impl/FutureCriteriaBatch.cs trunk/nhibernate/src/NHibernate/Impl/FutureQueryBatch.cs Modified: trunk/nhibernate/src/NHibernate/Impl/FutureBatch.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Impl/FutureBatch.cs 2009-04-19 15:06:48 UTC (rev 4190) +++ trunk/nhibernate/src/NHibernate/Impl/FutureBatch.cs 2009-04-19 15:15:43 UTC (rev 4191) @@ -12,9 +12,9 @@ protected readonly SessionImpl session; - protected FutureBatch(ISession session) + protected FutureBatch(SessionImpl session) { - this.session = (SessionImpl)session; + this.session = session; } public IList Results Modified: trunk/nhibernate/src/NHibernate/Impl/FutureCriteriaBatch.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Impl/FutureCriteriaBatch.cs 2009-04-19 15:06:48 UTC (rev 4190) +++ trunk/nhibernate/src/NHibernate/Impl/FutureCriteriaBatch.cs 2009-04-19 15:15:43 UTC (rev 4191) @@ -4,7 +4,7 @@ { public class FutureCriteriaBatch : FutureBatch<ICriteria, IMultiCriteria> { - public FutureCriteriaBatch(ISession session) : base(session) {} + public FutureCriteriaBatch(SessionImpl session) : base(session) {} protected override IMultiCriteria CreateMultiApproach() { Modified: trunk/nhibernate/src/NHibernate/Impl/FutureQueryBatch.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Impl/FutureQueryBatch.cs 2009-04-19 15:06:48 UTC (rev 4190) +++ trunk/nhibernate/src/NHibernate/Impl/FutureQueryBatch.cs 2009-04-19 15:15:43 UTC (rev 4191) @@ -4,7 +4,7 @@ { public class FutureQueryBatch : FutureBatch<IQuery, IMultiQuery> { - public FutureQueryBatch(ISession session) : base(session) {} + public FutureQueryBatch(SessionImpl session) : base(session) {} protected override IMultiQuery CreateMultiApproach() { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fab...@us...> - 2009-05-18 22:20:12
|
Revision: 4343 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=4343&view=rev Author: fabiomaulo Date: 2009-05-18 22:20:04 +0000 (Mon, 18 May 2009) Log Message: ----------- Minor (Make CLSCompliant) Modified Paths: -------------- trunk/nhibernate/src/NHibernate/Impl/AbstractSessionImpl.cs trunk/nhibernate/src/NHibernate/Impl/SessionImpl.cs trunk/nhibernate/src/NHibernate/Impl/StatelessSessionImpl.cs Modified: trunk/nhibernate/src/NHibernate/Impl/AbstractSessionImpl.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Impl/AbstractSessionImpl.cs 2009-05-18 21:56:51 UTC (rev 4342) +++ trunk/nhibernate/src/NHibernate/Impl/AbstractSessionImpl.cs 2009-05-18 22:20:04 UTC (rev 4343) @@ -26,7 +26,7 @@ [NonSerialized] private ISessionFactoryImplementor factory; - protected readonly Guid sessionId = Guid.NewGuid(); + private readonly Guid sessionId = Guid.NewGuid(); private bool closed; private System.Transactions.Transaction ambientTransation; private bool isAlreadyDisposed; @@ -58,7 +58,7 @@ public void Initialize() { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionIdLoggingContext(SessionId)) { CheckAndUpdateSessionStatus(); } @@ -108,7 +108,7 @@ public virtual IQuery GetNamedSQLQuery(string name) { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionIdLoggingContext(SessionId)) { CheckAndUpdateSessionStatus(); NamedSQLQueryDefinition nsqlqd = factory.GetNamedSQLQuery(name); @@ -147,7 +147,7 @@ public virtual IQuery GetNamedQuery(string queryName) { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionIdLoggingContext(SessionId)) { CheckAndUpdateSessionStatus(); NamedQueryDefinition nqd = factory.GetNamedQuery(queryName); @@ -183,7 +183,7 @@ protected internal virtual void CheckAndUpdateSessionStatus() { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionIdLoggingContext(SessionId)) { ErrorIfClosed(); EnlistInAmbientTransactionIfNeeded(); @@ -226,7 +226,7 @@ private void InitQuery(IQuery query, NamedQueryDefinition nqd) { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionIdLoggingContext(SessionId)) { query.SetCacheable(nqd.IsCacheable); query.SetCacheRegion(nqd.CacheRegion); @@ -252,7 +252,7 @@ public virtual IQuery CreateQuery(string queryString) { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionIdLoggingContext(SessionId)) { CheckAndUpdateSessionStatus(); QueryImpl query = new QueryImpl(queryString, this, GetHQLQueryPlan(queryString, false).ParameterMetadata); @@ -263,7 +263,7 @@ public virtual ISQLQuery CreateSQLQuery(string sql) { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionIdLoggingContext(SessionId)) { CheckAndUpdateSessionStatus(); SqlQueryImpl query = new SqlQueryImpl(sql, this, factory.QueryPlanCache.GetSQLParameterMetadata(sql)); @@ -274,7 +274,7 @@ protected internal virtual HQLQueryPlan GetHQLQueryPlan(string query, bool shallow) { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionIdLoggingContext(SessionId)) { return factory.QueryPlanCache.GetHQLQueryPlan(query, shallow, EnabledFilters); } @@ -282,7 +282,7 @@ protected internal virtual NativeSQLQueryPlan GetNativeSQLQueryPlan(NativeSQLQuerySpecification spec) { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionIdLoggingContext(SessionId)) { return factory.QueryPlanCache.GetNativeSQLQueryPlan(spec); } @@ -290,7 +290,7 @@ protected ADOException Convert(Exception sqlException, string message) { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionIdLoggingContext(SessionId)) { return ADOExceptionHelper.Convert(factory.SQLExceptionConverter, sqlException, message); } @@ -298,7 +298,7 @@ protected void AfterOperation(bool success) { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionIdLoggingContext(SessionId)) { if (!ConnectionManager.IsInActiveTransaction) { @@ -311,7 +311,7 @@ void IEnlistmentNotification.Prepare(PreparingEnlistment preparingEnlistment) { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionIdLoggingContext(SessionId)) { try { @@ -342,7 +342,7 @@ void IEnlistmentNotification.Commit(Enlistment enlistment) { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionIdLoggingContext(SessionId)) { logger.Debug("committing DTC transaction"); // we have nothing to do here, since it is the actual @@ -353,7 +353,7 @@ void IEnlistmentNotification.Rollback(Enlistment enlistment) { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionIdLoggingContext(SessionId)) { AfterTransactionCompletion(false, null); logger.Debug("rolled back DTC transaction"); @@ -363,7 +363,7 @@ void IEnlistmentNotification.InDoubt(Enlistment enlistment) { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionIdLoggingContext(SessionId)) { AfterTransactionCompletion(false, null); logger.Debug("DTC transaction is in doubt"); @@ -373,7 +373,7 @@ protected void EnlistInAmbientTransactionIfNeeded() { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionIdLoggingContext(SessionId)) { if (ambientTransation != null) return; Modified: trunk/nhibernate/src/NHibernate/Impl/SessionImpl.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Impl/SessionImpl.cs 2009-05-18 21:56:51 UTC (rev 4342) +++ trunk/nhibernate/src/NHibernate/Impl/SessionImpl.cs 2009-05-18 22:20:04 UTC (rev 4343) @@ -202,7 +202,7 @@ ConnectionReleaseMode connectionReleaseMode) : base(factory) { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionIdLoggingContext(SessionId)) { if (interceptor == null) throw new AssertionFailure("The interceptor can not be null."); @@ -226,7 +226,7 @@ if (log.IsDebugEnabled) { - log.Debug(string.Format("[session-id={0}] opened session at timestamp:{1}", sessionId, timestamp)); + log.Debug(string.Format("[session-id={0}] opened session at timestamp:{1}", SessionId, timestamp)); } CheckAndUpdateSessionStatus(); @@ -241,7 +241,7 @@ private SessionImpl(SessionImpl parent, EntityMode entityMode) : base(parent.Factory) { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionIdLoggingContext(SessionId)) { rootSession = parent; timestamp = parent.timestamp; @@ -326,7 +326,7 @@ /// <summary></summary> public IDbConnection Close() { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionIdLoggingContext(SessionId)) { log.Debug("closing session"); if (IsClosed) @@ -376,7 +376,7 @@ /// </summary> public override void AfterTransactionCompletion(bool success, ITransaction tx) { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionIdLoggingContext(SessionId)) { log.Debug("transaction completion"); if (Factory.Statistics.IsStatisticsEnabled) @@ -407,7 +407,7 @@ private void Cleanup() { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionIdLoggingContext(SessionId)) { persistenceContext.Clear(); } @@ -415,7 +415,7 @@ public LockMode GetCurrentLockMode(object obj) { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionIdLoggingContext(SessionId)) { CheckAndUpdateSessionStatus(); @@ -459,7 +459,7 @@ /// <returns></returns> public object Save(object obj) { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionIdLoggingContext(SessionId)) { return FireSave(new SaveOrUpdateEvent(null, obj, this)); } @@ -467,7 +467,7 @@ public object Save(string entityName, object obj) { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionIdLoggingContext(SessionId)) { return FireSave(new SaveOrUpdateEvent(entityName, obj, this)); } @@ -480,7 +480,7 @@ /// <param name="id"></param> public void Save(object obj, object id) { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionIdLoggingContext(SessionId)) { FireSave(new SaveOrUpdateEvent(null, obj, id, this)); } @@ -492,7 +492,7 @@ /// <param name="obj"></param> public void Delete(object obj) { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionIdLoggingContext(SessionId)) { FireDelete(new DeleteEvent(obj, this)); } @@ -501,7 +501,7 @@ /// <summary> Delete a persistent object (by explicit entity name)</summary> public void Delete(string entityName, object obj) { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionIdLoggingContext(SessionId)) { FireDelete(new DeleteEvent(entityName, obj, this)); } @@ -509,7 +509,7 @@ public void Update(object obj) { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionIdLoggingContext(SessionId)) { FireUpdate(new SaveOrUpdateEvent(null, obj, this)); } @@ -517,7 +517,7 @@ public void Update(string entityName, object obj) { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionIdLoggingContext(SessionId)) { FireUpdate(new SaveOrUpdateEvent(entityName, obj, this)); } @@ -525,7 +525,7 @@ public void SaveOrUpdate(object obj) { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionIdLoggingContext(SessionId)) { FireSaveOrUpdate(new SaveOrUpdateEvent(null, obj, this)); } @@ -533,7 +533,7 @@ public void SaveOrUpdate(string entityName, object obj) { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionIdLoggingContext(SessionId)) { FireSaveOrUpdate(new SaveOrUpdateEvent(entityName, obj, this)); } @@ -541,7 +541,7 @@ public void Update(object obj, object id) { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionIdLoggingContext(SessionId)) { FireUpdate(new SaveOrUpdateEvent(null, obj, id, this)); } @@ -557,7 +557,7 @@ /// <returns></returns> public IList Find(string query) { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionIdLoggingContext(SessionId)) { return List(query, new QueryParameters()); } @@ -565,7 +565,7 @@ public IList Find(string query, object value, IType type) { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionIdLoggingContext(SessionId)) { return List(query, new QueryParameters(type, value)); } @@ -573,7 +573,7 @@ public IList Find(string query, object[] values, IType[] types) { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionIdLoggingContext(SessionId)) { return List(query, new QueryParameters(types, values)); } @@ -581,7 +581,7 @@ public override IList List(string query, QueryParameters parameters) { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionIdLoggingContext(SessionId)) { IList results = new ArrayList(); List(query, parameters, results); @@ -591,7 +591,7 @@ public override IList<T> List<T>(string query, QueryParameters parameters) { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionIdLoggingContext(SessionId)) { List<T> results = new List<T>(); List(query, parameters, results); @@ -601,7 +601,7 @@ public override void List(string query, QueryParameters queryParameters, IList results) { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionIdLoggingContext(SessionId)) { CheckAndUpdateSessionStatus(); queryParameters.ValidateParameters(); @@ -634,7 +634,7 @@ public override IQueryTranslator[] GetQueries(string query, bool scalar) { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionIdLoggingContext(SessionId)) { HQLQueryPlan plan = Factory.QueryPlanCache.GetHQLQueryPlan(query, scalar, enabledFilters); AutoFlushIfRequired(plan.QuerySpaces); @@ -644,7 +644,7 @@ public IEnumerable Enumerable(string query) { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionIdLoggingContext(SessionId)) { return Enumerable(query, NoArgs, NoTypes); } @@ -652,7 +652,7 @@ public IEnumerable Enumerable(string query, object value, IType type) { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionIdLoggingContext(SessionId)) { return Enumerable(query, new[] { value }, new[] { type }); } @@ -660,7 +660,7 @@ public IEnumerable Enumerable(string query, object[] values, IType[] types) { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionIdLoggingContext(SessionId)) { return Enumerable(query, new QueryParameters(types, values)); } @@ -668,7 +668,7 @@ public override IEnumerable<T> Enumerable<T>(string query, QueryParameters queryParameters) { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionIdLoggingContext(SessionId)) { CheckAndUpdateSessionStatus(); queryParameters.ValidateParameters(); @@ -689,7 +689,7 @@ public override IEnumerable Enumerable(string query, QueryParameters queryParameters) { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionIdLoggingContext(SessionId)) { CheckAndUpdateSessionStatus(); queryParameters.ValidateParameters(); @@ -712,7 +712,7 @@ public int Delete(string query) { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionIdLoggingContext(SessionId)) { return Delete(query, NoArgs, NoTypes); } @@ -720,7 +720,7 @@ public int Delete(string query, object value, IType type) { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionIdLoggingContext(SessionId)) { return Delete(query, new[] { value }, new[] { type }); } @@ -728,7 +728,7 @@ public int Delete(string query, object[] values, IType[] types) { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionIdLoggingContext(SessionId)) { if (string.IsNullOrEmpty(query)) { @@ -758,7 +758,7 @@ public void Lock(object obj, LockMode lockMode) { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionIdLoggingContext(SessionId)) { FireLock(new LockEvent(obj, lockMode, this)); } @@ -766,7 +766,7 @@ public void Lock(string entityName, object obj, LockMode lockMode) { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionIdLoggingContext(SessionId)) { FireLock(new LockEvent(entityName, obj, lockMode, this)); } @@ -780,7 +780,7 @@ /// <returns></returns> public IQuery CreateFilter(object collection, string queryString) { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionIdLoggingContext(SessionId)) { CheckAndUpdateSessionStatus(); @@ -795,7 +795,7 @@ private FilterQueryPlan GetFilterQueryPlan(object collection, string filter, QueryParameters parameters, bool shallow) { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionIdLoggingContext(SessionId)) { if (collection == null) { @@ -856,7 +856,7 @@ public override object Instantiate(string clazz, object id) { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionIdLoggingContext(SessionId)) { return Instantiate(Factory.GetEntityPersister(clazz), id); } @@ -880,7 +880,7 @@ /// <returns></returns> public object Instantiate(IEntityPersister persister, object id) { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionIdLoggingContext(SessionId)) { ErrorIfClosed(); object result = interceptor.Instantiate(persister.EntityName, entityMode, id); @@ -896,7 +896,7 @@ /// <summary> Force an immediate flush</summary> public void ForceFlush(EntityEntry entityEntry) { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionIdLoggingContext(SessionId)) { CheckAndUpdateSessionStatus(); if (log.IsDebugEnabled) @@ -920,7 +920,7 @@ /// <summary> Cascade merge an entity instance</summary> public void Merge(string entityName, object obj, IDictionary copiedAlready) { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionIdLoggingContext(SessionId)) { FireMerge(copiedAlready, new MergeEvent(entityName, obj, this)); } @@ -929,7 +929,7 @@ /// <summary> Cascade persist an entity instance</summary> public void Persist(string entityName, object obj, IDictionary createdAlready) { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionIdLoggingContext(SessionId)) { FirePersist(createdAlready, new PersistEvent(entityName, obj, this)); } @@ -938,7 +938,7 @@ /// <summary> Cascade persist an entity instance during the flush process</summary> public void PersistOnFlush(string entityName, object obj, IDictionary copiedAlready) { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionIdLoggingContext(SessionId)) { FirePersistOnFlush(copiedAlready, new PersistEvent(entityName, obj, this)); } @@ -947,7 +947,7 @@ /// <summary> Cascade refresh an entity instance</summary> public void Refresh(object obj, IDictionary refreshedAlready) { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionIdLoggingContext(SessionId)) { FireRefresh(refreshedAlready, new RefreshEvent(obj, this)); } @@ -956,7 +956,7 @@ /// <summary> Cascade copy an entity instance</summary> public void SaveOrUpdateCopy(string entityName, object obj, IDictionary copiedAlready) { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionIdLoggingContext(SessionId)) { FireSaveOrUpdateCopy(copiedAlready, new MergeEvent(entityName, obj, this)); } @@ -965,7 +965,7 @@ /// <summary> Cascade delete an entity instance</summary> public void Delete(string entityName, object child, bool isCascadeDeleteEnabled, ISet transientEntities) { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionIdLoggingContext(SessionId)) { FireDelete(new DeleteEvent(entityName, child, isCascadeDeleteEnabled, this), transientEntities); } @@ -975,7 +975,7 @@ public object Merge(string entityName, object obj) { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionIdLoggingContext(SessionId)) { return FireMerge(new MergeEvent(entityName, obj, this)); } @@ -983,7 +983,7 @@ public object Merge(object obj) { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionIdLoggingContext(SessionId)) { return Merge(null, obj); } @@ -991,7 +991,7 @@ public void Persist(string entityName, object obj) { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionIdLoggingContext(SessionId)) { FirePersist(new PersistEvent(entityName, obj, this)); } @@ -999,7 +999,7 @@ public void Persist(object obj) { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionIdLoggingContext(SessionId)) { Persist(null, obj); } @@ -1007,7 +1007,7 @@ public void PersistOnFlush(string entityName, object obj) { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionIdLoggingContext(SessionId)) { FirePersistOnFlush(new PersistEvent(entityName, obj, this)); } @@ -1015,7 +1015,7 @@ public void PersistOnFlush(object obj) { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionIdLoggingContext(SessionId)) { Persist(null, obj); } @@ -1035,7 +1035,7 @@ public override string BestGuessEntityName(object entity) { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionIdLoggingContext(SessionId)) { INHibernateProxy proxy = entity as INHibernateProxy; if (proxy != null) @@ -1064,7 +1064,7 @@ public override string GuessEntityName(object entity) { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionIdLoggingContext(SessionId)) { string entityName = interceptor.GetEntityName(entity); if (entityName == null) @@ -1086,7 +1086,7 @@ public override object GetEntityUsingInterceptor(EntityKey key) { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionIdLoggingContext(SessionId)) { CheckAndUpdateSessionStatus(); // todo : should this get moved to PersistentContext? @@ -1126,7 +1126,7 @@ /// <returns></returns> private bool AutoFlushIfRequired(ISet<string> querySpaces) { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionIdLoggingContext(SessionId)) { CheckAndUpdateSessionStatus(); if (!TransactionInProgress) @@ -1148,7 +1148,7 @@ public void Load(object obj, object id) { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionIdLoggingContext(SessionId)) { LoadEvent loadEvent = new LoadEvent(id, obj, this); FireLoad(loadEvent, LoadEventListener.Reload); @@ -1157,7 +1157,7 @@ public T Load<T>(object id) { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionIdLoggingContext(SessionId)) { return (T)Load(typeof(T), id); } @@ -1165,7 +1165,7 @@ public T Load<T>(object id, LockMode lockMode) { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionIdLoggingContext(SessionId)) { return (T)Load(typeof(T), id, lockMode); } @@ -1187,7 +1187,7 @@ /// </exception> public object Load(System.Type entityClass, object id, LockMode lockMode) { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionIdLoggingContext(SessionId)) { return Load(entityClass.FullName, id, lockMode); } @@ -1195,7 +1195,7 @@ public object Load(string entityName, object id) { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionIdLoggingContext(SessionId)) { if (id == null) { @@ -1223,7 +1223,7 @@ public object Load(string entityName, object id, LockMode lockMode) { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionIdLoggingContext(SessionId)) { var @event = new LoadEvent(id, entityName, lockMode, this); FireLoad(@event, LoadEventListener.Load); @@ -1233,7 +1233,7 @@ public object Load(System.Type entityClass, object id) { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionIdLoggingContext(SessionId)) { return Load(entityClass.FullName, id); } @@ -1241,7 +1241,7 @@ public T Get<T>(object id) { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionIdLoggingContext(SessionId)) { return (T)Get(typeof(T), id); } @@ -1249,7 +1249,7 @@ public T Get<T>(object id, LockMode lockMode) { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionIdLoggingContext(SessionId)) { return (T)Get(typeof(T), id, lockMode); } @@ -1257,7 +1257,7 @@ public object Get(System.Type entityClass, object id) { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionIdLoggingContext(SessionId)) { return Get(entityClass.FullName, id); } @@ -1276,7 +1276,7 @@ /// <returns></returns> public object Get(System.Type clazz, object id, LockMode lockMode) { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionIdLoggingContext(SessionId)) { LoadEvent loadEvent = new LoadEvent(id, clazz.FullName, lockMode, this); FireLoad(loadEvent, LoadEventListener.Get); @@ -1286,7 +1286,7 @@ public string GetEntityName(object obj) { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionIdLoggingContext(SessionId)) { CheckAndUpdateSessionStatus(); var proxy = obj as INHibernateProxy; @@ -1314,7 +1314,7 @@ public object Get(string entityName, object id) { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionIdLoggingContext(SessionId)) { LoadEvent loadEvent = new LoadEvent(id, entityName, false, this); bool success = false; @@ -1338,7 +1338,7 @@ /// </summary> public override object ImmediateLoad(string entityName, object id) { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionIdLoggingContext(SessionId)) { if (log.IsDebugEnabled) { @@ -1359,7 +1359,7 @@ /// </summary> public override object InternalLoad(string entityName, object id, bool eager, bool isNullable) { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionIdLoggingContext(SessionId)) { // todo : remove LoadType type = isNullable @@ -1379,7 +1379,7 @@ public void Refresh(object obj) { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionIdLoggingContext(SessionId)) { FireRefresh(new RefreshEvent(obj, this)); } @@ -1387,7 +1387,7 @@ public void Refresh(object obj, LockMode lockMode) { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionIdLoggingContext(SessionId)) { FireRefresh(new RefreshEvent(obj, lockMode, this)); } @@ -1395,7 +1395,7 @@ public ITransaction BeginTransaction(IsolationLevel isolationLevel) { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionIdLoggingContext(SessionId)) { if (rootSession != null) { @@ -1411,7 +1411,7 @@ public ITransaction BeginTransaction() { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionIdLoggingContext(SessionId)) { if (rootSession != null) { @@ -1453,7 +1453,7 @@ /// </remarks> public override void Flush() { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionIdLoggingContext(SessionId)) { CheckAndUpdateSessionStatus(); if (persistenceContext.CascadeLevel > 0) @@ -1478,7 +1478,7 @@ public bool IsDirty() { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionIdLoggingContext(SessionId)) { CheckAndUpdateSessionStatus(); @@ -1508,7 +1508,7 @@ /// <returns></returns> public object GetIdentifier(object obj) { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionIdLoggingContext(SessionId)) { CheckAndUpdateSessionStatus(); // Actually the case for proxies will probably work even with @@ -1542,7 +1542,7 @@ /// <returns></returns> public override object GetContextEntityIdentifier(object obj) { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionIdLoggingContext(SessionId)) { INHibernateProxy proxy = obj as INHibernateProxy; if (proxy != null) @@ -1559,7 +1559,7 @@ internal ICollectionPersister GetCollectionPersister(string role) { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionIdLoggingContext(SessionId)) { return Factory.GetCollectionPersister(role); } @@ -1572,7 +1572,7 @@ /// <param name="writing"></param> public override void InitializeCollection(IPersistentCollection collection, bool writing) { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionIdLoggingContext(SessionId)) { CheckAndUpdateSessionStatus(); IInitializeCollectionEventListener[] listener = listeners.InitializeCollectionEventListeners; @@ -1607,7 +1607,7 @@ /// <summary></summary> public IDbConnection Disconnect() { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionIdLoggingContext(SessionId)) { CheckAndUpdateSessionStatus(); log.Debug("disconnecting session"); @@ -1617,7 +1617,7 @@ public void Reconnect() { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionIdLoggingContext(SessionId)) { CheckAndUpdateSessionStatus(); log.Debug("reconnecting session"); @@ -1627,7 +1627,7 @@ public void Reconnect(IDbConnection conn) { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionIdLoggingContext(SessionId)) { CheckAndUpdateSessionStatus(); log.Debug("reconnecting session"); @@ -1652,9 +1652,9 @@ /// </summary> public void Dispose() { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionIdLoggingContext(SessionId)) { - log.Debug(string.Format("[session-id={0}] running ISession.Dispose()",sessionId)); + log.Debug(string.Format("[session-id={0}] running ISession.Dispose()", SessionId)); if (TakingPartInDtcTransaction) { shouldCloseSessionOnDtcTransactionCompleted = true; @@ -1675,7 +1675,7 @@ /// </remarks> protected override void Dispose(bool isDisposing) { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionIdLoggingContext(SessionId)) { if (IsAlreadyDisposed) { @@ -1683,7 +1683,7 @@ return; } - log.Debug(string.Format("[session-id={0}] executing real Dispose({1})", sessionId, isDisposing)); + log.Debug(string.Format("[session-id={0}] executing real Dispose({1})", SessionId, isDisposing)); // free managed resources that are being managed by the session if we // know this call came through Dispose() @@ -1704,7 +1704,7 @@ public ICollection Filter(object collection, string filter) { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionIdLoggingContext(SessionId)) { QueryParameters qp = new QueryParameters(new IType[1], new object[1]); return ListFilter(collection, filter, qp); @@ -1713,7 +1713,7 @@ public ICollection Filter(object collection, string filter, object value, IType type) { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionIdLoggingContext(SessionId)) { QueryParameters qp = new QueryParameters(new IType[] { null, type }, new object[] { null, value }); return ListFilter(collection, filter, qp); @@ -1722,7 +1722,7 @@ public ICollection Filter(object collection, string filter, object[] values, IType[] types) { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionIdLoggingContext(SessionId)) { CheckAndUpdateSessionStatus(); @@ -1737,7 +1737,7 @@ private void Filter(object collection, string filter, QueryParameters queryParameters, IList results) { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionIdLoggingContext(SessionId)) { CheckAndUpdateSessionStatus(); FilterQueryPlan plan = GetFilterQueryPlan(collection, filter, queryParameters, false); @@ -1768,7 +1768,7 @@ public override IList ListFilter(object collection, string filter, QueryParameters queryParameters) { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionIdLoggingContext(SessionId)) { IList results = new ArrayList(); Filter(collection, filter, queryParameters, results); @@ -1778,7 +1778,7 @@ public override IList<T> ListFilter<T>(object collection, string filter, QueryParameters queryParameters) { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionIdLoggingContext(SessionId)) { List<T> results = new List<T>(); Filter(collection, filter, queryParameters, results); @@ -1788,7 +1788,7 @@ public override IEnumerable EnumerableFilter(object collection, string filter, QueryParameters queryParameters) { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionIdLoggingContext(SessionId)) { CheckAndUpdateSessionStatus(); FilterQueryPlan plan = GetFilterQueryPlan(collection, filter, queryParameters, true); @@ -1798,7 +1798,7 @@ public override IEnumerable<T> EnumerableFilter<T>(object collection, string filter, QueryParameters queryParameters) { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionIdLoggingContext(SessionId)) { CheckAndUpdateSessionStatus(); FilterQueryPlan plan = GetFilterQueryPlan(collection, filter, queryParameters, true); @@ -1808,7 +1808,7 @@ public ICriteria CreateCriteria<T>() where T : class { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionIdLoggingContext(SessionId)) { return CreateCriteria(typeof(T)); } @@ -1816,7 +1816,7 @@ public ICriteria CreateCriteria(System.Type persistentClass) { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionIdLoggingContext(SessionId)) { CheckAndUpdateSessionStatus(); @@ -1826,7 +1826,7 @@ public ICriteria CreateCriteria<T>(string alias) where T : class { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionIdLoggingContext(SessionId)) { return CreateCriteria(typeof(T), alias); } @@ -1834,7 +1834,7 @@ public ICriteria CreateCriteria(System.Type persistentClass, string alias) { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionIdLoggingContext(SessionId)) { CheckAndUpdateSessionStatus(); @@ -1844,7 +1844,7 @@ public ICriteria CreateCriteria(string entityName, string alias) { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionIdLoggingContext(SessionId)) { CheckAndUpdateSessionStatus(); return new CriteriaImpl(entityName, alias, this); @@ -1853,7 +1853,7 @@ public ICriteria CreateCriteria(string entityName) { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionIdLoggingContext(SessionId)) { CheckAndUpdateSessionStatus(); return new CriteriaImpl(entityName, this); @@ -1862,7 +1862,7 @@ public override IList List(CriteriaImpl criteria) { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionIdLoggingContext(SessionId)) { ArrayList results = new ArrayList(); List(criteria, results); @@ -1872,7 +1872,7 @@ public override IList<T> List<T>(CriteriaImpl criteria) { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionIdLoggingContext(SessionId)) { List<T> results = new List<T>(); List(criteria, results); @@ -1882,7 +1882,7 @@ public override void List(CriteriaImpl criteria, IList results) { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionIdLoggingContext(SessionId)) { CheckAndUpdateSessionStatus(); @@ -1937,7 +1937,7 @@ internal IOuterJoinLoadable GetOuterJoinLoadable(string entityName) { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionIdLoggingContext(SessionId)) { var persister = Factory.GetEntityPersister(entityName) as IOuterJoinLoadable; if (persister == null) @@ -1950,7 +1950,7 @@ public bool Contains(object obj) { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionIdLoggingContext(SessionId)) { CheckAndUpdateSessionStatus(); var proxy = obj as INHibernateProxy; @@ -1991,7 +1991,7 @@ /// <param name="obj"></param> public void Evict(object obj) { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionIdLoggingContext(SessionId)) { FireEvict(new EvictEvent(obj, this)); } @@ -1999,7 +1999,7 @@ public override ISQLQuery CreateSQLQuery(string sql) { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionIdLoggingContext(SessionId)) { CheckAndUpdateSessionStatus(); return base.CreateSQLQuery(sql); @@ -2008,7 +2008,7 @@ public IQuery CreateSQLQuery(string sql, string returnAlias, System.Type returnClass) { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionIdLoggingContext(SessionId)) { CheckAndUpdateSessionStatus(); return new SqlQueryImpl(sql, new[] { returnAlias }, new[] { returnClass }, this, @@ -2018,7 +2018,7 @@ public IQuery CreateSQLQuery(string sql, string[] returnAliases, System.Type[] returnClasses) { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionIdLoggingContext(SessionId)) { CheckAndUpdateSessionStatus(); return new SqlQueryImpl(sql, returnAliases, returnClasses, this, @@ -2028,7 +2028,7 @@ public override IList List(NativeSQLQuerySpecification spec, QueryParameters queryParameters) { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionIdLoggingContext(SessionId)) { ArrayList results = new ArrayList(); List(spec, queryParameters, results); @@ -2038,7 +2038,7 @@ public override IList<T> List<T>(NativeSQLQuerySpecification spec, QueryParameters queryParameters) { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionIdLoggingContext(SessionId)) { List<T> results = new List<T>(); List(spec, queryParameters, results); @@ -2048,7 +2048,7 @@ public override void List(NativeSQLQuerySpecification spec, QueryParameters queryParameters, IList results) { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionIdLoggingContext(SessionId)) { SQLCustomQuery query = new SQLCustomQuery( spec.SqlQueryReturns, @@ -2061,7 +2061,7 @@ public override void ListCustomQuery(ICustomQuery customQuery, QueryParameters queryParameters, IList results) { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionIdLoggingContext(SessionId)) { CheckAndUpdateSessionStatus(); @@ -2085,7 +2085,7 @@ public override IList<T> ListCustomQuery<T>(ICustomQuery customQuery, QueryParameters queryParameters) { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionIdLoggingContext(SessionId)) { List<T> results = new List<T>(); ListCustomQuery(customQuery, queryParameters, results); @@ -2096,7 +2096,7 @@ /// <summary></summary> public void Clear() { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionIdLoggingContext(SessionId)) { CheckAndUpdateSessionStatus(); actionQueue.Clear(); @@ -2106,7 +2106,7 @@ public void Replicate(object obj, ReplicationMode replicationMode) { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionIdLoggingContext(SessionId)) { FireReplicate(new ReplicateEvent(obj, replicationMode, this)); } @@ -2114,7 +2114,7 @@ public void Replicate(string entityName, object obj, ReplicationMode replicationMode) { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionIdLoggingContext(SessionId)) { FireReplicate(new ReplicateEvent(entityName, obj, replicationMode, this)); } @@ -2127,7 +2127,7 @@ public void CancelQuery() { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionIdLoggingContext(SessionId)) { CheckAndUpdateSessionStatus(); @@ -2142,7 +2142,7 @@ /// <returns></returns> public object SaveOrUpdateCopy(object obj) { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionIdLoggingContext(SessionId)) { return FireSaveOrUpdateCopy(new MergeEvent(null, obj, this)); } @@ -2150,7 +2150,7 @@ public object SaveOrUpdateCopy(object obj, object id) { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionIdLoggingContext(SessionId)) { return FireSaveOrUpdateCopy(new MergeEvent(null, obj, id, this)); } @@ -2158,7 +2158,7 @@ public IFilter GetEnabledFilter(string filterName) { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionIdLoggingContext(SessionId)) { CheckAndUpdateSessionStatus(); return enabledFilters[filterName]; @@ -2167,7 +2167,7 @@ public IFilter EnableFilter(string filterName) { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionIdLoggingContext(SessionId)) { CheckAndUpdateSessionStatus(); FilterImpl filter = new FilterImpl(Factory.GetFilterDefinition(filterName)); @@ -2178,7 +2178,7 @@ public void DisableFilter(string filterName) { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionIdLoggingContext(SessionId)) { CheckAndUpdateSessionStatus(); enabledFilters.Remove(filterName); @@ -2187,7 +2187,7 @@ public override Object GetFilterParameterValue(string filterParameterName) { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionIdLoggingContext(SessionId)) { CheckAndUpdateSessionStatus(); string[] parsed = ParseFilterParameterName(filterParameterName); @@ -2204,7 +2204,7 @@ public override IType GetFilterParameterType(string filterParameterName) { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionIdLoggingContext(SessionId)) { CheckAndUpdateSessionStatus(); string[] parsed = ParseFilterParameterName(filterParameterName); @@ -2240,7 +2240,7 @@ private string[] ParseFilterParameterName(string filterParameterName) { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionIdLoggingContext(SessionId)) { int dot = filterParameterName.IndexOf("."); if (dot <= 0) @@ -2260,7 +2260,7 @@ public IMultiQuery CreateMultiQuery() { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionIdLoggingContext(SessionId)) { return new MultiQueryImpl(this); } @@ -2268,7 +2268,7 @@ public IMultiCriteria CreateMultiCriteria() { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionIdLoggingContext(SessionId)) { return new MultiCriteriaImpl(this, Factory); } @@ -2285,7 +2285,7 @@ public override void AfterTransactionBegin(ITransaction tx) { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionIdLoggingContext(SessionId)) { CheckAndUpdateSessionStatus(); interceptor.AfterTransactionBegin(tx); @@ -2294,7 +2294,7 @@ public override void BeforeTransactionCompletion(ITransaction tx) { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionIdLoggingContext(SessionId)) { log.Debug("before transaction completion"); if (rootSession == null) @@ -2330,7 +2330,7 @@ public ISession GetSession(EntityMode entityMode) { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionIdLoggingContext(SessionId)) { // This is explicitly removed to allow support // for child sessions that want to flush during @@ -2422,7 +2422,7 @@ public void SetReadOnly(object entity, bool readOnly) { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionIdLoggingContext(SessionId)) { CheckAndUpdateSessionStatus(); persistenceContext.SetReadOnly(entity, readOnly); @@ -2431,7 +2431,7 @@ private void FireDelete(DeleteEvent @event) { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionIdLoggingContext(SessionId)) { CheckAndUpdateSessionStatus(); IDeleteEventListener[] deleteEventListener = listeners.DeleteEventListeners; @@ -2444,7 +2444,7 @@ private void FireDelete(DeleteEvent @event, ISet transientEntities) { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionIdLoggingContext(SessionId)) { CheckAndUpdateSessionStatus(); IDeleteEventListener[] deleteEventListener = listeners.DeleteEventListeners; @@ -2457,7 +2457,7 @@ private void FireEvict(EvictEvent evictEvent) { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionIdLoggingContext(SessionId)) { CheckAndUpdateSessionStatus(); IEvictEventListener[] evictEventListener = listeners.EvictEventListeners; @@ -2470,7 +2470,7 @@ private void FireLoad(LoadEvent @event, LoadType loadType) { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionIdLoggingContext(SessionId)) { CheckAndUpdateSessionStatus(); ILoadEventListener[] loadEventListener = listeners.LoadEventListeners; @@ -2483,7 +2483,7 @@ private void FireLock(LockEvent lockEvent) { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionIdLoggingContext(SessionId)) { CheckAndUpdateSessionStatus(); ILockEventListener[] lockEventListener = listeners.LockEventListeners; @@ -2496,7 +2496,7 @@ private object FireMerge(MergeEvent @event) { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionIdLoggingContext(SessionId)) { CheckAndUpdateSessionStatus(); IMergeEventListener[] mergeEventListener = listeners.MergeEventListeners; @@ -2510,7 +2510,7 @@ private void FireMerge(IDictionary copiedAlready, MergeEvent @event) { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionIdLoggingContext(SessionId)) { CheckAndUpdateSessionStatus(); IMergeEventListener[] mergeEventListener = listeners.MergeEventListeners; @@ -2523,7 +2523,7 @@ private void FirePersist(IDictionary copiedAlready, PersistEvent @event) { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionIdLoggingContext(SessionId)) { CheckAndUpdateSessionStatus(); IPersistEventListener[] persistEventListener = listeners.PersistEventListeners; @@ -2536,7 +2536,7 @@ private void FirePersist(PersistEvent @event) { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionIdLoggingContext(SessionId)) { CheckAndUpdateSessionStatus(); IPersistEventListener[] createEventListener = listeners.PersistEventListeners; @@ -2549,7 +2549,7 @@ private void FirePersistOnFlush(IDictionary copiedAlready, PersistEvent @event) { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionIdLoggingContext(SessionId)) { CheckAndUpdateSessionStatus(); IPersistEventListener[] persistEventListener = listeners.PersistOnFlushEventListeners; @@ -2562,7 +2562,7 @@ private void FirePersistOnFlush(PersistEvent @event) { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionIdLoggingContext(SessionId)) { CheckAndUpdateSessionStatus(); IPersistEventListener[] createEventListener = listeners.PersistOnFlushEventListeners; @@ -2575,7 +2575,7 @@ private void FireRefresh(RefreshEvent refreshEvent) { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionIdLoggingContext(SessionId)) { CheckAndUpdateSessionStatus(); IRefreshEventListener[] refreshEventListener = listeners.RefreshEventListeners; @@ -2588,7 +2588,7 @@ private void FireRefresh(IDictionary refreshedAlready, RefreshEvent refreshEvent) { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionIdLoggingContext(SessionId)) { CheckAndUpdateSessionStatus(); IRefreshEventListener[] refreshEventListener = listeners.RefreshEventListeners; @@ -2601,7 +2601,7 @@ private void FireReplicate(ReplicateEvent @event) { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionIdLoggingContext(SessionId)) { CheckAndUpdateSessionStatus(); IReplicateEventListener[] replicateEventListener = listeners.ReplicateEventListeners; @@ -2614,7 +2614,7 @@ private object FireSave(SaveOrUpdateEvent @event) { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionIdLoggingContext(SessionId)) { CheckAndUpdateSessionStatus(); ISaveOrUpdateEventListener[] saveEventListener = listeners.SaveEventListeners; @@ -2628,7 +2628,7 @@ private void FireSaveOrUpdate(SaveOrUpdateEvent @event) { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionIdLoggingContext(SessionId)) { CheckAndUpdateSessionStatus(); ISaveOrUpdateEventListener[] saveOrUpdateEventListener = listeners.SaveOrUpdateEventListeners; @@ -2641,7 +2641,7 @@ private void FireSaveOrUpdateCopy(IDictionary copiedAlready, MergeEvent @event) { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionIdLoggingContext(SessionId)) { CheckAndUpdateSessionStatus(); IMergeEventListener[] saveOrUpdateCopyEventListener = listeners.SaveOrUpdateCopyEventListeners; @@ -2654,7 +2654,7 @@ private object FireSaveOrUpdateCopy(MergeEvent @event) { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionIdLoggingContext(SessionId)) { CheckAndUpdateSessionStatus(); IMergeEventListener[] saveOrUpdateCopyEventListener = listeners.SaveOrUpdateCopyEventListeners; @@ -2668,7 +2668,7 @@ private void FireUpdate(SaveOrUpdateEvent @event) { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionIdLoggingContext(SessionId)) { CheckAndUpdateSessionStatus(); ISaveOrUpdateEventListener[] updateEventListener = listeners.UpdateEventListeners; @@ -2681,7 +2681,7 @@ public override int ExecuteNativeUpdate(NativeSQLQuerySpecification nativeQuerySpecification, QueryParameters queryParameters) { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionIdLoggingContext(SessionId)) { CheckAndUpdateSessionStatus(); queryParameters.ValidateParameters(); @@ -2706,7 +2706,7 @@ public override int ExecuteUpdate(string query, QueryParameters queryParameters) { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionIdLoggingContext(SessionId)) { CheckAndUpdateSessionStatus(); queryParameters.ValidateParameters(); @@ -2731,7 +2731,7 @@ public override IEntityPersister GetEntityPersister(string entityName, object obj) { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionIdLoggingContext(SessionId)) { CheckAndUpdateSessionStatus(); if (entityName == null) Modified: trunk/nhibernate/src/NHibernate/Impl/StatelessSessionImpl.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Impl/StatelessSessionImpl.cs 2009-05-18 21:56:51 UTC (rev 4342) +++ trunk/nhibernate/src/NHibernate/Impl/StatelessSessionImpl.cs 2009-05-18 22:20:04 UTC (rev 4343) @@ -34,7 +34,7 @@ internal StatelessSessionImpl(IDbConnection connection, SessionFactoryImpl factory) : base(factory) { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionIdLoggingContext(SessionId)) { temporaryPersistenceContext = new StatefulPersistenceContext(this); connectionManager = new ConnectionManager(this, connection, ConnectionReleaseMode.AfterTransaction, @@ -50,7 +50,7 @@ public override object InternalLoad(string entityName, object id, bool eager, bool isNullable) { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionIdLoggingContext(SessionId)) { CheckAndUpdateSessionStatus(); IEntityPersister persister = Factory.GetEntityPersister(entityName); @@ -89,7 +89,7 @@ public override IList List(string query, QueryParameters parameters) { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionIdLoggingContext(SessionId)) { // TODO pull up IList results = new ArrayList(); @@ -100,7 +100,7 @@ public override void List(string query, QueryParameters queryParameters, IList results) { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionIdLoggingContext(SessionId)) { CheckAndUpdateSessionStatus(); queryParameters.ValidateParameters(); @@ -130,7 +130,7 @@ public override IList<T> List<T>(string query, QueryParameters queryParameters) { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionIdLoggingContext(SessionId)) { // TODO pull up List<T> results = new List<T>(); @@ -141,7 +141,7 @@ public override IList<T> List<T>(CriteriaImpl criteria) { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionIdLoggingContext(SessionId)) { // TODO pull up List<T> results = new List<T>(); @@ -152,7 +152,7 @@ public override void List(CriteriaImpl criteria, IList results) { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionIdLoggingContext(SessionId)) { CheckAndUpdateSessionStatus(); string[] implementors = Factory.GetImplementors(criteria.EntityOrClassName); @@ -193,7 +193,7 @@ private IOuterJoinLoadable GetOuterJoinLoadable(string entityName) { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionIdLoggingContext(SessionId)) { // TODO pull up IEntityPersister persister = Factory.GetEntityPersister(entityName); @@ -207,7 +207,7 @@ public override IList List(CriteriaImpl criteria) { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionIdLoggingContext(SessionId)) { // TODO pull up ArrayList results = new ArrayList(); @@ -256,7 +256,7 @@ public override void AfterTransactionCompletion(bool successful, ITransaction tx) { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionIdLoggingContext(SessionId)) { connectionManager.AfterTransaction(); } @@ -270,7 +270,7 @@ public override object Instantiate(string clazz, object id) { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionIdLoggingContext(SessionId)) { CheckAndUpdateSessionStatus(); return Factory.GetEntityPersister(clazz).Instantiate(id, EntityMode.Poco); @@ -279,7 +279,7 @@ public override IList List(NativeSQLQuerySpecification spec, QueryParameters queryParameters) { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionIdLoggingContext(SessionId)) { // TODO pull up ArrayList results = new ArrayList(); @@ -290,7 +290,7 @@ public override void List(NativeSQLQuerySpecification spec, QueryParameters queryParameters, IList results) { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionIdLoggingContext(SessionId)) { // TODO pull up SQLCustomQuery query = new SQLCustomQuery( @@ -304,7 +304,7 @@ public override IList<T> List<T>(NativeSQLQuerySpecification spec, QueryParameters queryParameters) { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionIdLoggingContext(SessionId)) { // TODO pull up List<T> results = new List<T>(); @@ -315,7 +315,7 @@ public override void ListCustomQuery(ICustomQuery customQuery, QueryParameters queryParameters, IList results) { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionIdLoggingContext(SessionId)) { CheckAndUpdateSessionStatus(); @@ -337,7 +337,7 @@ public override IList<T> ListCustomQuery<T>(ICustomQuery customQuery, QueryParameters queryParameters) { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionIdLoggingContext(SessionId)) { // TODO pull up List<T> results = new List<T>(); @@ -363,7 +363,7 @@ public override IQueryTranslator[] GetQueries(string query, bool scalar) { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionIdLoggingContext(SessionId)) { // take the union of the query spaces (ie the queried tables) HQLQueryPlan plan = Factory.QueryPlanCache.GetHQLQueryPlan(query, scalar, EnabledFilters); @@ -425,7 +425,7 @@ public override string BestGuessEntityName(object entity) { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionIdLoggingContext(SessionId)) { INHibernateProxy proxy = entity as INHibernateProxy; if (proxy != null) @@ -449,7 +449,7 @@ public override void Flush() { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionIdLoggingContext(SessionId)) { ManagedFlush(); // NH Different behavior since ADOContext.Context is not implemented } @@ -457,7 +457,7 @@ public void ManagedFlush() { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionIdLoggingContext(SessionId)) { CheckAndUpdateSessionStatus(); Batcher.ExecuteBatch(); @@ -497,7 +497,7 @@ /// <summary> Close the stateless session and release the ADO.NET connection.</summary> public void Close() { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionIdLoggingContext(SessionId)) { ManagedClose(); } @@ -505,7 +505,7 @@ public void ManagedClose() { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionIdLoggingContext(SessionId)) { if (IsClosed) { @@ -521,7 +521,7 @@ /// <returns> the identifier of the instance </returns> public object Insert(object entity) { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionIdLoggingContext(SessionId)) { CheckAndUpdateSessionStatus(); return Insert(null, entity); @@ -534,7 +534,7 @@ /// <returns> the identifier of the instance </returns> public object Insert(string entityName, object entity) { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionIdLoggingContext(SessionId)) { CheckAndUpdateSessionStatus(); IEntityPersister persister = GetEntityPersister(entityName, entity); @@ -567,7 +567,7 @@ /// <param name="entity">a detached entity instance </param> public void Update(object entity) { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionIdLoggingContext(SessionId)) { CheckAndUpdateSessionStatus(); Update(null, entity); @@ -579,7 +579,7 @@ /// <param name="entity">a detached entity instance </param> public void Update(string entityName, object entity) { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionIdLoggingContext(SessionId)) { CheckAndUpdateSessionStatus(); IEntityPersister persister = GetEntityPersister(entityName, entity); @@ -605,7 +605,7 @@ /// <param name="entity">a detached entity instance </param> public void Delete(object entity) { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionIdLoggingContext(SessionId)) { CheckAndUpdateSessionStatus(); Delete(null, entity); @@ -617,7 +617,7 @@ /// <param name="entity">a detached entity instance </param> public void Delete(string entityName, object entity) { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionIdLoggingContext(SessionId)) { CheckAndUpdateSessionStatus(); IEntityPersister persister = GetEntityPersister(entityName, entity); @@ -631,7 +631,7 @@ /// <returns> a detached entity instance </returns> public object Get(string entityName, object id) { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionIdLoggingContext(SessionId)) { return Get(entityName, id, LockMode.None); } @@ -644,7 +644,7 @@ /// </returns> public T Get<T>(object id) { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionIdLoggingContext(SessionId)) { return (T)Get(typeof(T), id); } @@ -652,7 +652,7 @@ private object Get(System.Type persistentClass, object id) { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionIdLoggingContext(SessionId)) { return Get(persistentClass.FullName, id); } @@ -664,7 +664,7 @@ /// <returns> a detached entity instance </returns> public object Get(string entityName, object id, LockMode lockMode) { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionIdLoggingContext(SessionId)) { CheckAndUpdateSessionStatus(); object result = Factory.GetEntityPersister(entityName).Load(id, null, lockMode, this); @@ -679,7 +679,7 @@ /// <returns> a detached entity instance </returns> public T Get<T>(object id, LockMode lockMode) { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionIdLoggingContext(SessionId)) { return (T)Get(typeof(T).FullName, id, lockMode); } @@ -691,7 +691,7 @@ /// <param name="entity">The entity to be refreshed. </param> public void Refresh(object entity) { - using (new SessionIdLoggingContext(sessionId)) + using (new SessionId... [truncated message content] |
From: <aye...@us...> - 2009-10-18 01:06:13
|
Revision: 4770 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=4770&view=rev Author: ayenderahien Date: 2009-10-18 01:06:00 +0000 (Sun, 18 Oct 2009) Log Message: ----------- Making sure that child sessions share the same session id as their parent (allow correlation) Modified Paths: -------------- trunk/nhibernate/src/NHibernate/Impl/AbstractSessionImpl.cs trunk/nhibernate/src/NHibernate/Impl/SessionImpl.cs Modified: trunk/nhibernate/src/NHibernate/Impl/AbstractSessionImpl.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Impl/AbstractSessionImpl.cs 2009-10-17 23:44:14 UTC (rev 4769) +++ trunk/nhibernate/src/NHibernate/Impl/AbstractSessionImpl.cs 2009-10-18 01:06:00 UTC (rev 4770) @@ -50,6 +50,12 @@ this.factory = factory; } + protected internal AbstractSessionImpl(ISessionFactoryImplementor factory, Guid sessionId) + : this(factory) + { + this.sessionId = sessionId; + } + #region ISessionImplementor Members public void Initialize() Modified: trunk/nhibernate/src/NHibernate/Impl/SessionImpl.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Impl/SessionImpl.cs 2009-10-17 23:44:14 UTC (rev 4769) +++ trunk/nhibernate/src/NHibernate/Impl/SessionImpl.cs 2009-10-18 01:06:00 UTC (rev 4770) @@ -242,7 +242,7 @@ /// <param name="parent">The parent Session</param> /// <param name="entityMode">The entity mode</param> private SessionImpl(SessionImpl parent, EntityMode entityMode) - : base(parent.Factory) + : base(parent.Factory, parent.SessionId) { using (new SessionIdLoggingContext(SessionId)) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |