Sha256: 960543f7211c1f114fe77ac0222f3b3a2a705df4eefb30298abbef76a6dd0c33

Contents?: true

Size: 811 Bytes

Versions: 11

Compression:

Stored size: 811 Bytes

Contents

require 'neo4j-enterprise'

Neo4j::Session.register_db(:ha_db) do |*args|
  Neo4j::Embedded::EmbeddedHaSession.new(*args)
end

module Neo4j
  module Embedded
    class EmbeddedHaSession < EmbeddedSession
      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
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
neo4j-core-5.0.0.rc.3 lib/neo4j-embedded/embedded_ha_session.rb
neo4j-core-5.0.0.rc.2 lib/neo4j-embedded/embedded_ha_session.rb
neo4j-core-5.0.0.rc.1 lib/neo4j-embedded/embedded_ha_session.rb
neo4j-core-4.0.7 lib/neo4j-embedded/embedded_ha_session.rb
neo4j-core-4.0.6 lib/neo4j-embedded/embedded_ha_session.rb
neo4j-core-4.0.5 lib/neo4j-embedded/embedded_ha_session.rb
neo4j-core-4.0.4 lib/neo4j-embedded/embedded_ha_session.rb
neo4j-core-4.0.3 lib/neo4j-embedded/embedded_ha_session.rb
neo4j-core-4.0.2 lib/neo4j-embedded/embedded_ha_session.rb
neo4j-core-4.0.1 lib/neo4j-embedded/embedded_ha_session.rb
neo4j-core-4.0.0 lib/neo4j-embedded/embedded_ha_session.rb