Solved

Bulkload error in SQL Server 2008

Posted on 2010-11-22
5
3,056 Views
Last Modified: 2012-05-10
I'm getting the following SQL Server error (Event ID 18056) when running bulkload in SQL Server 2008.  

The client was unable to reuse a session with SPID 500, which had been reset for connection pooling. The failure ID is 29. This error may have been caused by an earlier operation failing. Check the error logs for failed operations immediately before this error message.

There are no errors logged prior to this.  Following this error, I get several errors (Event ID 4014) as follows:

A fatal error occurred while reading the input stream from the network. The session will be terminated (input error: 10054, output error: 0).

My connection string is set as follows:

connectionString="provider=SQLOLEDB;data source=db_server; database=MY_DB; User ID=user;Password=xxxxxxx; pooling=false" />

My application is set up with several threads trying to run bulkload inserts of 100000 records at a time into the same database table.  This works most of the time, but after 2-3 hours, I start getting the messages listed above.  

Here's the code I use to actually execute the bulkload:

                objBL.ConnectionString = ConfigurationManager.ConnectionStrings["DynaSimBulkLoad"].ToString();
                objBL.KeepIdentity = false;
                objBL.CheckConstraints = false;
                objBL.IgnoreDuplicateKeys = false;
                objBL.KeepNulls = true;
                objBL.BulkLoad = true;
                objBL.Execute( ConfigurationManager.AppSettings["bulkloadschema"], loadFileName );

What does the session reuse error indicate here?  Any thoughts on what might be causing the error?
0
Comment
Question by:stansys
  • 4
5 Comments
 

Accepted Solution

by:
stansys earned 0 total points
ID: 34192975
I found some information on this here:  

http://sqlserverpedia.com/blog/sql-server-bloggers/windows-2008-r2-needs-hotfix-for-sql-server-2008/ 

Testing out the hotfix now.
0
 

Author Comment

by:stansys
ID: 34197502
This fix did not completely resolve the issue.  It appears SQL Server is getting backed up in handling the multiple bulkload requests.  Some of the larger requests never finish.
0
 

Author Comment

by:stansys
ID: 34201361
Set the recovery model to bulk-logged and now SQL Server appears to be keeping up better with the multiple bulkload requests.  After 3 hours, the app is still stable.  
0
 
LVL 31

Expert Comment

by:James Murrell
ID: 34276901
good news I was going to suggest set the recovery to bulk
0
 

Author Closing Comment

by:stansys
ID: 34317124
Turns out the Microsoft fix resolved much of the problem.
0

Featured Post

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
(sql serv16)ssis 2016 question/check 1 72
Database Integrity 1 50
sql server query 18 41
multiply rows by tally table with zero padded concatenation 4 54
This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.

829 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question