fix(hdb): Allow streaming blob in and out over the same connection #561
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Currently it is possible to have draft operations hang when using the
hdb
driver. As the draft logic will streamblob
values in/out of the database over the same connection. When using thehdb
driver theinsert
statement is claiming the connection and allreadLob
requests are queued until theinsert
statement finishes. It will never finish as the contents of the blob have to be send as part of theinsert
statement.This PR avoids this issue by opening the connection queue when the connection is actively reading a blob stream. This works as the
insert
statement claims the connection before it starts using the connection. It will first load as much data of the parameter stream into memory before sending it as a packet over the connection.This is a workaround and for it to work all the time has to be addressed inside the
node-hdb
repository.