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



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

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
# 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)

  verbose_query_logs = Neo4j::Config.fetch(:verbose_query_logs, false)
  adaptor = cypher_session_adaptor(type, url_or_path, options.merge(wrap_level: :proc,
                                                                    verbose_query_logs: verbose_query_logs))
  session = Neo4j::Core::CypherSession.new(adaptor)
  wait_and_retry(session) if wait_for_connection
  session
end