#1022 ✓not-applicable
Łukasz Adamczak

DataMapper, JRuby and sqlite3 error

Reported by Łukasz Adamczak | August 28th, 2009 @ 08:23 AM

I'm trying to get JRuby+DataMapper combo work with sqlite3 database.

I have this script:

require 'rubygems'
require 'dm-core'
require 'pp'

DataMapper.setup(:default, "sqlite3:///Users/Czak/tmp/datamapper/development.sqlite3")

class Event
  include DataMapper::Resource

  property :id,           Integer, :serial => true
  property :title,        String
  property :description,  Text
end

# Just get an item
pp Event.first

It works perfectly under MRI Ruby 1.8.7, but fails under JRuby 1.3.1. The error is:

/opt/jruby-1.3.1/lib/ruby/gems/1.8/gems/dm-core-0.9.11/lib/dm-core/adapters/data_objects_adapter.rb:68:in `read_one': (sql_state=null) column -1 out of bounds [1,2] (Sqlite3Error)
    from /opt/jruby-1.3.1/lib/ruby/gems/1.8/gems/dm-core-0.9.11/lib/dm-core/adapters/data_objects_adapter.rb:173:in `with_connection'
    from /opt/jruby-1.3.1/lib/ruby/gems/1.8/gems/dm-core-0.9.11/lib/dm-core/adapters/data_objects_adapter.rb:61:in `read_one'
    from /opt/jruby-1.3.1/lib/ruby/gems/1.8/gems/dm-core-0.9.11/lib/dm-core/repository.rb:72:in `read_one'
    from /opt/jruby-1.3.1/lib/ruby/gems/1.8/gems/dm-core-0.9.11/lib/dm-core/model.rb:267:in `first'

The current gems installed for JRuby:

addressable (2.0.2)
data_objects (0.9.12)
dm-core (0.9.11)
dm-migrations (0.9.11)
do_jdbc (0.9.12)
do_sqlite3 (0.9.12)
jdbc-sqlite3 (3.6.3.054)

I can't tell from the documentation if JRuby is or is not supported, so I'm submitting here.

Comments and changes to this ticket

  • Łukasz Adamczak

    Łukasz Adamczak August 28th, 2009 @ 08:26 AM

    Sorry about the formatting, it seems I can't update it now.

  • Alex Coles

    Alex Coles September 1st, 2009 @ 04:28 AM

    • Assigned user set to “Alex Coles”
    • State changed from “new” to “not-applicable”

    I'm going to mark this as not-applicable for the time-being, as JRuby support in 0.9.12 was not complete and we did not have all of our spec suite passing at the time of release.

    Pending the next release, try "edge" DataMapper: http://gist.github.com/159270

    If you experience the same issue, please let me know and I'll reopen the ticket.

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 »

People watching this ticket

Pages