Skip to content

Conversation

sahilarora946
Copy link

Description

This fixes the issue described in #230

Related issues

#129

Refer to rollback function in https://github.com/zbarbuto/loopback-connector-postgresql/blob/1361460cea86fadd14a68aa8fe9c55f14ecb9a6d/lib/transaction.js#L58-L86

After the ROLLBACK is executed, callback will be sent to the event loop to be executed. Event loop can pick any of the available callbacks to execute. It can pick another function that can do database calls in the same transaction and because releaseConnection has not been called, the statement will execute.
To stop the execution,connection.txId should be set to null without waiting for the callback of ROLLBACK to be called

@slnode
Copy link

slnode commented Apr 24, 2018

Can one of the admins verify this patch? To accept patch and trigger a build add comment ".ok\W+to\W+test."

@zbarbuto
Copy link
Contributor

Thanks for the PR - could you please fix up the commit message to satisfy the linter.

sahil added 3 commits April 24, 2018 13:55
so that no further queries can be executed in the same transaction
after rollback has been executed
…/github.com/sahilarora946/loopback-connector-postgresql into stop-executing-queries-on-ended-transaction

* 'stop-executing-queries-on-ended-transaction' of https://github.com/sahilarora946/loopback-connector-postgresql:
  fix lint error
  set txid to null, so that no further queries can be executed in the same transaction
@sahilarora946 sahilarora946 deleted the stop-executing-queries-on-ended-transaction branch April 24, 2018 08:30
@sahilarora946
Copy link
Author

Created another pull request for this. Kindly ignore this one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants