Class: Neo4j::Embedded::EmbeddedHaSession
- Inherits:
-
EmbeddedSession
- Object
- Session
- EmbeddedSession
- Neo4j::Embedded::EmbeddedHaSession
- Defined in:
- lib/neo4j-embedded/embedded_ha_session.rb
Instance Attribute Summary
Attributes inherited from EmbeddedSession
#db_location, #graph_db, #properties_file
Instance Method Summary (collapse)
Methods inherited from EmbeddedSession
#_load_node, #_load_relationship, #_query, #_query_or_fail, #begin_tx, #close, #create_label, #create_node, #db_type, #factory_class, #find_all_nodes, #find_nodes, #initialize, #inspect, #load_node, #load_relationship, #query, #query_default_return, #running?, #search_result_to_enumerable, #shutdown, #version
Methods included from Core::TxMethods
Methods inherited from Session
#_query, #auto_commit?, #begin_tx, #close, current, current!, #db_type, inspect, named, on_session_available, open, open_named, query, #query, #running, set_current, #shutdown, user_agent_string
Constructor Details
This class inherits a constructor from Neo4j::Embedded::EmbeddedSession
Instance Method Details
- (Object) start
10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/neo4j-embedded/embedded_ha_session.rb', line 10 def start fail Error, 'Embedded HA Neo4j db is already running' if running? puts "Start embedded HA Neo4j db at #{db_location}" factory = Java::OrgNeo4jGraphdbFactory::HighlyAvailableGraphDatabaseFactory.new db_service = factory.newHighlyAvailableDatabaseBuilder(db_location) fail Error, 'Need properties file for HA configuration' unless properties_file db_service.loadPropertiesFromFile(properties_file) @graph_db = db_service.newGraphDatabase Neo4j::Session._notify_listeners(:session_available, self) end |