Class: Neo4j::SessionManager

Inherits:
Object
  • Object
show all
Defined in:
lib/neo4j/session_manager.rb

Class Method Summary collapse

Class Method Details

.adaptor_class(type, options) ⇒ Object


19
20
21
# File 'lib/neo4j/session_manager.rb', line 19

def adaptor_class(type, options)
  options[:adaptor_class] || adaptor_class_by_type(type.to_sym)
end

.open_neo4j_session(type, url_or_path, wait_for_connection = false, options = {}) ⇒ Object


7
8
9
10
11
12
13
14
15
16
17
# File 'lib/neo4j/session_manager.rb', line 7

def open_neo4j_session(type, url_or_path, wait_for_connection = false, options = {})
  enable_unlimited_strength_crypto! if java_platform? && session_type_is_embedded?(type)

  adaptor = wait_for_value(wait_for_connection, Neo4j::Core::CypherSession::ConnectionFailedError) do
    verbose_query_logs = Neo4j::Config.fetch(:verbose_query_logs, false)
    cypher_session_adaptor(type, url_or_path, options.merge(wrap_level: :proc,
                                                            verbose_query_logs: verbose_query_logs))
  end

  Neo4j::Core::CypherSession.new(adaptor)
end