Files
metasploit-gs/lib/msf/core/db_objects.rb
T

46 lines
810 B
Ruby
Raw Normal View History

2006-03-21 04:37:48 +00:00
module Msf
2006-03-21 04:37:48 +00:00
##
#
# This module defines all of the DB database tables
# and creates ActiveRecord objects for each one of them
#
##
class DBManager
2006-04-03 04:33:30 +00:00
class Lock
@@mutex = Mutex.new
def self.mutex
@@mutex
end
end
# ActiveRecord/sqlite3 has locking issues when you update a table with a pending select
# This set of instance/class wrappers should prevent a table lock
2009-11-16 15:16:08 +00:00
# Straight up gangsta from spoon (ripped from BION)
2006-04-03 04:33:30 +00:00
module DBSave
2006-04-03 04:50:26 +00:00
def self.included(mod)
class << mod
def find(*args)
ActiveRecord::Base.connection_pool.clear_stale_cached_connections! if ActiveRecord::Base.connection_pool
super(*args)
end
def save(*args)
ActiveRecord::Base.connection_pool.clear_stale_cached_connections! if ActiveRecord::Base.connection_pool
super(*args)
end
2006-04-03 04:50:26 +00:00
end
2006-04-03 04:33:30 +00:00
end
2006-04-03 04:33:30 +00:00
end
2006-03-21 04:37:48 +00:00
end
end