From: <aye...@us...> - 2009-10-17 23:34:40
|
Revision: 4768 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=4768&view=rev Author: ayenderahien Date: 2009-10-17 23:34:20 +0000 (Sat, 17 Oct 2009) Log Message: ----------- Adding current session id for actions that are performed outside of the session but belong the the session. Modified Paths: -------------- trunk/nhibernate/src/NHibernate/Id/Insert/AbstractSelectingDelegate.cs trunk/nhibernate/src/NHibernate/Persister/Collection/AbstractCollectionPersister.cs trunk/nhibernate/src/NHibernate/Persister/Entity/AbstractEntityPersister.cs trunk/nhibernate/src/NHibernate/Type/DbTimestampType.cs Property Changed: ---------------- trunk/ Property changes on: trunk ___________________________________________________________________ Modified: svn:mergeinfo - /branches/2.1.x:4505-4508 + /branches/2.1.x:4505-4508,4510-4513,4537-4538 Modified: trunk/nhibernate/src/NHibernate/Id/Insert/AbstractSelectingDelegate.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Id/Insert/AbstractSelectingDelegate.cs 2009-10-16 20:21:57 UTC (rev 4767) +++ trunk/nhibernate/src/NHibernate/Id/Insert/AbstractSelectingDelegate.cs 2009-10-17 23:34:20 UTC (rev 4768) @@ -2,6 +2,7 @@ using System.Data.Common; using NHibernate.Engine; using NHibernate.Exceptions; +using NHibernate.Impl; using NHibernate.SqlCommand; using NHibernate.SqlTypes; @@ -48,6 +49,7 @@ } SqlString selectSQL = SelectSQL; + using (new SessionIdLoggingContext(session.SessionId)) try { //fetch the generated id in a separate query Modified: trunk/nhibernate/src/NHibernate/Persister/Collection/AbstractCollectionPersister.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Persister/Collection/AbstractCollectionPersister.cs 2009-10-16 20:21:57 UTC (rev 4767) +++ trunk/nhibernate/src/NHibernate/Persister/Collection/AbstractCollectionPersister.cs 2009-10-17 23:34:20 UTC (rev 4768) @@ -1504,6 +1504,7 @@ public int GetSize(object key, ISessionImplementor session) { + using(new SessionIdLoggingContext(session.SessionId)) try { IDbCommand st = session.Batcher.PrepareCommand(CommandType.Text, sqlSelectSizeString, KeyType.SqlTypes(factory)); @@ -1540,6 +1541,7 @@ private bool Exists(object key, object indexOrElement, IType indexOrElementType, SqlString sql, ISessionImplementor session) { + using(new SessionIdLoggingContext(session.SessionId)) try { List<SqlType> sqlTl = new List<SqlType>(KeyType.SqlTypes(factory)); @@ -1579,6 +1581,7 @@ public virtual object GetElementByIndex(object key, object index, ISessionImplementor session, object owner) { + using(new SessionIdLoggingContext(session.SessionId)) try { List<SqlType> sqlTl = new List<SqlType>(KeyType.SqlTypes(factory)); Modified: trunk/nhibernate/src/NHibernate/Persister/Entity/AbstractEntityPersister.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Persister/Entity/AbstractEntityPersister.cs 2009-10-16 20:21:57 UTC (rev 4767) +++ trunk/nhibernate/src/NHibernate/Persister/Entity/AbstractEntityPersister.cs 2009-10-17 23:34:20 UTC (rev 4768) @@ -1230,6 +1230,7 @@ log.Debug("initializing lazy properties from datastore"); + using (new SessionIdLoggingContext(session.SessionId)) try { object result = null; @@ -1406,6 +1407,7 @@ log.Debug("Getting current persistent state for: " + MessageHelper.InfoString(this, id, Factory)); } + using (new SessionIdLoggingContext(session.SessionId)) try { IDbCommand st = session.Batcher.PrepareCommand(CommandType.Text, SQLSnapshotSelectString, IdentifierType.SqlTypes(factory)); @@ -1661,7 +1663,7 @@ { log.Debug("Getting version: " + MessageHelper.InfoString(this, id, Factory)); } - + using(new SessionIdLoggingContext(session.SessionId)) try { IDbCommand st = session.Batcher.PrepareQueryCommand(CommandType.Text, VersionSelectString, IdentifierType.SqlTypes(Factory)); @@ -2415,6 +2417,7 @@ IDbCommand sequentialSelect = null; IDataReader sequentialResultSet = null; bool sequentialSelectEmpty = false; + using (new SessionIdLoggingContext(session.SessionId)) try { if (hasDeferred) @@ -3917,6 +3920,7 @@ { session.Batcher.ExecuteBatch(); //force immediate execution of the insert + using (new SessionIdLoggingContext(session.SessionId)) try { IDbCommand cmd = @@ -4007,6 +4011,7 @@ /////////////////////////////////////////////////////////////////////// object[] snapshot = new object[naturalIdPropertyCount]; + using (new SessionIdLoggingContext(session.SessionId)) try { IDbCommand ps = session.Batcher.PrepareCommand(CommandType.Text, sql, IdentifierType.SqlTypes(factory)); Modified: trunk/nhibernate/src/NHibernate/Type/DbTimestampType.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Type/DbTimestampType.cs 2009-10-16 20:21:57 UTC (rev 4767) +++ trunk/nhibernate/src/NHibernate/Type/DbTimestampType.cs 2009-10-17 23:34:20 UTC (rev 4768) @@ -4,6 +4,7 @@ using log4net; using NHibernate.Engine; using NHibernate.Exceptions; +using NHibernate.Impl; using NHibernate.SqlCommand; using NHibernate.SqlTypes; @@ -58,6 +59,7 @@ var tsSelect = new SqlString(timestampSelectString); IDbCommand ps = null; IDataReader rs = null; + using (new SessionIdLoggingContext(session.SessionId)) try { ps = session.Batcher.PrepareCommand(CommandType.Text, tsSelect, EmptyParams); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |