You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ibatis.apache.org by gb...@apache.org on 2006/04/08 13:38:51 UTC

svn commit: r392508 - in /ibatis/trunk/cs/mapper: IBatisNet.Common/Utilities/ IBatisNet.DataMapper.Test/bin/Debug/ IBatisNet.DataMapper/ IBatisNet.DataMapper/Configuration/Sql/Static/ IBatisNet.DataMapper/Configuration/Statements/

Author: gbayon
Date: Sat Apr  8 04:38:47 2006
New Revision: 392508

URL: http://svn.apache.org/viewcvs?rev=392508&view=rev
Log:
- Fixed IBATISNET-151 Pre-load stored procedure parameters should use the already-open connection
- Updated provider.config with last MySQL driver version

Modified:
    ibatis/trunk/cs/mapper/IBatisNet.Common/Utilities/DBHelperParameterCache.cs
    ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/bin/Debug/IBatisNet.DataMapper.Test.dll.config
    ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/bin/Debug/providers.config
    ibatis/trunk/cs/mapper/IBatisNet.DataMapper/ChangeLog.txt
    ibatis/trunk/cs/mapper/IBatisNet.DataMapper/Configuration/Sql/Static/ProcedureSql.cs
    ibatis/trunk/cs/mapper/IBatisNet.DataMapper/Configuration/Statements/PreparedStatementFactory.cs

Modified: ibatis/trunk/cs/mapper/IBatisNet.Common/Utilities/DBHelperParameterCache.cs
URL: http://svn.apache.org/viewcvs/ibatis/trunk/cs/mapper/IBatisNet.Common/Utilities/DBHelperParameterCache.cs?rev=392508&r1=392507&r2=392508&view=diff
==============================================================================
--- ibatis/trunk/cs/mapper/IBatisNet.Common/Utilities/DBHelperParameterCache.cs (original)
+++ ibatis/trunk/cs/mapper/IBatisNet.Common/Utilities/DBHelperParameterCache.cs Sat Apr  8 04:38:47 2006
@@ -52,18 +52,13 @@
 		/// <summary>
 		/// Resolve at run time the appropriate set of Parameters for a stored procedure
 		/// </summary>
-		/// <param name="dataSource">a valid dataSource</param>
+		/// <param name="session">An IDalSession object</param>
 		/// <param name="spName">the name of the stored procedure</param>
 		/// <param name="includeReturnValueParameter">whether or not to include their return value parameter</param>
 		/// <returns></returns>
-		private static IDataParameter[] DiscoverSpParameterSet(IDataSource dataSource, string spName, bool includeReturnValueParameter)
+		private static IDataParameter[] DiscoverSpParameterSet(IDalSession session, string spName, bool includeReturnValueParameter)
 		{
-			using (IDbConnection connection = dataSource.DbProvider.CreateConnection())
-			{
-				connection.ConnectionString = dataSource.ConnectionString;
-				connection.Open();
-				return InternalDiscoverSpParameterSet(dataSource.DbProvider, connection, spName, includeReturnValueParameter);
-			}		
+			return InternalDiscoverSpParameterSet(session.DataSource.DbProvider, session.Connection, spName, includeReturnValueParameter);	
 		}
 
 		/// <summary>
@@ -206,12 +201,12 @@
 		/// <remarks>
 		/// This method will query the database for this information, and then store it in a cache for future requests.
 		/// </remarks>
-		/// <param name="dataSource">a valid dataSource</param>
+		/// <param name="session">a valid session</param>
 		/// <param name="spName">the name of the stored procedure</param>
 		/// <returns>an array of IDataParameters</returns>
-		public static IDataParameter[] GetSpParameterSet(IDataSource dataSource, string spName)
+		public static IDataParameter[] GetSpParameterSet(IDalSession session, string spName)
 		{
-			return GetSpParameterSet(dataSource, spName, false);
+			return GetSpParameterSet(session, spName, false);
 		}
 
 		/// <summary>
@@ -220,14 +215,14 @@
 		/// <remarks>
 		/// This method will query the database for this information, and then store it in a cache for future requests.
 		/// </remarks>
-		/// <param name="dataSource">a valid dataSource</param>
+		/// <param name="session">a valid session</param>
 		/// <param name="spName">the name of the stored procedure</param>
 		/// <param name="includeReturnValueParameter">a bool value indicating whether the return value parameter should be included in the results</param>
 		/// <returns>an array of IDataParameters</returns>
-		public static IDataParameter[] GetSpParameterSet(IDataSource dataSource
-			, string spName, bool includeReturnValueParameter)
+		public static IDataParameter[] GetSpParameterSet(IDalSession session, 
+			string spName, bool includeReturnValueParameter)
 		{
-			string hashKey = dataSource.ConnectionString + ":" + spName + (includeReturnValueParameter ? ":include ReturnValue Parameter":"");
+			string hashKey = session.DataSource.ConnectionString + ":" + spName + (includeReturnValueParameter ? ":include ReturnValue Parameter":"");
 
 			IDataParameter[] cachedParameters;
 			
@@ -235,7 +230,7 @@
 
 			if (cachedParameters == null)
 			{
-				_paramCache[hashKey] = DiscoverSpParameterSet(dataSource, spName, includeReturnValueParameter);
+				_paramCache[hashKey] = DiscoverSpParameterSet(session, spName, includeReturnValueParameter);
 				cachedParameters = (IDataParameter[]) _paramCache[hashKey];
 			}
 			

Modified: ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/bin/Debug/IBatisNet.DataMapper.Test.dll.config
URL: http://svn.apache.org/viewcvs/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/bin/Debug/IBatisNet.DataMapper.Test.dll.config?rev=392508&r1=392507&r2=392508&view=diff
==============================================================================
--- ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/bin/Debug/IBatisNet.DataMapper.Test.dll.config (original)
+++ ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/bin/Debug/IBatisNet.DataMapper.Test.dll.config Sat Apr  8 04:38:47 2006
@@ -37,13 +37,13 @@
 				<arg key="dateTimeFormat" value="yyyy/MM/dd HH:mm:ss:SSS" />
 			</logFactoryAdapter>	-->
 
-      <logFactoryAdapter type="IBatisNet.Common.Logging.Impl.Log4NetLoggerFA, IBatisNet.Common.Logging.Log4Net">
+<!--       <logFactoryAdapter type="IBatisNet.Common.Logging.Impl.Log4NetLoggerFA, IBatisNet.Common.Logging.Log4Net">
         <arg key="configType" value="inline" />
       </logFactoryAdapter>
-
+-->
+      
+     <logFactoryAdapter type="IBatisNet.Common.Logging.Impl.NoOpLoggerFA, IBatisNet.Common" />
       
-<!--      <logFactoryAdapter type="IBatisNet.Common.Logging.Impl.NoOpLoggerFA, IBatisNet.Common" />
--->      
 		</logging>
 	</iBATIS>
 		

Modified: ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/bin/Debug/providers.config
URL: http://svn.apache.org/viewcvs/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/bin/Debug/providers.config?rev=392508&r1=392507&r2=392508&view=diff
==============================================================================
--- ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/bin/Debug/providers.config (original)
+++ ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/bin/Debug/providers.config Sat Apr  8 04:38:47 2006
@@ -189,9 +189,9 @@
   />
   <provider 
     name="MySql" 
-    description="MySQL, MySQL provider V1.0.5.13785" 
+    description="MySQL, MySQL provider 1.0.7.30072" 
     enabled="false" 
-    assemblyName="MySql.Data, Version=1.0.5.13785, Culture=neutral, PublicKeyToken=c5687fc88969c44d" connectionClass="MySql.Data.MySqlClient.MySqlConnection" 
+    assemblyName="MySql.Data, Version=1.0.7.30072, Culture=neutral, PublicKeyToken=c5687fc88969c44d" connectionClass="MySql.Data.MySqlClient.MySqlConnection" 
     commandClass="MySql.Data.MySqlClient.MySqlCommand" 
     parameterClass="MySql.Data.MySqlClient.MySqlParameter" 
     parameterDbTypeClass="MySql.Data.MySqlClient.MySqlDbType" 

Modified: ibatis/trunk/cs/mapper/IBatisNet.DataMapper/ChangeLog.txt
URL: http://svn.apache.org/viewcvs/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/ChangeLog.txt?rev=392508&r1=392507&r2=392508&view=diff
==============================================================================
--- ibatis/trunk/cs/mapper/IBatisNet.DataMapper/ChangeLog.txt (original)
+++ ibatis/trunk/cs/mapper/IBatisNet.DataMapper/ChangeLog.txt Sat Apr  8 04:38:47 2006
@@ -4,6 +4,7 @@
 1.4 - XX/XX/XXX
 ------------------------------
 - Fixed IBATISNET-153 Supporting private field accessor
+- Fixed IBATISNET-151 Pre-load stored procedure parameters should use the already-open connection 
 - Added useReflectionOptimizer attribut setting in SqlMap.config
 - Added class attribute to parameterMap tags [it is required !]
 - Added support for readOnly & serialize attribut on CacheModel

Modified: ibatis/trunk/cs/mapper/IBatisNet.DataMapper/Configuration/Sql/Static/ProcedureSql.cs
URL: http://svn.apache.org/viewcvs/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/Configuration/Sql/Static/ProcedureSql.cs?rev=392508&r1=392507&r2=392508&view=diff
==============================================================================
--- ibatis/trunk/cs/mapper/IBatisNet.DataMapper/Configuration/Sql/Static/ProcedureSql.cs (original)
+++ ibatis/trunk/cs/mapper/IBatisNet.DataMapper/Configuration/Sql/Static/ProcedureSql.cs Sat Apr  8 04:38:47 2006
@@ -1,12 +1,11 @@
-
 #region Apache Notice
 /*****************************************************************************
- * $Header: $
- * $Revision$
- * $Date$
+ * $Revision: 374175 $
+ * $LastChangedDate$
+ * $LastChangedBy$
  * 
  * iBATIS.NET Data Mapper
- * Copyright (C) 2004 - Gilles Bayon
+ * Copyright (C) 2006/2005 - The Apache Software Foundation
  *  
  * 
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -24,7 +23,7 @@
  ********************************************************************************/
 #endregion
 
-#region Imports
+#region Using
 using System;
 
 using IBatisNet.Common;
@@ -36,7 +35,6 @@
 using IBatisNet.DataMapper.TypeHandlers;
 
 #endregion
-
 
 namespace IBatisNet.DataMapper.Configuration.Sql.Static
 {

Modified: ibatis/trunk/cs/mapper/IBatisNet.DataMapper/Configuration/Statements/PreparedStatementFactory.cs
URL: http://svn.apache.org/viewcvs/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/Configuration/Statements/PreparedStatementFactory.cs?rev=392508&r1=392507&r2=392508&view=diff
==============================================================================
--- ibatis/trunk/cs/mapper/IBatisNet.DataMapper/Configuration/Statements/PreparedStatementFactory.cs (original)
+++ ibatis/trunk/cs/mapper/IBatisNet.DataMapper/Configuration/Statements/PreparedStatementFactory.cs Sat Apr  8 04:38:47 2006
@@ -2,7 +2,7 @@
 #region Apache Notice
 /*****************************************************************************
  * $Header: $
- * $Revision$
+ * $Revision: 391784 $
  * $Date$
  * 
  * iBATIS.NET Data Mapper
@@ -169,7 +169,7 @@
 		{
 			// pull the parameters for this stored procedure from the parameter cache 
 			// (or discover them & populate the cache)
-			IDataParameter[] commandParameters = DBHelperParameterCache.GetSpParameterSet(session.DataSource, _commandText);
+			IDataParameter[] commandParameters = DBHelperParameterCache.GetSpParameterSet(session, _commandText);
 
 			_preparedStatement.DbParameters = new IDataParameter[commandParameters.Length];