Solved

Bulkload error in SQL Server 2008

Posted on 2010-11-22
5
3,053 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

In this article I will describe the Copy Database Wizard method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
This article shows gives you an overview on SQL Server 2016 row level security. You will also get to know the usages of row-level-security and how it works
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function
Via a live example, show how to shrink a transaction log file down to a reasonable size.

920 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now