Has anyone else encountered this bug?
I recently upgraded from Jruby 1.1.4 with activerecord-jdbc-adapter 0.9
to the latest version of both, and I now find that when I find an
instance of a model from the database all the attributes come back as
type string rather than the correct type appropriate to the column in
the database.
I described the problem to nicksieger but he said he didn’t have time to
look at it, so suggested that I ask if anyone on the mailing list had
encountered this problem.
This is what happens:
e = Entry.find(‘1atp’)
=> #
e.attributes
=> {“deposit_site”=>nil, “descriptor”=>“CAMP-DEPENDENT PROTEIN KINASE
(E.C.2.7.1.37) (C/APK) (CATALYTIC SUBUNIT) COMPLEX WITH THE PEPTIDE
INHIBITOR PKI(5-24) AND MNATP (A TERNARY COMPLEX OF CAPK)”,
“first_rev_date”=>“1993-04-15”, “id”=>“1atp”,
“keywords”=>“TRANSFERASE(PHOSPHOTRANSFERASE)”, “major_version”=>“3”,
“method”=>“x-ray diffraction”, “method_class”=>“x-ray”,
“minor_version”=>“2”, “number_boundmols”=>“3”, “number_polymers”=>“2”,
“number_residues”=>“373”, “pdb_rev_date”=>“2009-02-24”,
“pdb_rev_date_original”=>“1993-01-08”, “process_site”=>nil,
“r_factor”=>“.177”, “r_factor_free”=>nil, “resolution”=>“2.2”,
“revision_date”=>“2008-03-03”, “status_code”=>“REL”, “title”=>“2.2
angstrom refined crystal structure of the catalytic subunit of
cAMP-dependent protein kinase complexed with MNATP and a peptide
inhibitor”}
Whereas it used to be like this:
e = Entry.find(‘1atp’)
=> #<Entry id: “1atp”, method: “x-ray diffraction”, method_class:
“x-ray”, resolution: 2.2, r_factor: 0.177, r_factor_free: nil,
pdb_rev_date_original: “1993-01-08”, first_rev_date: “1993-04-15”,
pdb_rev_date: “2009-02-24”, major_version: 3, minor_version: 2,
revision_date: “2008-03-03”, status_code: “REL”, deposit_site: nil,
process_site: nil, keywords: “TRANSFERASE(PHOSPHOTRANSFERASE)”,
descriptor: “CAMP-DEPENDENT PROTEIN KINASE (E.C.2.7.1.37) (C/APK…”,
title: “2.2 angstrom refined crystal structure of the catal…”,
number_residues: 373, number_polymers: 2, number_boundmols: 3>
(more details @ http://kenai.com/jira/browse/ACTIVERECORD_JDBC-136)
As you might imagine, everything is horribly broken now the only data
type that comes back is string.
I’m wondering if it’s something to do with activerecord-jdbc-adapter not
handling synonyms correctly, as the ‘table’ the model corresponds to is
actually a synonym to a table. If I do Entry.columns I get [] back
rather than the big bunch of stuff I used to get on Jruby 1.1.4.
Anyone got any ideas?
Thanks,
-Rob
“98.5% of DNA is considered to be junk DNA with no known purpose. Maybe
it’s XML tags.”