Skip to content

Instantly share code, notes, and snippets.

@tobiashm
Created March 7, 2014 08:56
Show Gist options
  • Save tobiashm/9407978 to your computer and use it in GitHub Desktop.
Save tobiashm/9407978 to your computer and use it in GitHub Desktop.
Thread safety for ruby-plsql
require "ruby-plsql"
require "thread"
module PLSQL
module SynchronizedProcedure
def ensure_tmp_tables_created(overload)
@@semaphore ||= Mutex.new
@@semaphore.synchronize { super }
end
end
Procedure.class_eval do
include SynchronizedProcedure
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment