mojolicious / mojo-pg

Mojolicious :heart: PostgreSQL
https://metacpan.org/release/Mojo-Pg
Artistic License 2.0
99 stars 46 forks source link

Fixed reusing dbh when sth is still exists. #37

Closed kak-tus closed 7 years ago

kak-tus commented 7 years ago

Summary

Fix of referenced issue. We store db object to results object to prevent inconsistent behavior.

Motivation

When we using async operations, and got db and results object - we can pass result object to subfunction. After that result object continues to exists, and db - not, so DESTROY on db called and dbh returns to queue.

References

https://github.com/kraih/mojo-pg/issues/36

kraih commented 7 years ago

I'm afraid pull requests cannot be accepted without tests and documentation.

kak-tus commented 7 years ago

I've added one test, that fails on master version and passes with this fix. But I don't know, what documentation may be in this case.

kraih commented 7 years ago

Since this is supposed to fix the AnyEvent specific problem from #36, i don't think it makes sense to vote on this pull request.