question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

"Connection Closed before request completed" error when update with long string on SQL Server

See original GitHub issue

I have a table in SQL Server with a column of type varbinary. I use STRING.BINARY to model the column in Sequelize.

      signature: {
        type: DataTypes.STRING.BINARY,
        allowNull: true,
        field: 'Signature',
        get() {
          let s = this.getDataValue('signature');
          if (s) {
            let buf = Buffer.from(s);
            return buf.toString('base64');
          } else {
            return null;
          }
        },
        set(val) {  /* not working. Sequelize stop generating create/update statement. */
          let buf = Buffer.from(val, 'base64');
          this.setDataValue('signature', buf);
        },
      },

I use GraphQL to create service. So the signature column uses base64 string type in the API. In the get() method, I convert the binary data to base64 string and it is working fine. But how do I set the base64 string to binary type in the set() method?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:10 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
ricklangcommented, Jul 16, 2019

It looks like a problem with tedious. I file a new issue there. tedious issue 923.

1reaction
ricklangcommented, Jul 15, 2019

Looks like increase the tedious packet size could solve the problem.

options: {
   packetSize: 65536

But I don’t know how it will affect the perfornance. Also whether I can set it just on a query by query basis.

Read more comments on GitHub >

github_iconTop Results From Across the Web

node.js - Connection closed before request completed
I am trying to connect to Azure SQL DB ...
Read more >
An existing connection was forcibly closed (OS error 10054)
Describes scenarios in which an existing connection was forcibly closed by the remote host and provides resolutions for these scenarios.
Read more >
Common Reasons Why Connections Stay Open for a Long ...
Some of the most common issues that can lead to connections staying open for longer than intended are the following: Applications Not Properly...
Read more >
2 Server Error Message Reference - MySQL :: Developer Zone
Each server error message includes an error code, SQLSTATE value, ... Message: The data source connection string '%s' is not in the correct...
Read more >
SQL Connection Strings tips
How to connect SQL Server using a connection string. We can use the following connection string for the SQL Server authentication. In this...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found