?
Solved

Bulkload error in SQL Server 2008

Posted on 2010-11-22
5
Medium Priority
?
3,107 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

An alternative to the "For XML" way of pivoting and concatenating result sets into strings, and an easy introduction to "common table expressions" (CTEs). Being someone who is always looking for alternatives to "work your data", I came across this …
This shares a stored procedure to retrieve permissions for a given user on the current database or across all databases on a server.
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties
Via a live example, show how to shrink a transaction log file down to a reasonable size.
Suggested Courses

850 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