Method: FDB.open_impl

Defined in:
lib/fdbimpl_v609.rb

.open_implObject



30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# File 'lib/fdbimpl_v609.rb', line 30

def self.open( cluster_file = nil )
  @@network_thread_monitor.synchronize do
    if ! @@network_thread
      init
    end
  end

  @@cache_lock.synchronize do
    if ! @@open_databases.has_key? [cluster_file]
      dpointer = FFI::MemoryPointer.new :pointer
      FDBC.check_error FDBC.fdb_create_database(cluster_file, dpointer)
      @@open_databases[cluster_file] = Database.new dpointer.get_pointer(0)
    end

    @@open_databases[cluster_file]
  end
end