From: Michael D. <mik...@us...> - 2004-12-27 02:26:22
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Driver In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3720/NHibernate/Driver Modified Files: FirebirdDriver.cs MySqlDataDriver.cs NpgsqlDriver.cs OracleClientDriver.cs Log Message: Added better error messages for situation where required assemblies to create the connection and command are not in the bin or gac. Index: FirebirdDriver.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Driver/FirebirdDriver.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** FirebirdDriver.cs 18 May 2004 05:02:27 -0000 1.3 --- FirebirdDriver.cs 27 Dec 2004 02:26:13 -0000 1.4 *************** *** 1,5 **** using System; - using System.Data; - using System.Reflection; namespace NHibernate.Driver --- 1,3 ---- *************** *** 17,20 **** --- 15,28 ---- connectionType = System.Type.GetType("FirebirdSql.Data.Firebird.FbConnection, FirebirdSql.Data.Firebird"); commandType = System.Type.GetType("FirebirdSql.Data.Firebird.FbCommand, FirebirdSql.Data.Firebird"); + + if( connectionType==null || commandType==null ) + { + throw new HibernateException( + "The IDbCommand and IDbConnection implementation in the Assembly FirebirdSql.Data could not be found. " + + "Please ensure that the Assemblies needed to communicate with Firebird " + + "are in the Global Assembly Cache or in a location that NHibernate " + + "can use System.Type.GetType(string) to load the types from." + ); + } } Index: OracleClientDriver.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Driver/OracleClientDriver.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** OracleClientDriver.cs 18 May 2004 05:02:27 -0000 1.1 --- OracleClientDriver.cs 27 Dec 2004 02:26:13 -0000 1.2 *************** *** 6,11 **** { /// <summary> ! /// A NHibernate Driver for using the Oracle DataProvider ! /// <see cref="System.Data.OracleClient.OracleConnection"/>. /// </summary> public class OracleClientDriver: DriverBase --- 6,10 ---- { /// <summary> ! /// A NHibernate Driver for using the Oracle DataProvider. /// </summary> public class OracleClientDriver: DriverBase Index: NpgsqlDriver.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Driver/NpgsqlDriver.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** NpgsqlDriver.cs 19 Sep 2004 15:32:34 -0000 1.1 --- NpgsqlDriver.cs 27 Dec 2004 02:26:13 -0000 1.2 *************** *** 1,5 **** using System; - using System.Data; - using System.Reflection; namespace NHibernate.Driver --- 1,3 ---- *************** *** 17,21 **** /// </p> /// <p> ! /// Please check the products website <a href="http://www.postgresql.org/">http://www.postgresql.org/</a> /// for any updates and or documentation. /// </p> --- 15,20 ---- /// </p> /// <p> ! /// Please check the products website ! /// <a href="http://www.postgresql.org/">http://www.postgresql.org/</a> /// for any updates and or documentation. /// </p> *************** *** 34,37 **** --- 33,46 ---- connectionType = System.Type.GetType("Npgsql.NpgsqlConnection, Npgsql"); commandType = System.Type.GetType("Npgsql.NpgsqlCommand, Npgsql"); + + if( connectionType==null || commandType==null ) + { + throw new HibernateException( + "The IDbCommand and IDbConnection implementation in the Assembly Npgsql.dll could not be found. " + + "Please ensure that the Assemblies needed to communicate with PostgreSQL " + + "are in the Global Assembly Cache or in a location that NHibernate " + + "can use System.Type.GetType(string) to load the types from." + ); + } } Index: MySqlDataDriver.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Driver/MySqlDataDriver.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** MySqlDataDriver.cs 6 Dec 2004 03:39:16 -0000 1.2 --- MySqlDataDriver.cs 27 Dec 2004 02:26:13 -0000 1.3 *************** *** 1,8 **** using System; - using System.Data; - using System.Reflection; - - using NHibernate.Dialect; - using NHibernate.SqlCommand; namespace NHibernate.Driver --- 1,3 ---- *************** *** 19,23 **** /// </p> /// <p> ! /// Please check the products website <a href="http://www.mysql.com/products/connector/net/">http://www.mysql.com/products/connector/net/</a> /// for any updates and or documentation. /// </p> --- 14,19 ---- /// </p> /// <p> ! /// Please check the products website ! /// <a href="http://www.mysql.com/products/connector/net/">http://www.mysql.com/products/connector/net/</a> /// for any updates and or documentation. /// </p> *************** *** 32,35 **** --- 28,41 ---- connectionType = System.Type.GetType("MySql.Data.MySqlClient.MySqlConnection, MySql.Data"); commandType = System.Type.GetType("MySql.Data.MySqlClient.MySqlCommand, MySql.Data"); + + if( connectionType==null || commandType==null ) + { + throw new HibernateException( + "The IDbCommand and IDbConnection implementation in the Assembly MySql.Data could not be found. " + + "Please ensure that the Assemblies MySql.Data.dll and ICSharpCode.SharpZipLib.dll " + + "are in the Global Assembly Cache or in a location that NHibernate " + + "can use System.Type.GetType(string) to load the types from." + ); + } } *************** *** 45,51 **** /// <summary> ! /// MySqlData does not use named parameters in the sql. /// </summary> ! /// <value><c>false</c> becuase MySql uses <c>?</c> in the sql.</value> public override bool UseNamedPrefixInSql { --- 51,57 ---- /// <summary> ! /// MySql.Data uses named parameters in the sql. /// </summary> ! /// <value><c>true</c> - MySql uses <c>?</c> in the sql.</value> public override bool UseNamedPrefixInSql { *************** *** 53,56 **** --- 59,65 ---- } + /// <summary> + /// + /// </summary> public override bool UseNamedPrefixInParameter { *************** *** 58,61 **** --- 67,74 ---- } + /// <summary> + /// MySql.Data use the <c>?</c> to locate parameters in sql. + /// </summary> + /// <value><c>?</c> is used to locate parameters in sql.</value> public override string NamedPrefix { *************** *** 64,68 **** /// <summary> ! /// The ByteFX driver does NOT support more than 1 open IDataReader /// with only 1 IDbConnection. /// </summary> --- 77,81 ---- /// <summary> ! /// The MySql.Data driver does NOT support more than 1 open IDataReader /// with only 1 IDbConnection. /// </summary> *************** *** 77,80 **** --- 90,94 ---- /// message "Expected End of data packet" when a select command is prepared. /// </summary> + /// <value><c>false</c> - it is not supported.</value> public override bool SupportsPreparingCommands { |