cds-dbs icon indicating copy to clipboard operation
cds-dbs copied to clipboard

fix(hdb): Allow streaming blob in and out over the same connection

Open BobdenOs opened this issue 10 months ago • 2 comments

Currently it is possible to have draft operations hang when using the hdb driver. As the draft logic will stream blob values in/out of the database over the same connection. When using the hdb driver the insert statement is claiming the connection and all readLob requests are queued until the insert statement finishes. It will never finish as the contents of the blob have to be send as part of the insert 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.

BobdenOs avatar Apr 02 '24 12:04 BobdenOs

@BobdenOs can we also try to fix this in HDB? Because with this solution we would have for lobs always two database connections. What do you think?

soccermax avatar Apr 02 '24 13:04 soccermax

@soccermax the way hdb has setup its connection queue makes it a fundamental part of the library. It might be possible to have the insert return early just like hana-client, but I was not able to pinpoint where to do this. So rather then putting to much time into investigating that option. I wanted to have a possible solution first.

BobdenOs avatar Apr 02 '24 13:04 BobdenOs