Connection Timeout - Oracle

Posts   
 
    
ottoacosta
User
Posts: 34
Joined: 16-Aug-2007
# Posted on: 13-Mar-2009 19:17:49   

Guys,

I keep getting this error at a customer site:

Oracle.DataAccess.Client.OracleException Connection request timed out at Oracle.DataAccess.Client.OracleException.HandleErrorHelper(Int32 errCode, OracleConnection conn, IntPtr opsErrCtx, OpoSqlValCtx* pOpoSqlValCtx, Object src, String procedure) at Oracle.DataAccess.Client.OracleException.HandleError(Int32 errCode, OracleConnection conn, IntPtr opsErrCtx, Object src) at Oracle.DataAccess.Client.OracleConnection.Open() at SD.LLBLGen.Pro.ORMSupportClasses.TransactionBase..ctor(IsolationLevel transactionIsolationLevel, String name) at MMMS.SAMTracks.BL.HelperClasses.Transaction..ctor(IsolationLevel transactionIsolationLevel, String name) in d:\Data\SrcCode\SAMTracks 3.x\3.4.1.0\Source\SAMTracks.BL\HelperClasses\Transaction.cs:line 35

After a few of these, the service crashes with the following exception found in the Application Event Log:

EventType clr20r3, P1 samtracks.service.exe, P2 3.4.1.1112, P3 491c44f3, P4 oracle.dataaccess, P5 2.102.2.20, P6 44b48c1c, P7 310, P8 191, P9 oracle.dataaccess.client.oracle, P10 NIL.

Data: 0000: 63 00 6c 00 72 00 32 00 c.l.r.2. 0008: 30 00 72 00 33 00 2c 00 0.r.3.,. 0010: 20 00 73 00 61 00 6d 00 .s.a.m. 0018: 74 00 72 00 61 00 63 00 t.r.a.c. 0020: 6b 00 73 00 2e 00 73 00 k.s...s. 0028: 65 00 72 00 76 00 69 00 e.r.v.i. 0030: 63 00 65 00 2e 00 65 00 c.e...e. 0038: 78 00 65 00 2c 00 20 00 x.e.,. . 0040: 33 00 2e 00 34 00 2e 00 3...4... 0048: 31 00 2e 00 31 00 31 00 1...1.1. 0050: 31 00 32 00 2c 00 20 00 1.2.,. . 0058: 34 00 39 00 31 00 63 00 4.9.1.c. 0060: 34 00 34 00 66 00 33 00 4.4.f.3. 0068: 2c 00 20 00 6f 00 72 00 ,. .o.r. 0070: 61 00 63 00 6c 00 65 00 a.c.l.e. 0078: 2e 00 64 00 61 00 74 00 ..d.a.t. 0080: 61 00 61 00 63 00 63 00 a.a.c.c. 0088: 65 00 73 00 73 00 2c 00 e.s.s.,. 0090: 20 00 32 00 2e 00 31 00 .2...1. 0098: 30 00 32 00 2e 00 32 00 0.2...2. 00a0: 2e 00 32 00 30 00 2c 00 ..2.0.,. 00a8: 20 00 34 00 34 00 62 00 .4.4.b. 00b0: 34 00 38 00 63 00 31 00 4.8.c.1. 00b8: 63 00 2c 00 20 00 33 00 c.,. .3. 00c0: 31 00 30 00 2c 00 20 00 1.0.,. . 00c8: 31 00 39 00 31 00 2c 00 1.9.1.,. 00d0: 20 00 6f 00 72 00 61 00 .o.r.a. 00d8: 63 00 6c 00 65 00 2e 00 c.l.e... 00e0: 64 00 61 00 74 00 61 00 d.a.t.a. 00e8: 61 00 63 00 63 00 65 00 a.c.c.e. 00f0: 73 00 73 00 2e 00 63 00 s.s...c. 00f8: 6c 00 69 00 65 00 6e 00 l.i.e.n. 0100: 74 00 2e 00 6f 00 72 00 t...o.r. 0108: 61 00 63 00 6c 00 65 00 a.c.l.e. 0110: 20 00 4e 00 49 00 4c 00 .N.I.L. 0118: 0d 00 0a 00 ....

----------------- END Of Exception --------------------

Connection String: <add key="Main.ConnectionString" value="data source=samp;User Id=*;Password=;persist security info=false;Connection Timeout=90;"/>

BL code generated with LLBLGen Pro ver. 1.2005.1.

Connecting to an Oracle 10g database.

Please help confused Thanks,

Otto.

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 13-Mar-2009 20:38:48   

Try increasing the timeout value. This is done through code. If you are using Adapter this is done on DataAccessAdapter.CommandTimeOut property. If using SelfServicing, please use DBUtils.CommandTimeOut.

Also would be good idea to update the Oracle Data Provider (I don't know your version) as they have fixes about this too.

David Elizondo | LLBLGen Support Team
ottoacosta
User
Posts: 34
Joined: 16-Aug-2007
# Posted on: 13-Mar-2009 20:42:54   

I didn't think the command timeout was related to the connection timeout or request timeout which is the verb shown on this exception.

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 14-Mar-2009 06:01:56   

Anyway please try that. Also check the Oracle Data Provider version as I found some info out there that indicates that Oracle made some fixes around that error time ago. What runtime version of the provider are you using on the machine you got the error?

David Elizondo | LLBLGen Support Team
ottoacosta
User
Posts: 34
Joined: 16-Aug-2007
# Posted on: 16-Mar-2009 14:21:00   

The version is 2.102.2.20

Walaa avatar
Walaa
Support Team
Posts: 14993
Joined: 21-Aug-2005
# Posted on: 16-Mar-2009 14:50:25   

Did you try increasing the ConnectionTimout in the connection string?

ottoacosta
User
Posts: 34
Joined: 16-Aug-2007
# Posted on: 16-Mar-2009 15:18:18   

In the past I had tried 60 and 90 seconds, even though I have to admit that on this particular tier it was not set. Is the default 15 or 30 seconds?

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39859
Joined: 17-Aug-2003
# Posted on: 16-Mar-2009 20:51:26   

15 for commands. please understand that connection timeouts are used by the provider for connecting, and command timeouts for the actual query execution. (which includes the time to consume all the data + the query execution on the server)

Frans Bouma | Lead developer LLBLGen Pro
ottoacosta
User
Posts: 34
Joined: 16-Aug-2007
# Posted on: 20-Mar-2009 15:31:26   

Guys,

I have not find a cure for this yet (2 more resent crashes due to database connectivity errors). It seems to me I need to add an UnhandledException handler somewhere in the BL layer to prevent these exceptions from bubbling up all the way up to the windows service and crashing it. I am juts not so sure where is the best place to do so.

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 20-Mar-2009 19:50:12   

To trap the exception you have to look at your code to look where it should be. And if you have access to modify the connection timeout of the provider, you could try that too.

David Elizondo | LLBLGen Support Team
ottoacosta
User
Posts: 34
Joined: 16-Aug-2007
# Posted on: 20-Mar-2009 19:57:40   

daelmo,

Thanks for your response.

I only access the database through the code generated by LLBLGen (self servicing) hence my question about what is the best place to trap unhandled exceptions coming from the Oracle.DataAccess DLL.

I understand that incrementing the timeout setting could alleviate the issue but the truth of the matter is I need to prevent that exception from taking the whole app down.

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 21-Mar-2009 03:00:35   

ottoacosta wrote:

hence my question about what is the best place to trap unhandled exceptions coming from the Oracle.DataAccess DLL.

I would trap it at the Save/Fetch actions on you Business Layer. Then send an appropiate exception to the GUI, the GUI trap exceptions on the BL.Save/Fetch things and show nicely to the user.

David Elizondo | LLBLGen Support Team