Connection timeout and oracleclient

Posts   
 
    
llblstc
User
Posts: 19
Joined: 06-Jul-2009
# Posted on: 17-Feb-2011 11:04:59   

I'm using self servicing and want to set "connection time out" but not in the connection string since system.data.oracleclient doesn't support this.

I'm using "LLBLGen Pro version: 2.0.0.0"

How can i do this?

http://msdn.microsoft.com/en-us/library/system.data.oracleclient.oracleconnection.connectiontimeout.aspx

MTrinder
User
Posts: 1461
Joined: 08-Oct-2008
# Posted on: 17-Feb-2011 21:10:05   

The note in that article states

Unlike the Connection object in the other .NET Framework data providers (SQL Server, OLE DB, and ODBC), OracleConnection does not support a ConnectionTimeout property. Setting a connection time-out either with a property or in the connection string has no effect, and the value returned is always zero.

so it looks like it is not possible to do what you want.

Matt

llblstc
User
Posts: 19
Joined: 06-Jul-2009
# Posted on: 18-Feb-2011 09:13:52   

it is not possible in the conenction string.

But it can be done on the OracleConnection if LLBL somehow will let me?

Walaa avatar
Walaa
Support Team
Posts: 14993
Joined: 21-Aug-2005
# Posted on: 18-Feb-2011 09:33:30   

Would you please explain the problem in more details, in case we can find a work around for it, why do you want to increase the connection Timeout?

Instead, could increasing the CommandTimeout solve your issue?

(edit) Also, check this out:

If the error occurred because of a slow network or system, reconfigure one or all of the parameters SQLNET.INBOUND_CONNECT_TIMEOUT, SQLNET.SEND_TIMEOUT, SQLNET.RECV_TIMEOUT in sqlnet.ora to larger values. If a malicious client is suspected, use the address in sqlnet.log to identify the source and restrict access. Note that logged addresses may not be reliable as they can be forged (e.g. in TCP/IP).

Your sqlnet.ora file can be found in your $ORACLE_HOME/network/admin directory.

ref: http://www.dba-oracle.com/t_ora_12170_tns_connect_timeout.htm

Also check this out: http://filibeto.org/sun/lib/nonsun/oracle/10.1.0.2/B14117_01/win.101/b10117/features001.htm And so the question can be, are you sure you need to adjust the Connection Timout or the Connection LifeTime ? simple_smile

llblstc
User
Posts: 19
Joined: 06-Jul-2009
# Posted on: 18-Feb-2011 09:56:04   

I need to adjust the connection timeout when using more connections than in the connection pool. It do not need to alter the command time out.

You are refereing the odp.net documentation, but I am using MS Oracle.

Walaa avatar
Walaa
Support Team
Posts: 14993
Joined: 21-Aug-2005
# Posted on: 18-Feb-2011 10:08:58   

Then I suggest looking into switching to ODP.NET. MS Oracle is deprectaed AFAIK.

llblstc
User
Posts: 19
Joined: 06-Jul-2009
# Posted on: 18-Feb-2011 14:10:19   

I cannot change. Did you check if it is possible?

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 19-Feb-2011 06:42:31   

You can inherit from your DataAccessAdapter object and set that property in there. For instance:

public partial class MyDataAccessAdapter : DataAccessAdapter
{
   protected override IDbConnection CreateNewPhysicalConnection(string connectionString)
   {
           OracleConnection toReturn = new OracleConnection(connectionString);
           toReturn.ConnectionTimeout = xxx;
       return toReturn;
   }
}

then in your code:

using (var adapter = new MyDataAccessAdapter)
{
  ...
}
David Elizondo | LLBLGen Support Team