-
Notifications
You must be signed in to change notification settings - Fork 181
Fix #109 bug transaction concurrency. #146
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Can one of the admins verify this patch? To accept patch and trigger a build add comment ".ok\W+to\W+test." |
Can one of the admins verify this patch? |
When can this PR could be merged? I think it is a very small and highly valuable one! 😉 |
Hello @raymondfeng. Do you have an idea of when this PR could be processed? |
Can one of the admins verify this patch? |
Can you add some tests to verify your changes and prevent regressions in the future? In addition, can you rebase with master to get the latest changes on this PR? |
Hi there, What kind of test do you expect for this PR to be merged ? TLDR: From what I saw, if you follow the callstack, that's where we start: function PostgreSQL(postgresql, settings) {
...
this.pg = new postgresql.Pool(this.clientConfig);
this.settings = settings;
...
} Down the trail, you see that PG = function(clientConstructor) {
EventEmitter.call(this);
...
this.Client = clientConstructor;
this.Pool = poolFactory(this.Client);
...
}; That's where the naming is confusing, as the Pool = module.exports = function (options, Client) {
...
this.options = objectAssign({}, options)
...
this.pool = new genericPool.Pool(this.options)
...
} here if you want to release the pool, you will have to go through the pool object in which there in an actual pool to release. |
Can one of the admins verify this patch? |
ed5f009
to
69fb828
Compare
Can one of the admins verify this patch? |
Ignore my comment. This fix has been applied in #197. Closing this PR as a result. |
@ssh24 I just did it. Thanks! |
When running more than 9 transactions at the same time, we get an error: "pool.release is not a function". at line 74 in lib/transaction.js.
I found out that this.pg is returning an EvenEmitter, containing a pool which contains the function release.
Finally, when I call
pool.pool.release
instead ofpool.release
, everything works fine and the connections are released on my pg database.This modification fixes the issue #109.