Try to search your question here, if you can't find : Ask Any Question Now ?

Executing several INSERT clauses into a SQLServer database causes broken pipe

HomeCategory: stackoverflowExecuting several INSERT clauses into a SQLServer database causes broken pipe
Avatarpragati asked 3 months ago

The following code I have is running on a server where Java client executes it by simply calling a command “py”. There is a very specific usecase where this script crashes, which is giving me a headache debugging.

This script works perfectly well during any other time except during early monday when ran very first time. My primary suspection is that the database where it is executing these is somehow “a sleep” after the weekend and this causes the crash. If this code is ran minute later by hand simply executing the same command “py”, then everything works ok.

However this leads me to believe there is a fundamental problem in the code. The code causing the error is this:

for row in self.cursorLocal.fetchall():
        sqlName = "INSERT INTO TABLE ATTRIBUTE1, ATTRIBUTE2 VALUES('{}','{}')".format(row[1],row[2])
        print(sqlName) # <-- line 321

[Errno 32] Broken pipe

Traceback (most recent call last): File "", line 88, in __init__ self.InsertTo() File "", line 321, in InsertTo print(sqlName) BrokenPipeError: [Errno 32] Broken pipe 

I have tried a lot of different scenarios trying to replicate this in my local environment, but without any luck. However this same error constantly occurs every monday morning.

1 Answers
Best Answer
AvatarMatthias answered 3 months ago
Your Answer

9 + 18 =

Popular Tags

WP Facebook Auto Publish Powered By :