Author: gbayon
Date: Tue Feb 28 11:33:57 2006
New Revision: 381756
URL: http://svn.apache.org/viewcvs?rev=381756&view=rev
Log:
- Cleaning
Modified:
ibatis/trunk/cs/mapper/IBatisNet.Common/DbProvider.cs
ibatis/trunk/cs/mapper/IBatisNet.DataAccess/DaoSessionHandlers/SimpleDaoSession.cs
ibatis/trunk/cs/mapper/IBatisNet.DataMapper/SqlMapSession.cs
Modified: ibatis/trunk/cs/mapper/IBatisNet.Common/DbProvider.cs
URL:
http://svn.apache.org/viewcvs/ibatis/trunk/cs/mapper/IBatisNet.Common/DbProvider.cs?rev=381756&r1=381755&r2=381756&view=diff
==============================================================================
--- ibatis/trunk/cs/mapper/IBatisNet.Common/DbProvider.cs (original)
+++ ibatis/trunk/cs/mapper/IBatisNet.Common/DbProvider.cs Tue Feb 28 11:33:57
2006
@@ -2,7 +2,7 @@
#region Apache Notice
/*****************************************************************************
* $Header: $
- * $Revision: $
+ * $Revision$
* $Date$
*
* iBATIS.NET Data Mapper
@@ -75,8 +75,6 @@
[NonSerialized]
private IDbConnection _templateConnection = null;
[NonSerialized]
- private IDbCommand _templateCommand= null;
- [NonSerialized]
private IDbDataAdapter _templateDataAdapter= null;
[NonSerialized]
private Type _commandBuilderType = null;
@@ -91,8 +89,6 @@
[NonSerialized]
private bool _templateConnectionIsICloneable = false;
[NonSerialized]
- private bool _templateCommandIsICloneable = false;
- [NonSerialized]
private bool _templateDataAdapterIsICloneable = false;
[NonSerialized]
private bool _setDbParameterSize = true;
@@ -456,11 +452,6 @@
{
assembly = Assembly.Load(_assemblyName);
- // Build the Command template
- type = assembly.GetType(_commandClass, true);
- CheckPropertyType("DbCommandClass",
typeof(IDbCommand), type);
- _templateCommand =
(IDbCommand)type.GetConstructor(Type.EmptyTypes).Invoke(null);
-
// Build the DataAdapter template
type = assembly.GetType(_dataAdapterClass,
true);
CheckPropertyType("DataAdapterClass",
typeof(IDbDataAdapter), type);
@@ -483,7 +474,6 @@
}
_templateConnectionIsICloneable =
_templateConnection is ICloneable;
- _templateCommandIsICloneable = _templateCommand
is ICloneable;
_templateDataAdapterIsICloneable =
_templateDataAdapter is ICloneable;
}
catch(Exception e)
@@ -524,14 +514,7 @@
/// <returns>An 'IDbCommand' object.</returns>
public IDbCommand CreateCommand()
{
- if (_templateCommandIsICloneable)
- {
- return (IDbCommand)
((ICloneable)_templateCommand).Clone();
- }
- else
- {
- return (IDbCommand)
Activator.CreateInstance(_templateCommand.GetType());
- }
+ return _templateConnection.CreateCommand();
}
/// <summary>
@@ -556,7 +539,7 @@
/// <returns>An 'IDbDataParameter' object.</returns>
public IDbDataParameter CreateDataParameter()
{
- return _templateCommand.CreateParameter();
+ return _templateConnection.CreateCommand().CreateParameter();
}
/// <summary>
Modified:
ibatis/trunk/cs/mapper/IBatisNet.DataAccess/DaoSessionHandlers/SimpleDaoSession.cs
URL:
http://svn.apache.org/viewcvs/ibatis/trunk/cs/mapper/IBatisNet.DataAccess/DaoSessionHandlers/SimpleDaoSession.cs?rev=381756&r1=381755&r2=381756&view=diff
==============================================================================
---
ibatis/trunk/cs/mapper/IBatisNet.DataAccess/DaoSessionHandlers/SimpleDaoSession.cs
(original)
+++
ibatis/trunk/cs/mapper/IBatisNet.DataAccess/DaoSessionHandlers/SimpleDaoSession.cs
Tue Feb 28 11:33:57 2006
@@ -403,7 +403,7 @@
{
IDbCommand command = null;
- command = _connection.CreateCommand();
+ command = _dataSource.DbProvider.CreateCommand();
command.CommandType = commandType;
command.Connection = _connection;
Modified: ibatis/trunk/cs/mapper/IBatisNet.DataMapper/SqlMapSession.cs
URL:
http://svn.apache.org/viewcvs/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/SqlMapSession.cs?rev=381756&r1=381755&r2=381756&view=diff
==============================================================================
--- ibatis/trunk/cs/mapper/IBatisNet.DataMapper/SqlMapSession.cs (original)
+++ ibatis/trunk/cs/mapper/IBatisNet.DataMapper/SqlMapSession.cs Tue Feb 28
11:33:57 2006
@@ -2,7 +2,7 @@
#region Apache Notice
/*****************************************************************************
* $Header: $
- * $Revision: $
+ * $Revision$
* $Date$
*
* iBATIS.NET Data Mapper
@@ -417,17 +417,8 @@
/// <returns></returns>
public IDbCommand CreateCommand(CommandType commandType)
{
- IDbCommand command = null;
+ IDbCommand command =
_dataSource.DbProvider.CreateCommand();
- if (_connection!=null)
- {
- command = _connection.CreateCommand();
- }
- else
- {
- command =
_dataSource.DbProvider.CreateCommand();
- }
-
command.CommandType = commandType;
command.Connection = _connection;