Skip to content

Conversation

@flash-gordon
Copy link
Contributor

Hi,

I found problem with closing cursors in multithreaded AR MRI environment. It's quite trivial, see changes.

Problem occurred in multithreaded environment with shared state (class variable).
@kubo
Copy link
Contributor

kubo commented Nov 16, 2014

This pull request causes memory leaks. Once @@open_cursors[thread_id] is set, [] is never freed.

flash-gordon@d363756#diff-6cee84182ea605978815af3738661976R72 should be changed as follows:

  def self.open_cursors
    Thread.current[:plsql_oci_cursor_stack] ||= []
  end

@javornikolov
Copy link
Collaborator

@kubo, @flash-gordon - are you happy with PR #80 as final solution to the described problem? (I just applied the suggestion for using Thread.current)

@flash-gordon
Copy link
Contributor Author

@javornikolov thanks, I forget about the PR. Seems to be OK

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants