Page 1 of 1

OracleDataSourceEnumerator Bug

Posted: Tue 27 Oct 2015 14:21
by adsivlad
Hello,
I am trying to read the tnsnames.ora entries using the following code copied from the example on your website:
OracleHomeCollection homes = OracleConnection.Homes;
foreach (OracleHome h in homes)
{
Console.WriteLine("=== Home={0} ===", h.Name);
OracleDataSourceEnumerator en = new OracleDataSourceEnumerator();
DataTable tbl = en.GetDataSources(h.Name);
foreach (DataRow row in tbl.Rows)
{
Console.WriteLine(row["InstanceName"]);
}
}

The problem is that every column in the DataTable is empty except InstanceName. I have tested if I can connect with the alias and it works. Also, using ODP.NET I am able to see the entries in full detail. The code for ODP.NET to read tnsnames.ora entries is the following:

string ProviderName = "Oracle.DataAccess.Client";
DbProviderFactory factory = DbProviderFactories.GetFactory(ProviderName);
if (factory.CanCreateDataSourceEnumerator)
{
DbDataSourceEnumerator dsenum = factory.CreateDataSourceEnumerator();
DataTable dt = dsenum.GetDataSources();
foreach (DataRow row in dt.Rows)
{
System.Diagnostics.Debug.Print(dt.Columns[0] + " : " + row[0]);
System.Diagnostics.Debug.Print(dt.Columns[1] + " : " + row[1]);
System.Diagnostics.Debug.Print(dt.Columns[2] + " : " + row[2]);
System.Diagnostics.Debug.Print(dt.Columns[3] + " : " + row[3]);
System.Diagnostics.Debug.Print(dt.Columns[4] + " : " + row[4]);
System.Diagnostics.Debug.Print("--------------------");
}
}
else
Console.Write("Data source enumeration is not supported by provider");

Can you help me by answering this blocking issue?

We have dotConnect 8.3.135.0

We use Oracle 11g

Thanks,

Re: OracleDataSourceEnumerator Bug

Posted: Thu 29 Oct 2015 15:15
by Pinturiccio
We have reproduced the issue. We will investigate it and post here about the results as soon as possible.

Re: OracleDataSourceEnumerator Bug

Posted: Thu 12 Nov 2015 15:20
by adsivlad
Any news for the issue?
It's been 2 weeks and there is no answer from your side.

The issue is urgent for us as we want to change a C# function that uses OracleLoader to direct mode.
But given the fact that direct mode uses a different connection string we need to parse the TNSNames.ORA to scan for TNS also if the user uses TNS.
That is why it is very important for us to be able to get the TNS aliases from the file.

Thanks,

Re: OracleDataSourceEnumerator Bug

Posted: Fri 13 Nov 2015 14:40
by Pinturiccio
We have answered you via e-mail.

Re: OracleDataSourceEnumerator Bug

Posted: Wed 04 May 2016 13:37
by Pinturiccio
We have improved the OracleHomeCollection class. We will post here when the corresponding build of dotConnect for Oracle is available for download.

Re: OracleDataSourceEnumerator Bug

Posted: Fri 06 May 2016 07:57
by Pinturiccio
New build of dotConnect for Oracle 9.0.12 is available for download!
It can be downloaded from http://www.devart.com/dotconnect/oracle/download.html (trial version) or from Registered Users' Area (for users with valid subscription only).
For more information, please refer to http://forums.devart.com/viewtopic.php?t=33635