Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Driver In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9388/NHibernate/Driver Modified Files: DB2Driver.cs FirebirdDriver.cs MySqlDataDriver.cs NpgsqlDriver.cs OracleDataClientDriver.cs SqlClientDriver.cs SQLiteDriver.cs Log Message: NH-223: fixed how data provider assemblies are loaded to work with the gac instead of just local bin. Index: MySqlDataDriver.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Driver/MySqlDataDriver.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** MySqlDataDriver.cs 31 Dec 2004 17:25:35 -0000 1.4 --- MySqlDataDriver.cs 5 Apr 2005 14:22:27 -0000 1.5 *************** *** 1,2 **** --- 1,5 ---- + using System; + using System.Reflection; + namespace NHibernate.Driver { *************** *** 21,29 **** private System.Type commandType; ! /// <summary></summary> public MySqlDataDriver() { ! 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 ) --- 24,42 ---- private System.Type commandType; ! /// <summary> ! /// Initializes a new instance of the <see cref="MySqlDataDriver"/> class. ! /// </summary> ! /// <exception cref="HibernateException"> ! /// Thrown when the MySql.Data assembly is not and can not be loaded. ! /// </exception> public MySqlDataDriver() { ! string assemblyName = "MySql.Data"; ! string connectionClassName = "MySql.Data.MySqlClient.MySqlConnection"; ! string commandClassName = "MySql.Data.MySqlClient.MySqlCommand"; ! ! // try to get the Types from an already loaded assembly ! connectionType = Util.ReflectHelper.TypeFromAssembly( connectionClassName, assemblyName ); ! commandType = Util.ReflectHelper.TypeFromAssembly( commandClassName, assemblyName ); if( connectionType == null || commandType == null ) *************** *** 38,42 **** } ! /// <summary></summary> public override System.Type CommandType { --- 51,59 ---- } ! /// <summary> ! /// Gets the <see cref="System.Type"/> from the MySql.Data assembly ! /// that implements <see cref="IDbCommand"/> ! /// </summary> ! /// <value>The <see cref="MySql.Data.MySqlClient.MySqlCommand"/> type.</value> public override System.Type CommandType { *************** *** 44,48 **** } ! /// <summary></summary> public override System.Type ConnectionType { --- 61,69 ---- } ! /// <summary> ! /// Gets the <see cref="System.Type"/> from the MySql.Data assembly ! /// that implements <see cref="IDbCommand"/> ! /// </summary> ! /// <value>The <see cref="MySql.Data.MySqlClient.MySqlConnection"/> type.</value> public override System.Type ConnectionType { *************** *** 85,92 **** /// <summary> ! /// With the Gamma MySql.Data provider it is throwing an exception with the ! /// 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 { --- 106,116 ---- /// <summary> ! /// MySql.Data does not support preparing of commands. /// </summary> /// <value><c>false</c> - it is not supported.</value> + /// <remarks> + /// With the Gamma MySql.Data provider it is throwing an exception with the + /// message "Expected End of data packet" when a select command is prepared. + /// </remarks> public override bool SupportsPreparingCommands { Index: SqlClientDriver.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Driver/SqlClientDriver.cs,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** SqlClientDriver.cs 31 Dec 2004 17:26:01 -0000 1.7 --- SqlClientDriver.cs 5 Apr 2005 14:22:27 -0000 1.8 *************** *** 1,4 **** --- 1,5 ---- using System.Data; using System.Data.SqlClient; + using NHibernate.SqlCommand; using NHibernate.SqlTypes; *************** *** 11,20 **** public class SqlClientDriver : DriverBase { ! /// <summary></summary> public SqlClientDriver() { } ! /// <summary></summary> public override System.Type CommandType { --- 12,27 ---- public class SqlClientDriver : DriverBase { ! /// <summary> ! /// Initializes a new instance of the <see cref="SqlClientDriver"/> class. ! /// </summary> public SqlClientDriver() { } ! /// <summary> ! /// Gets the <see cref="System.Type"/> from the System.Data assembly ! /// that implements <see cref="IDbCommand"/> ! /// </summary> ! /// <value>The <see cref="System.Data.SqlClient.SqlCommand"/> type.</value> public override System.Type CommandType { *************** *** 22,38 **** } ! /// <summary></summary> public override System.Type ConnectionType { ! get { return typeof( SqlConnection ); } } ! /// <summary></summary> public override IDbConnection CreateConnection() { ! return new SqlConnection(); } ! /// <summary></summary> public override IDbCommand CreateCommand() { --- 29,57 ---- } ! /// <summary> ! /// Gets the <see cref="System.Type"/> from the System.Data assembly ! /// that implements <see cref="IDbConnection"/> ! /// </summary> ! /// <value>The <see cref="System.Data.SqlClient.SqlConnection"/> type.</value> public override System.Type ConnectionType { ! get { return typeof( System.Data.SqlClient.SqlConnection ); } } ! /// <summary> ! /// Creates an uninitialized <see cref="IDbConnection" /> object for ! /// the SqlClientDriver. ! /// </summary> ! /// <value>An unitialized <see cref="System.Data.SqlClient.SqlConnection"/> object.</value> public override IDbConnection CreateConnection() { ! return new System.Data.SqlClient.SqlConnection(); } ! /// <summary> ! /// Creates an uninitialized <see cref="IDbCommand" /> object for ! /// the SqlClientDriver. ! /// </summary> ! /// <value>An unitialized <see cref="System.Data.SqlClient.SqlCommand"/> object.</value> public override IDbCommand CreateCommand() { *************** *** 40,44 **** } ! /// <summary></summary> public override bool UseNamedPrefixInSql { --- 59,68 ---- } ! /// <summary> ! /// MsSql requires the use of a Named Prefix in the SQL statement. ! /// </summary> ! /// <remarks> ! /// <c>true</c> because MsSql uses "<c>@</c>". ! /// </remarks> public override bool UseNamedPrefixInSql { *************** *** 46,50 **** } ! /// <summary></summary> public override bool UseNamedPrefixInParameter { --- 70,79 ---- } ! /// <summary> ! /// MsSql requires the use of a Named Prefix in the Parameter. ! /// </summary> ! /// <remarks> ! /// <c>true</c> because MsSql uses "<c>@</c>". ! /// </remarks> public override bool UseNamedPrefixInParameter { *************** *** 52,56 **** } ! /// <summary></summary> public override string NamedPrefix { --- 81,90 ---- } ! /// <summary> ! /// The Named Prefix for parameters. ! /// </summary> ! /// <value> ! /// Sql Server uses <c>"@"</c>. ! /// </value> public override string NamedPrefix { Index: FirebirdDriver.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Driver/FirebirdDriver.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** FirebirdDriver.cs 31 Dec 2004 17:25:35 -0000 1.5 --- FirebirdDriver.cs 5 Apr 2005 14:22:27 -0000 1.6 *************** *** 2,6 **** { /// <summary> ! /// Summary description for FirebirdDriver. /// </summary> public class FirebirdDriver : DriverBase --- 2,6 ---- { /// <summary> ! /// A NHibernate Driver for using the FirebirdSql.Data.Firebird DataProvider. /// </summary> public class FirebirdDriver : DriverBase *************** *** 9,17 **** private System.Type commandType; ! /// <summary></summary> public FirebirdDriver() { ! 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 ) --- 9,27 ---- private System.Type commandType; ! /// <summary> ! /// Initializes a new instance of the <see cref="FirebirdDriver"/> class. ! /// </summary> ! /// <exception cref="HibernateException"> ! /// Thrown when the <c>FirebirdSql.Data.Firebird</c> assembly is not and can not be loaded. ! /// </exception> public FirebirdDriver() { ! string assemblyName = "FirebirdSql.Data.Firebird"; ! string connectionClassName = "FirebirdSql.Data.Firebird.FbConnection"; ! string commandClassName = "FirebirdSql.Data.Firebird.FbCommand"; ! ! // try to get the Types from an already loaded assembly ! connectionType = Util.ReflectHelper.TypeFromAssembly( connectionClassName, assemblyName ); ! commandType = Util.ReflectHelper.TypeFromAssembly( commandClassName, assemblyName ); if( connectionType == null || commandType == null ) Index: DB2Driver.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Driver/DB2Driver.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** DB2Driver.cs 31 Dec 2004 17:25:35 -0000 1.2 --- DB2Driver.cs 5 Apr 2005 14:22:26 -0000 1.3 *************** *** 12,21 **** /// <summary> ! /// /// </summary> public DB2Driver() { ! connectionType = System.Type.GetType( "IBM.Data.DB2.DB2Connection, IBM.Data.DB2" ); ! commandType = System.Type.GetType( "IBM.Data.DB2.DB2Command, IBM.Data.DB2" ); } --- 12,39 ---- /// <summary> ! /// Initializes a new instance of the <see cref="DB2Driver"/> class. /// </summary> + /// <exception cref="HibernateException"> + /// Thrown when the <c>IBM.Data.DB2</c> assembly is not and can not be loaded. + /// </exception> public DB2Driver() { ! string assemblyName = "IBM.Data.DB2"; ! string connectionClassName = "IBM.Data.DB2.DB2Connection"; ! string commandClassName = "IBM.Data.DB2.DB2Command"; ! ! // try to get the Types from an already loaded assembly ! connectionType = Util.ReflectHelper.TypeFromAssembly( connectionClassName, assemblyName ); ! commandType = Util.ReflectHelper.TypeFromAssembly( commandClassName, assemblyName ); ! ! if( connectionType == null || commandType == null ) ! { ! throw new HibernateException( ! "The IDbCommand and IDbConnection implementation in the Assembly IBM.Data.DB2 could not be found. " + ! "Please ensure that the Assemblies needed to communicate with IBM.Data.DB2 " + ! "are in the Global Assembly Cache or in a location that NHibernate " + ! "can use System.Type.GetType(string) to load the types from." ! ); ! } } Index: SQLiteDriver.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Driver/SQLiteDriver.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** SQLiteDriver.cs 1 Mar 2005 16:24:45 -0000 1.2 --- SQLiteDriver.cs 5 Apr 2005 14:22:27 -0000 1.3 *************** *** 24,34 **** /// <summary> ! /// /// </summary> public SQLiteDriver() { ! _connectionType = System.Type.GetType("Finisar.SQLite.SQLiteConnection, SQLite.NET"); ! _commandType = System.Type.GetType("Finisar.SQLite.SQLiteCommand, SQLite.NET"); ! if( _connectionType == null || _commandType == null ) --- 24,41 ---- /// <summary> ! /// Initializes a new instance of <see cref="SQLiteDriver"/>. /// </summary> + /// <exception cref="HibernateException"> + /// Thrown when the <c>SQLite.NET</c> assembly is not and can not be loaded. + /// </exception> public SQLiteDriver() { ! string assemblyName = "SQLite.NET"; ! string connectionClassName = "Finisar.SQLite.SQLiteConnection"; ! string commandClassName = "Finisar.SQLite.SQLiteCommand"; ! ! // try to get the Types from an already loaded assembly ! _connectionType = Util.ReflectHelper.TypeFromAssembly( connectionClassName, assemblyName ); ! _commandType = Util.ReflectHelper.TypeFromAssembly( commandClassName, assemblyName ); if( _connectionType == null || _commandType == null ) Index: NpgsqlDriver.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Driver/NpgsqlDriver.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** NpgsqlDriver.cs 31 Dec 2004 17:26:01 -0000 1.3 --- NpgsqlDriver.cs 5 Apr 2005 14:22:27 -0000 1.4 *************** *** 27,35 **** private System.Type commandType; ! /// <summary></summary> public NpgsqlDriver() { ! connectionType = System.Type.GetType( "Npgsql.NpgsqlConnection, Npgsql" ); ! commandType = System.Type.GetType( "Npgsql.NpgsqlCommand, Npgsql" ); if( connectionType == null || commandType == null ) --- 27,45 ---- private System.Type commandType; ! /// <summary> ! /// Initializes a new instance of the <see cref="NpgsqlDriver"/> class. ! /// </summary> ! /// <exception cref="HibernateException"> ! /// Thrown when the <c>Npgsql</c> assembly is not and can not be loaded. ! /// </exception> public NpgsqlDriver() { ! string assemblyName = "Npgsql"; ! string connectionClassName = "Npgsql.NpgsqlConnection"; ! string commandClassName = "Npgsql.NpgsqlCommand"; ! ! // try to get the Types from an already loaded assembly ! connectionType = Util.ReflectHelper.TypeFromAssembly( connectionClassName, assemblyName ); ! commandType = Util.ReflectHelper.TypeFromAssembly( commandClassName, assemblyName ); if( connectionType == null || commandType == null ) Index: OracleDataClientDriver.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Driver/OracleDataClientDriver.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** OracleDataClientDriver.cs 25 Jan 2005 13:37:09 -0000 1.1 --- OracleDataClientDriver.cs 5 Apr 2005 14:22:27 -0000 1.2 *************** *** 19,27 **** /// Initializes a new instance of <see cref="OracleDataClientDriver"/>. /// </summary> public OracleDataClientDriver() { ! connectionType = System.Type.GetType( "Oracle.DataAccess.Client.OracleConnection, Oracle.DataAccess" ); ! commandType =System. Type.GetType( "Oracle.DataAccess.Client.OracleCommand, Oracle.DataAccess" ); ! if( connectionType == null || commandType == null ) { --- 19,35 ---- /// Initializes a new instance of <see cref="OracleDataClientDriver"/>. /// </summary> + /// <exception cref="HibernateException"> + /// Thrown when the <c>Oracle.DataAccess</c> assembly is not and can not be loaded. + /// </exception> public OracleDataClientDriver() { ! string assemblyName = "Oracle.DataAccess"; ! string connectionClassName = "Oracle.DataAccess.Client.OracleConnection"; ! string commandClassName = "Oracle.DataAccess.Client.OracleCommand"; ! ! // try to get the Types from an already loaded assembly ! connectionType = Util.ReflectHelper.TypeFromAssembly( connectionClassName, assemblyName ); ! commandType = Util.ReflectHelper.TypeFromAssembly( commandClassName, assemblyName ); ! if( connectionType == null || commandType == null ) { |