?
Solved

Bulkload error in SQL Server 2008

Posted on 2010-11-22
5
Medium Priority
?
3,090 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Learn how to optimize MySQL for your business need

With the increasing importance of apps & networks in both business & personal interconnections, perfor. has become one of the key metrics of successful communication. This ebook is a hands-on business-case-driven guide to understanding MySQL query parameter tuning & database perf

Question has a verified solution.

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

In this article we will get to know that how can we recover deleted data if it happens accidently. We really can recover deleted rows if we know the time when data is deleted by using the transaction log.
In this article we will learn how to fix  “Cannot install SQL Server 2014 Service Pack 2: Unable to install windows installer msi file” error ?
Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.
Viewers will learn how to use the UPDATE and DELETE statements to change or remove existing data from their tables. Make a table: Update a specific column given a specific row using the UPDATE statement: Remove a set of values using the DELETE s…
Suggested Courses

771 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