#213 ✓invalid
Dmytrii Nagirniak

ReadOnlyDbException from the rails console

Reported by Dmytrii Nagirniak | December 12th, 2011 @ 07:14 AM

Fir started the server, then console (so this FAQ doesn't apply).

It is supposed to work as far as I understand.

Within the console run something like User.count and you'll get:

User.count
NativeException: org.neo4j.kernel.impl.core.ReadOnlyDbException: This is a read only embedded Neo4j instance
    from org/neo4j/kernel/impl/core/ReadOnlyNodeManager.java:50:in `createNode'
    from org/neo4j/kernel/EmbeddedGraphDbImpl.java:314:in `createNode'
    from org/neo4j/kernel/EmbeddedReadOnlyGraphDatabase.java:104:in `createNode'
    from /Users/dnagir/proj/neo4j/lib/neo4j/node.rb:232:in `new'
    from /Users/dnagir/proj/neo4j/lib/neo4j/rule/rule_node.rb:56:in `create_node'
    from /Users/dnagir/proj/neo4j/lib/neo4j/transaction.rb:57:in `run'
    from /Users/dnagir/proj/neo4j/lib/neo4j/rule/rule_node.rb:55:in `create_node'
    from /Users/dnagir/proj/neo4j/lib/neo4j/rule/rule_node.rb:34:in `rule_node'
    from org/jruby/javasupport/JavaObject.java:285:in `synchronized'
    from org/jruby/javasupport/JavaProxyMethods.java:90:in `synchronized'
    from /Users/dnagir/proj/neo4j/lib/neo4j/rule/rule_node.rb:33:in `rule_node'
    from /Users/dnagir/proj/neo4j/lib/neo4j/rule/rule_node.rb:113:in `traversal'
    from /Users/dnagir/proj/neo4j/lib/neo4j/rule/class_methods.rb:106:in `_all'
    from /Users/dnagir/proj/neo4j/lib/neo4j/rails/finders.rb:130:in `all'
    from /Users/dnagir/proj/neo4j/lib/neo4j/rails/finders.rb:152:in `count'
    from (irb):6:in `evaluate'
    from org/jruby/RubyKernel.java:1093:in `eval'
    from org/jruby/RubyKernel.java:1420:in `loop'
    from org/jruby/RubyKernel.java:1206:in `catch'
    from org/jruby/RubyKernel.java:1206:in `catch'
    from /Users/dnagir/.rvm/gems/jruby-1.6.5/gems/railties-3.1.3/lib/rails/commands/console.rb:45:in `start'
    from /Users/dnagir/.rvm/gems/jruby-1.6.5/gems/railties-3.1.3/lib/rails/commands/console.rb:8:in `start'
    from /Users/dnagir/.rvm/gems/jruby-1.6.5/gems/railties-3.1.3/lib/rails/commands.rb:40:in `(root)'
    from org/jruby/RubyKernel.java:1047:in `require'
    from script/rails:6:in `(root)'

Comments and changes to this ticket

  • Andreas Ronge

    Andreas Ronge December 12th, 2011 @ 04:23 PM

    • Assigned user set to “Andreas Ronge”

    The only explanation I can think of is that you started the the console with an empty database.
    If there is an empty database it will then create 'class' nodes (which I call rule nodes) which in turn needs write access to the database.

    I've tested with the latest source from github in my rails project and it worked for:

    [emsweb master] $ rails console
    Development DB /home/andreas/projects/emsweb/db/neo4j-development
    Enable remote shell at port port=9332
    Starting Neo4j in readonly mode since the /home/andreas/projects/emsweb/db/neo4j-development is locked
    Loading development environment (Rails 3.0.10)
    jruby-1.6.5 :001 > User.count
     => 1
    
  • Dmytrii Nagirniak

    Dmytrii Nagirniak December 13th, 2011 @ 12:28 AM

    Thanks. I think that is the case.

    What I've is just started the rails console and run a query. The stopped, started rails server. The again rails console. From that point all worked.

    So I guess you can close this issue.

    Cheers.

  • Andreas Ronge

    Andreas Ronge December 13th, 2011 @ 02:42 PM

    • State changed from “new” to “invalid”

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

Neo4j.rb is a graph database framework for JRuby.

It provides:

* Mapping of ruby objects to nodes in networks rather than in tables.
* Storage of ruby object to a file system.
* Fast traversal of relationships between nodes in a hugh node space.
* Transaction with rollbacks support.
* Indexing and quering of ruby objects.
* Integration with Rails

People watching this ticket

Pages