Re: Inserted row after DB_E_ABORTLIMITREACHED
- From: Erland Sommarskog <esquel@xxxxxxxxxxxxx>
- Date: Wed, 04 Jun 2008 14:39:32 -0700
(dimitar.lazaroff@xxxxxxxxx) writes:
I have very strange problem. I'm inserting rows in SQL2005 database
using Native Client, sometimes I receive hresult
DB_E_ABORTLIMITREACHED with description 'Query timeout expired', and
when this happens I'm trying to insert the same row again (within the
same command and session). Sometimes (very rarely) I see that the row
is inserted twice. It looks like the row is inserted even I receive
DB_E_ABORTLIMITREACHED. I know that this sounds stupid, but I have no
idea how this can happens.
Depending on what your query batch includes that is perfectly possible.
A query timeout means that the API got tired of waiting for results
from SQL Server, and cancels the batch. Nothing is rolled back because
of this, so if any insert has been performed, it has been inserted.
Query timeouts are something you should avoid. It is not clear which
API you use. The naked OLE DB API has no query timeout by default, but
ADO has a default timeout of 30 seconds.
Set the query timeout 0, meaning wait forever.
--
Erland Sommarskog, SQL Server MVP, esquel@xxxxxxxxxxxxx
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
.
- References:
- Inserted row after DB_E_ABORTLIMITREACHED
- From: dimitar . lazaroff
- Inserted row after DB_E_ABORTLIMITREACHED
- Prev by Date: Re: 64 bit oledb connection
- Next by Date: RE: Access OleDb driver for Excel bug
- Previous by thread: Inserted row after DB_E_ABORTLIMITREACHED
- Next by thread: RE: Using newest ACE driver to write XLSX file, exception on CREATE TA
- Index(es):
Relevant Pages
|