We have a customer that is running our executable on a machine that does not have Oracle installed. Instead they are dropping the Oracle.ManagedDataAccess.dll into the executable directory and adding connection settings to the app.config like this:
<connectionStrings>
<add name="FrameworkConnection" connectionString="Data Source=(DESCRIPTION=(ENABLE=BROKEN)
(ADDRESS=(PROTOCOL=TCP)(HOST=x.x.x.x)(PORT=xxx)
(HOST=x.x.x.x)(PORT=xxx)
(HOST=x.x.x.x)(PORT=xxx)
(HOST=x.x.x.x)(PORT=xxx))
(CONNECT_DATA=(SERVICE_NAME=xxx.xxx.xxx.com)));User Id=xxx;Password=xxx;" providerName="Oracle.ManagedDataAccess.Client" />
</connectionStrings>
<system.data>
<DbProviderFactories>
<remove invariant="Oracle.ManagedDataAccess.Client" />
<add name="ODP.NET, Managed Driver" invariant="Oracle.ManagedDataAccess.Client" description="Oracle Data Provider for .NET, Managed Driver"
type="Oracle.ManagedDataAccess.Client.OracleClientFactory, Oracle.ManagedDataAccess, Version=4.122.19.1, Culture=neutral, PublicKeyToken=89b483f429c47342" />
</DbProviderFactories>
</system.data>
We have run tests on our own machines and confirmed that this works correctly. However, the customer is running into an odd issue.
In the first part of our program, we connect to the database using a System.Data.Common.DbConnection, then later in the program we use an LLBLGen adapter. It seems as though the System.Data.Common.DbConnection is working without issue, but the program is crashing when it gets to the LLBLGen connection.
Works correctly:
System.Data.Common.DbProviderFactory databaseProviderFactory = System.Data.Common.DbProviderFactories.GetFactory("Oracle.ManagedDataAccess.Client");
System.Data.Common.DbConnection connection1 = databaseProviderFactory.CreateConnection();
connection1 .ConnectionString = System.Configuration.ConfigurationManager.ConnectionStrings["FrameworkConnection"].ConnectionString;
...
System.Data.Common.DbCommand command1 = connection1.CreateCommand();
...
command1.ExecuteScalar();
Crashes:
SD.LLBLGen.Pro.ORMSupportClasses.IDataAccessAdapter adapter = new Grb.Platform.Framework.Business.Lower.Oracle.DatabaseSpecific.DataAccessAdapter(connection1.ConnectionString.ConnectionString, false, null, null);
adapter.OpenConnection();
Stack Trace:
The following exception occurred at System.Net.IPHostEntry GetAddrInfo(System.String):
No such host is known
The following exception occurred at Void DoConnect(System.String):
ORA-12545: Network Transport: Unable to resolve connect hostname
The following exception occurred at PR Get(OracleInternal.ConnectionPool.ConnectionString, Boolean, Oracle.ManagedDataAccess.Client.OracleConnection, System.String, Boolean):
ORA-12545: Network Transport: Unable to resolve connect hostname
...
Stack Trace:
at System.Net.Dns.GetAddrInfo(String name)
at System.Net.Dns.InternalGetHostByName(String hostName, Boolean includeIPv6)
at System.Net.Dns.GetHostAddresses(String hostNameOrAddress)
at OracleInternal.Network.TcpTransportAdapter.Connect(ConnectionOption conOption) at OracleInternal.Network.OracleCommunication.DoConnect(String tnsDescriptor)
at OracleInternal.ServiceObjects.OracleConnectionImpl.Connect(ConnectionString cs, Boolean bOpenEndUserSession, OracleConnection connRefForCriteria, String instanceName) at OracleInternal.ConnectionPool.PoolManager`3.Get(ConnectionString csWithDiffOrNewPwd, Boolean bGetForApp, OracleConnection connRefForCriteria, String affinityInstanceName, Boolean bForceMatch)
at OracleInternal.ConnectionPool.OraclePoolManager.Get(ConnectionString csWithNewPassword, Boolean bGetForApp, OracleConnection connRefForCriteria, String affinityInstanceName, Boolean bForceMatch)
at OracleInternal.ConnectionPool.OracleConnectionDispenser`3.Get(ConnectionString cs, PM conPM, ConnectionString pmCS, SecureString securedPassword, SecureString securedProxyPassword, OracleConnection connRefForCriteria)
at Oracle.ManagedDataAccess.Client.OracleConnection.Open()
at SD.LLBLGen.Pro.ORMSupportClasses.DataAccessAdapterCore.OpenConnection()
at Grb.Platform...
We are unable to recreate this on our test machines. Is the way LLBLGen connects to Oracle any different from how a System.Data.Common.DbConnection does it? We are using LLBLGen 5.6.2.0. Any insight would be appreciated.