Command timeout and views (PgSQL)

Posts   
 
    
Marin
User
Posts: 9
Joined: 10-Dec-2006
# Posted on: 02-Apr-2007 20:43:52   

Hi all,

I have an ASP.Net app that gets an exception on long-lasting queries on views - ERROR: 57014: canceling statement due to user request - after 20s in the query (it takes about a minute for query to complete). CommandTimeout on Npgsql is set to 300, and commandTimeout property of DbUtils and DbUtilsComPlus is also set to 300 (hardcoded from default 30).

AFAIK, 20s is default connection timeout on ADO. Is there some difference in the way views are handled? Is this an issue in npgsql? What can I do to avoid this?

Thanks! Marin

SelfServicing .Net 2.0 PostgreSQL 8.2.3/Win2003/UTF8 LLBL (2007-03-19) 2.0.7.319 exception is thrown in:

[NpgsqlException: ERROR: 57014: canceling statement due to user request]
   Npgsql.NpgsqlConnector.CheckErrors() +115
   Npgsql.NpgsqlConnector.CheckErrorsAndNotifications() +58
   Npgsql.NpgsqlCommand.ExecuteCommand() +210
   Npgsql.NpgsqlCommand.ExecuteScalar() +115
   SD.LLBLGen.Pro.ORMSupportClasses.RetrievalQuery.ExecuteScalar() +245

[ORMQueryExecutionException: An exception was caught during the execution of a retrieval query: ERROR: 57014: canceling statement due to user request. Check InnerException, QueryExecuted and Parameters of this exception to examine the cause of this exception.]
   SD.LLBLGen.Pro.ORMSupportClasses.RetrievalQuery.ExecuteScalar() +397
   SD.LLBLGen.Pro.ORMSupportClasses.DaoBase.ExecuteScalarQuery(IRetrievalQuery queryToExecute, ITransaction containingTransaction) +199
   SD.LLBLGen.Pro.ORMSupportClasses.DaoBase.GetDbCount(IEntityFields fields, ITransaction containingTransaction, IPredicate filter, IRelationCollection relations, IGroupByCollection groupByClause, Boolean allowDuplicates) +235
  ...
Marin
User
Posts: 9
Joined: 10-Dec-2006
# Posted on: 02-Apr-2007 22:06:17   

Update - same thing with regular tables. In cmdline application (.Net2, selfservicing), added

DbUtils.CommandTimeOut = 300;

as the first line in the code, and still times out at 20s.

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 03-Apr-2007 09:59:37   

As far as I know, there are Command Timeout and Connection Timeout. Connection Timeout can be set in the connection string.

Marin
User
Posts: 9
Joined: 10-Dec-2006
# Posted on: 03-Apr-2007 13:16:57   

Yes, I know that. It's not an issue with connection timeout - earlier queries finish without problems, and the application is the only 'user' of the database. The command takes a loong time to finish and times out. The problem is that I cannot set the command timeout - changes to property have no effect. I've checked the LLBL source, and it seems to just pass the value to underlying db driver?

Aurelien avatar
Aurelien
Support Team
Posts: 162
Joined: 28-Jun-2006
# Posted on: 04-Apr-2007 09:28:59   

it maybe an issue in the npgsql driver. check this link :

http://pgfoundry.org/frs/shownotes.php?release_id=587

it is fixed in 1.0 RC2, what version do you use ?

Marin
User
Posts: 9
Joined: 10-Dec-2006
# Posted on: 04-Apr-2007 10:55:09   

npgsql version is 1.0.0.0, the one shipped with llbl (had troubles replacing with other versions, don't know if it's signed or not).. i've seen this notice about npgsql, but this version should be ok.

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 04-Apr-2007 11:23:36