We have upgraded from version 6.10.141.0 to version 6.50.237.0.
Certain types of connection errors now give a generic Connection pool timeout error, instead of the real connection problem.
If an invalid username or password is provided, we expect Devart.Data.Oracle.Exception "ORA-01017: invalid username/password; logon denied" to be the exception.
Instead we get a System.InvalidOperationException
{"Timeout expired. The timeout period elapsed prior to obtaining a connection from the pool. This may have occurred because all pooled connections were in use and max pool size was reached."}
Note- the correct error is thrown is pooling is not used, but we have always used pooling and this used to work.
Can anyone suggest a solution for this?
Thanks for any answers!
example:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Devart.Data.Oracle;
namespace ConsoleApplication1
{
///
/// This class provides the internal error codes for known connection failures.
///
public class OracleErrors
{
///
/// The Database name could not be found in the TNS Names file.
///
public const int CouldNotResolveIdentifier = 12154;
///
/// The username and or password was invalid. Login was denied.
///
public const int InvalidUserNamePassword = 1017;
///
/// The value found in the SID fragment of the TNS Names entry could not be found.
///
public const int UnknownSID = 12505;
///
/// The value found in the Host fragment of the TNS Names entry could not be found.
///
public const int UnknownHost = 12545;
///
/// No listener could be found on the specified port.
///
public const int NoListenerFound = 12541;
///
/// Connection failed.
///
public const int TnsInvalidArguments = 12532;
///
/// Connection failed.
///
public const int TnsPermissionDenied = 12546;
}
class Program
{
static void Main(string[] args)
{
OracleConnection Connection = new OracleConnection("User ID=name;Password=pwd;Data Source=DATABASE");
OracleDependency.Enabled = false;
try
{
Connection.Open();
}
catch (Exception e)
{
string ConnectionFailureReason = e.Message;
if (e is OracleException)
{
OracleException ex = (e as OracleException);
switch (ex.Code)
{
case OracleErrors.CouldNotResolveIdentifier:
ConnectionFailureReason = "Could Not Resolve Identifier";
break;
case OracleErrors.UnknownSID:
ConnectionFailureReason = "UnknownSID";
break;
case OracleErrors.UnknownHost:
ConnectionFailureReason = "UnknownHost";
break;
case OracleErrors.NoListenerFound:
ConnectionFailureReason = "NoListenerFound";
break;
case OracleErrors.TnsInvalidArguments:
ConnectionFailureReason = "TnsInvalidArguments";
break;
case OracleErrors.TnsPermissionDenied:
ConnectionFailureReason = "TnsPermissionDenied";
break;
case OracleErrors.InvalidUserNamePassword:
ConnectionFailureReason = "InvalidUserNamePassword";
break;
}
}
throw new Exception(ConnectionFailureReason);
}
}
}
}
version 6.50 returns generic errors when pooling used
New build of dotConnect for Oracle 6.50.244 is available for download now!
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://www.devart.com/forums/viewtopic.php?t=22547 .
This build includes the fix for the bug with returning invalid connections to pool.
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://www.devart.com/forums/viewtopic.php?t=22547 .
This build includes the fix for the bug with returning invalid connections to pool.