///
/// Abstracts ADO.NET batching to maintain the illusion that a single logical batch
/// exists for the whole session, even when batching is disabled.
- /// Provides transparent IDbCommand caching.
+ /// Provides transparent DbCommand caching.
///
///
/// This will be useful once ADO.NET gets support for batching. Until that point
@@ -25,14 +26,14 @@ namespace NHibernate.Engine
public interface IBatcher : IDisposable
{
///
- /// Get an for using in loading / querying.
+ /// Get an for using in loading / querying.
///
- /// The to convert to an .
+ /// The to convert to an .
/// The of the command.
/// The SqlTypes of parameters
/// in .
///
- /// An that is ready to be executed.
+ /// An that is ready to be executed.
///
///
///
@@ -40,53 +41,53 @@ public interface IBatcher : IDisposable
/// released when the session is closed or disconnected.
///
///
- /// This does NOT add anything to the batch - it only creates the IDbCommand and
+ /// This does NOT add anything to the batch - it only creates the DbCommand and
/// does NOT cause the batch to execute...
///
///
- IDbCommand PrepareQueryCommand(CommandType commandType, SqlString sql, SqlType[] parameterTypes);
+ DbCommand PrepareQueryCommand(CommandType commandType, SqlString sql, SqlType[] parameterTypes);
///
- /// Get a non-batchable an to use for inserting / deleting / updating.
+ /// Get a non-batchable an to use for inserting / deleting / updating.
/// Must be explicitly released by CloseCommand()
///
- /// The to convert to an .
+ /// The to convert to an .
/// The of the command.
/// The SqlTypes of parameters
/// in .
///
- /// An that is ready to have the parameter values set
+ /// An that is ready to have the parameter values set
/// and then executed.
///
- IDbCommand PrepareCommand(CommandType commandType, SqlString sql, SqlType[] parameterTypes);
+ DbCommand PrepareCommand(CommandType commandType, SqlString sql, SqlType[] parameterTypes);
///
- /// Close a opened using PrepareCommand()
+ /// Close a opened using PrepareCommand()
///
- /// The to ensure is closed.
- /// The to ensure is closed.
- void CloseCommand(IDbCommand cmd, IDataReader reader);
+ /// The to ensure is closed.
+ /// The to ensure is closed.
+ void CloseCommand(DbCommand cmd, DbDataReader reader);
///
- /// Close a opened using
+ /// Close a opened using
///
- /// The to ensure is closed.
- void CloseReader(IDataReader reader);
+ /// The to ensure is closed.
+ void CloseReader(DbDataReader reader);
///
- /// Get a batchable to use for inserting / deleting / updating
+ /// Get a batchable to use for inserting / deleting / updating
/// (might be called many times before a single call to ExecuteBatch()
///
///
/// After setting parameters, call AddToBatch() - do not execute the statement
/// explicitly.
///
- /// The to convert to an .
+ /// The to convert to an .
/// The of the command.
/// The SqlTypes of parameters
/// in .
///
- IDbCommand PrepareBatchCommand(CommandType commandType, SqlString sql, SqlType[] parameterTypes);
+ DbCommand PrepareBatchCommand(CommandType commandType, SqlString sql, SqlType[] parameterTypes);
///
/// Add an insert / delete / update to the current batch (might be called multiple times
@@ -110,26 +111,26 @@ public interface IBatcher : IDisposable
void CloseCommands();
///
- /// Gets an by calling ExecuteReader on the .
+ /// Gets an by calling ExecuteReader on the .
///
- /// The to execute to get the .
- /// The from the .
+ /// The to execute to get the .
+ /// The from the .
///
/// The Batcher is responsible for ensuring that all of the Drivers rules for how many open
- /// s it can have are followed.
+ /// s it can have are followed.
///
- IDataReader ExecuteReader(IDbCommand cmd);
+ DbDataReader ExecuteReader(DbCommand cmd);
///
- /// Executes the .
+ /// Executes the .
///
- /// The to execute.
+ /// The to execute.
/// The number of rows affected.
///
/// The Batcher is responsible for ensuring that all of the Drivers rules for how many open
- /// s it can have are followed.
+ /// s it can have are followed.
///
- int ExecuteNonQuery(IDbCommand cmd);
+ int ExecuteNonQuery(DbCommand cmd);
///
/// Must be called when an exception occurs.
@@ -144,7 +145,7 @@ public interface IBatcher : IDisposable
///
/// Gets the value indicating whether there are any open resources
- /// managed by this batcher (IDbCommands or IDataReaders).
+ /// managed by this batcher (DbCommands or DbDataReaders).
///
bool HasOpenResources { get; }
diff --git a/src/NHibernate/Engine/ISessionFactoryImplementor.cs b/src/NHibernate/Engine/ISessionFactoryImplementor.cs
index 232405a05aa..2bc91bf1329 100644
--- a/src/NHibernate/Engine/ISessionFactoryImplementor.cs
+++ b/src/NHibernate/Engine/ISessionFactoryImplementor.cs
@@ -1,5 +1,5 @@
using System.Collections.Generic;
-using System.Data;
+using System.Data.Common;
using NHibernate.Cache;
using NHibernate.Cfg;
using NHibernate.Connection;
@@ -147,7 +147,7 @@ public interface ISessionFactoryImplementor : IMapping, ISessionFactory
///
/// The release mode for managed jdbc connections.
/// An appropriate session.
- ISession OpenSession(IDbConnection connection, bool flushBeforeCompletionEnabled, bool autoCloseSessionEnabled,
+ ISession OpenSession(DbConnection connection, bool flushBeforeCompletionEnabled, bool autoCloseSessionEnabled,
ConnectionReleaseMode connectionReleaseMode);
///
diff --git a/src/NHibernate/Engine/ISessionImplementor.cs b/src/NHibernate/Engine/ISessionImplementor.cs
index 8d64edf61e6..bc31bf37ff7 100644
--- a/src/NHibernate/Engine/ISessionImplementor.cs
+++ b/src/NHibernate/Engine/ISessionImplementor.cs
@@ -1,7 +1,7 @@
using System;
using System.Collections;
using System.Collections.Generic;
-using System.Data;
+using System.Data.Common;
using NHibernate.AdoNet;
using NHibernate.Cache;
using NHibernate.Collection;
@@ -293,7 +293,7 @@ public interface ISessionImplementor
/// The guessed entity name for an entity not in an association
string GuessEntityName(object entity);
- IDbConnection Connection { get; }
+ DbConnection Connection { get; }
IQuery GetNamedQuery(string queryName);
diff --git a/src/NHibernate/Engine/Loading/CollectionLoadContext.cs b/src/NHibernate/Engine/Loading/CollectionLoadContext.cs
index 78cafbb89e6..8d4738311e4 100644
--- a/src/NHibernate/Engine/Loading/CollectionLoadContext.cs
+++ b/src/NHibernate/Engine/Loading/CollectionLoadContext.cs
@@ -1,6 +1,6 @@
using System.Collections;
using System.Collections.Generic;
-using System.Data;
+using System.Data.Common;
using System.Diagnostics;
using NHibernate.Cache;
@@ -12,18 +12,18 @@
namespace NHibernate.Engine.Loading
{
///
- /// Represents state associated with the processing of a given
+ /// Represents state associated with the processing of a given
/// in regards to loading collections.
///
///
- /// Another implementation option to consider is to not expose ResultSets
+ /// Another implementation option to consider is to not expose ResultSets
/// directly (in the JDBC redesign) but to always "wrap" them and apply a [series of] context[s] to that wrapper.
///
public class CollectionLoadContext
{
private static readonly IInternalLogger log = LoggerProvider.LoggerFor(typeof(CollectionLoadContext));
private readonly LoadContexts loadContexts;
- private readonly IDataReader resultSet;
+ private readonly DbDataReader resultSet;
private readonly ISet localLoadingCollectionKeys = new HashSet();
///
@@ -31,7 +31,7 @@ public class CollectionLoadContext
///
/// Callback to other collection load contexts.
/// The result set this is "wrapping".
- public CollectionLoadContext(LoadContexts loadContexts, IDataReader resultSet)
+ public CollectionLoadContext(LoadContexts loadContexts, DbDataReader resultSet)
{
this.loadContexts = loadContexts;
this.resultSet = resultSet;
@@ -42,7 +42,7 @@ public LoadContexts LoadContext
get { return loadContexts; }
}
- public IDataReader ResultSet
+ public DbDataReader ResultSet
{
get { return resultSet; }
}
diff --git a/src/NHibernate/Engine/Loading/LoadContexts.cs b/src/NHibernate/Engine/Loading/LoadContexts.cs
index f7a98131448..da771380eeb 100644
--- a/src/NHibernate/Engine/Loading/LoadContexts.cs
+++ b/src/NHibernate/Engine/Loading/LoadContexts.cs
@@ -1,7 +1,7 @@
using System;
using System.Collections;
using System.Collections.Generic;
-using System.Data;
+using System.Data.Common;
using NHibernate.Collection;
using NHibernate.Impl;
@@ -11,13 +11,13 @@
namespace NHibernate.Engine.Loading
{
///
- /// Maps to specific contextual data
- /// related to processing that .
+ /// Maps to specific contextual data
+ /// related to processing that .
///
///
/// Implementation note: internally an is used to maintain
/// the mappings; was chosen because I'd rather not be
- /// dependent upon potentially bad and
+ /// dependent upon potentially bad and
/// implementations.
/// Considering the JDBC-redesign work, would further like this contextual info
/// not mapped separately, but available based on the result set being processed.
@@ -67,7 +67,7 @@ internal IDictionary LoadingCollectionXRe
/// This should be called when we are done with processing said result set,
/// ideally as the result set is being closed.
///
- public virtual void Cleanup(IDataReader resultSet)
+ public virtual void Cleanup(DbDataReader resultSet)
{
if (collectionLoadContexts != null)
{
@@ -121,7 +121,7 @@ public bool HasRegisteredLoadingCollectionEntries
///
/// The result set for which to retrieve the context.
/// The processing context.
- public CollectionLoadContext GetCollectionLoadContext(IDataReader resultSet)
+ public CollectionLoadContext GetCollectionLoadContext(DbDataReader resultSet)
{
CollectionLoadContext context = null;
if (collectionLoadContexts == null)
diff --git a/src/NHibernate/Engine/Loading/LoadingCollectionEntry.cs b/src/NHibernate/Engine/Loading/LoadingCollectionEntry.cs
index 8edb201edf9..992abf1ae5e 100644
--- a/src/NHibernate/Engine/Loading/LoadingCollectionEntry.cs
+++ b/src/NHibernate/Engine/Loading/LoadingCollectionEntry.cs
@@ -1,5 +1,5 @@
using System;
-using System.Data;
+using System.Data.Common;
using NHibernate.Collection;
using NHibernate.Impl;
using NHibernate.Persister.Collection;
@@ -11,12 +11,12 @@ namespace NHibernate.Engine.Loading
///
public class LoadingCollectionEntry
{
- private readonly IDataReader resultSet;
+ private readonly DbDataReader resultSet;
private readonly ICollectionPersister persister;
private readonly object key;
private readonly IPersistentCollection collection;
- public LoadingCollectionEntry(IDataReader resultSet, ICollectionPersister persister, object key, IPersistentCollection collection)
+ public LoadingCollectionEntry(DbDataReader resultSet, ICollectionPersister persister, object key, IPersistentCollection collection)
{
this.resultSet = resultSet;
this.persister = persister;
@@ -24,7 +24,7 @@ public LoadingCollectionEntry(IDataReader resultSet, ICollectionPersister persis
this.collection = collection;
}
- public IDataReader ResultSet
+ public DbDataReader ResultSet
{
get { return resultSet; }
}
diff --git a/src/NHibernate/Engine/Query/NativeSQLQueryPlan.cs b/src/NHibernate/Engine/Query/NativeSQLQueryPlan.cs
index 93f3829c802..87d0c8ed1b4 100644
--- a/src/NHibernate/Engine/Query/NativeSQLQueryPlan.cs
+++ b/src/NHibernate/Engine/Query/NativeSQLQueryPlan.cs
@@ -2,6 +2,7 @@
using System.Collections;
using System.Collections.Generic;
using System.Data;
+using System.Data.Common;
using System.Linq;
using NHibernate.Action;
using NHibernate.Engine.Query.Sql;
@@ -78,7 +79,7 @@ public int PerformExecuteUpdate(QueryParameters queryParameters, ISessionImpleme
var sqlParametersList = sql.GetParameters().ToList();
SqlType[] sqlTypes = parametersSpecifications.GetQueryParameterTypes(sqlParametersList, session.Factory);
- IDbCommand ps = session.Batcher.PrepareCommand(CommandType.Text, sql, sqlTypes);
+ var ps = session.Batcher.PrepareCommand(CommandType.Text, sql, sqlTypes);
try
{
diff --git a/src/NHibernate/Engine/RowSelection.cs b/src/NHibernate/Engine/RowSelection.cs
index 334965d064d..2602a83505b 100644
--- a/src/NHibernate/Engine/RowSelection.cs
+++ b/src/NHibernate/Engine/RowSelection.cs
@@ -3,8 +3,8 @@
namespace NHibernate.Engine
{
///
- /// Information to determine how to run an IDbCommand and what
- /// records to return from the IDataReader.
+ /// Information to determine how to run an DbCommand and what
+ /// records to return from the DbDataReader.
///
[Serializable]
public sealed class RowSelection
diff --git a/src/NHibernate/Engine/Transaction/IIsolatedWork.cs b/src/NHibernate/Engine/Transaction/IIsolatedWork.cs
index bbe88e95309..5352989925a 100644
--- a/src/NHibernate/Engine/Transaction/IIsolatedWork.cs
+++ b/src/NHibernate/Engine/Transaction/IIsolatedWork.cs
@@ -1,4 +1,4 @@
-using System.Data;
+using System.Data.Common;
namespace NHibernate.Engine.Transaction
{
@@ -14,6 +14,6 @@ public interface IIsolatedWork
///
/// The ADP connection to use.
/// The active transaction of the connection.
- void DoWork(IDbConnection connection, IDbTransaction transaction);
+ void DoWork(DbConnection connection, DbTransaction transaction);
}
}
\ No newline at end of file
diff --git a/src/NHibernate/Engine/Transaction/Isolater.cs b/src/NHibernate/Engine/Transaction/Isolater.cs
index 5c3ec37ec33..5f4ca98cb2f 100644
--- a/src/NHibernate/Engine/Transaction/Isolater.cs
+++ b/src/NHibernate/Engine/Transaction/Isolater.cs
@@ -1,5 +1,4 @@
using System;
-using System.Data;
using System.Data.Common;
using NHibernate.Dialect;
diff --git a/src/NHibernate/Engine/TransactionHelper.cs b/src/NHibernate/Engine/TransactionHelper.cs
index b2922ba5abb..e8f8f9fa986 100644
--- a/src/NHibernate/Engine/TransactionHelper.cs
+++ b/src/NHibernate/Engine/TransactionHelper.cs
@@ -1,4 +1,3 @@
-using System.Data;
using System.Data.Common;
using NHibernate.Engine.Transaction;
using NHibernate.Exceptions;
@@ -25,7 +24,7 @@ public Work(ISessionImplementor session, TransactionHelper owner)
#region Implementation of IIsolatedWork
- public void DoWork(IDbConnection connection, IDbTransaction transaction)
+ public void DoWork(DbConnection connection, DbTransaction transaction)
{
try
{
@@ -41,7 +40,7 @@ public void DoWork(IDbConnection connection, IDbTransaction transaction)
}
/// The work to be done
- public abstract object DoWorkInCurrentTransaction(ISessionImplementor session, IDbConnection conn, IDbTransaction transaction);
+ public abstract object DoWorkInCurrentTransaction(ISessionImplementor session, DbConnection conn, DbTransaction transaction);
/// Suspend the current transaction and perform work in a new transaction
public virtual object DoWorkInNewTransaction(ISessionImplementor session)
diff --git a/src/NHibernate/Hql/Ast/ANTLR/Exec/AbstractStatementExecutor.cs b/src/NHibernate/Hql/Ast/ANTLR/Exec/AbstractStatementExecutor.cs
index cf40408aa81..94a396d0e4e 100644
--- a/src/NHibernate/Hql/Ast/ANTLR/Exec/AbstractStatementExecutor.cs
+++ b/src/NHibernate/Hql/Ast/ANTLR/Exec/AbstractStatementExecutor.cs
@@ -1,5 +1,5 @@
using System;
-using System.Data;
+using System.Data.Common;
using Antlr.Runtime;
using Antlr.Runtime.Tree;
using NHibernate.Action;
@@ -13,6 +13,7 @@
using NHibernate.SqlTypes;
using NHibernate.Transaction;
using NHibernate.Util;
+using System.Data;
namespace NHibernate.Hql.Ast.ANTLR.Exec
{
@@ -192,7 +193,7 @@ protected virtual void DropTemporaryTableIfNecessary(IQueryable persister, ISess
else
{
// at the very least cleanup the data :)
- IDbCommand ps = null;
+ DbCommand ps = null;
try
{
var commandText = new SqlString("delete from " + persister.TemporaryIdTableName);
@@ -233,9 +234,9 @@ public TmpIdTableCreationIsolatedWork(IQueryable persister, IInternalLogger log,
this.session = session;
}
- public void DoWork(IDbConnection connection, IDbTransaction transaction)
+ public void DoWork(DbConnection connection, DbTransaction transaction)
{
- IDbCommand stmnt = null;
+ DbCommand stmnt = null;
try
{
stmnt = connection.CreateCommand();
@@ -278,9 +279,9 @@ public TmpIdTableDropIsolatedWork(IQueryable persister, IInternalLogger log, ISe
private readonly IInternalLogger log;
private readonly ISessionImplementor session;
- public void DoWork(IDbConnection connection, IDbTransaction transaction)
+ public void DoWork(DbConnection connection, DbTransaction transaction)
{
- IDbCommand stmnt = null;
+ DbCommand stmnt = null;
try
{
stmnt = connection.CreateCommand();
diff --git a/src/NHibernate/Hql/Ast/ANTLR/Exec/BasicExecutor.cs b/src/NHibernate/Hql/Ast/ANTLR/Exec/BasicExecutor.cs
index e0b5e130ddb..92de0ee3a3d 100644
--- a/src/NHibernate/Hql/Ast/ANTLR/Exec/BasicExecutor.cs
+++ b/src/NHibernate/Hql/Ast/ANTLR/Exec/BasicExecutor.cs
@@ -52,7 +52,7 @@ public override int Execute(QueryParameters parameters, ISessionImplementor sess
{
CoordinateSharedCacheCleanup(session);
- IDbCommand st = null;
+ DbCommand st = null;
RowSelection selection = parameters.RowSelection;
try
diff --git a/src/NHibernate/Hql/Ast/ANTLR/Exec/MultiTableDeleteExecutor.cs b/src/NHibernate/Hql/Ast/ANTLR/Exec/MultiTableDeleteExecutor.cs
index 39cd128f9e3..22ce6eb59b6 100644
--- a/src/NHibernate/Hql/Ast/ANTLR/Exec/MultiTableDeleteExecutor.cs
+++ b/src/NHibernate/Hql/Ast/ANTLR/Exec/MultiTableDeleteExecutor.cs
@@ -75,7 +75,7 @@ public override int Execute(QueryParameters parameters, ISessionImplementor sess
try
{
// First, save off the pertinent ids, saving the number of pertinent ids for return
- IDbCommand ps = null;
+ DbCommand ps = null;
int resultCount;
try
{
diff --git a/src/NHibernate/Hql/Ast/ANTLR/Exec/MultiTableUpdateExecutor.cs b/src/NHibernate/Hql/Ast/ANTLR/Exec/MultiTableUpdateExecutor.cs
index 11db5b5970e..866105b3362 100644
--- a/src/NHibernate/Hql/Ast/ANTLR/Exec/MultiTableUpdateExecutor.cs
+++ b/src/NHibernate/Hql/Ast/ANTLR/Exec/MultiTableUpdateExecutor.cs
@@ -97,7 +97,7 @@ public override int Execute(QueryParameters parameters, ISessionImplementor sess
try
{
// First, save off the pertinent ids, as the return value
- IDbCommand ps = null;
+ DbCommand ps = null;
int resultCount;
try
{
diff --git a/src/NHibernate/IInterceptor.cs b/src/NHibernate/IInterceptor.cs
index 07bb60c0265..26f6969427d 100644
--- a/src/NHibernate/IInterceptor.cs
+++ b/src/NHibernate/IInterceptor.cs
@@ -1,5 +1,5 @@
using System.Collections;
-using System.Data;
+using System.Data.Common;
using NHibernate.SqlCommand;
using NHibernate.Type;
@@ -195,7 +195,7 @@ int[] FindDirty(object entity, object id, object[] currentState, object[] previo
/// The use of singleton-interceptor may cause problems in multi-thread scenario.
///
///