Skip to content
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

Use with_connection instead of calling release_connection directly #340

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

jmarianer
Copy link

Reviving #320 under a different organization and on the latest version of master.

The call to release_connection, added in #263, might release a connection that was opened outside of has_closure_tree (if the caller is loaded dynamically in the middle of some other operation). This is especially problematic if the connection has an ongoing transaction, as that transaction will be lost.

This PR changes has_closure_tree to use with_connection instead, which only releases a connection if it was acquired. If a connection already existed prior to the call to has_closure_tree, it won't be released.

@seuros made a comment on the previous version of this PR about Databaseless setup, which I didn't understand. If someone could point me at a doc/readme/whatever I'll gladly add the necessary tests.

…ince the latter may release a connection that belongs to someone else
@jmarianer
Copy link
Author

I recently rediscovered this PR. What can I do to help get this merged?

@seuros seuros self-assigned this Jun 14, 2019
William Shupe and others added 2 commits June 26, 2019 14:02
This commit fixes an issue where a database proxy tries
to access the type_caster on the aliased arel table. Since
this is just an alias table of the current model, it makes
sense to use the current model's type_caster for the alias.
Fix hierarchy cleanup error when using type_caster
@n-rodriguez
Copy link
Contributor

I recently rediscovered this PR. What can I do to help get this merged?

Can you please rebase on master branch? Thank you!

@jmarianer
Copy link
Author

Unfortunately I no longer have access to instructure-bridge as I don't work for Instructure any more. Maybe @williamshupe can? I'm not sure if this will ping him, but unfortunately I don't have a better way of contacting him.

@williamshupe
Copy link

I no longer have access to the repository either, sorry.

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.

None yet

7 participants