asfernandes / node-firebird-drivers

Node.js Firebird Drivers
MIT License
53 stars 17 forks source link

Invalid format for transaction parameter block #14

Closed gsbelarus closed 5 years ago

gsbelarus commented 5 years ago

We use XpbBuilder to build a block of transaction params as seen here:

https://github.com/gsbelarus/gdmn/blob/master/packages/gdmn-db/src/fb/utils/fb-utils.ts#L45

Randomly we gets error:

Error: invalid format for transaction parameter block -wrong version of transaction parameter block

May be you have some thoughts on what can be wrong here?

asfernandes commented 5 years ago

When you dispose the builder, the buffer returned become invalid. That's how the Firebird API works. So you should clone the buffer or hold the builder active while you are using the buffer.