Closed ajozz13 closed 6 years ago
Hi, No, prepared statements created within a context don't get dismissed when the context ends. The context is only used to tie the statement to a connection within the connection pool (so the transactions work properly).
Although, I agree when closing a context all prepared statements within that context should be freed as well. I'll take a look.
Thanks for reporting this.
Thanks for checking...will statement free() call close the statement?
Regards Alberto
On Feb 24, 2018 17:52, "Uditha Atukorala" notifications@github.com wrote:
Hi, No, prepared statements created within a context don't get dismissed when the context ends. The context is only used to tie the statement to a connection within the connection pool (so the transactions work properly).
Although, I agree when closing a context all prepared statements within that context should be freed as well. I'll take a look.
Thanks for reporting this.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/nukedzn/node-informix/issues/53#issuecomment-368266710, or mute the thread https://github.com/notifications/unsubscribe-auth/AAld11tjqypZFlz_8FTiK3MEaOHvdNalks5tYJLIgaJpZM4SR9hv .
Yup, that'll do the trick.
Great...I'll try the functionality calling the free statement before closing the context. Regards Alberto
On Feb 24, 2018 18:37, "Uditha Atukorala" notifications@github.com wrote:
Yup, that'll do the trick.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/nukedzn/node-informix/issues/53#issuecomment-368269159, or mute the thread https://github.com/notifications/unsubscribe-auth/AAld15Ent39cU-2mki8_Wwxn9DxDC7Snks5tYJ1AgaJpZM4SR9hv .
Hello, I created a wrap function returning a promise that executes, captures a serial key after insertion. and ends the context after each successful entry, however on a subsequent calls the following error message is captured;
Error: A Statement is already prepared with the same ID. at /home/aochoa/services/ibc_informix/node_modules/informix/lib/statement.js:176:16 at new Promise ()
at /home/aochoa/services/ibc_informix/node_modules/informix/lib/statement.js:171:11
at
I understood that upon closing the context the prepared statement gets dismissed, is this correct?
here is the code of the wapper function