Marshal.load cannot load Marshal.dump result
--------------------------------------------
Key: JRUBY-5175
URL: http://jira.codehaus.org/browse/JRUBY-5175
Project: JRuby
Issue Type: Bug
Components: Core Classes/Modules
Affects Versions: JRuby 1.5.3
Environment: Mac OS X, Linux
Reporter: Raimonds Simanovskis
When running ActiveRecord tests from Rails master branch on Oracle database
using oracle_enhanced adapter the following test fails
def test_marshalling_extensions
david = developers(:david)
assert_equal projects(:action_controller), david.projects.find_most_recent
david = Marshal.load(Marshal.dump(david))
assert_equal projects(:action_controller), david.projects.find_most_recent
end
which fails with
ArgumentError: dump format error()
./test/cases/associations/extension_test.rb:38:in `load'
When I inspect Marshal.dump(david) I get
"\004\bo:\016Developer\016:\...@changed_attributes{\000:\...@marked_for_destructionf:\...@attributesic:\037ActiveSupport::OrderedHash{\n\"\aidi\006\"\tname\"\nDavid\"\vsalaryi\003\2008\001\"\017created_atu:\tTime\r\324\250\e\200\000\000\220X\"\017updated_atu;\n\r\324\250\e\200\000\000\220X\006:\...@keys[\n\"\aid\"\tname\"\vsalary\"\017created_at\"\017updated_at:\...@destroyedf:\...@previously_changed{\000:\...@attributes_cache{\000:\...@new_recordf:\...@projectse:*DeveloperProjectsAssociationExtensiono:?ActiveRecord::Associations::HasAndBelongsToManyAssociation\f:\...@_named_scopes_cache{\000:\...@target[\ao:\fProject\016;\006{\000;\aF;\bIC;\t{\f\"\aidi\a\"\tname\"\026Active
Controller\"\ttype0\"\021developer_idi\006\"\017project_idi\a\"\016joined_onu;\...@%\032\200\000\000\000\000\"\021access_leveli\006\006;\v[\f\"\aid\"\tname\"\ttype\"\021developer_id\"\017project_id\"\016joined_on\"\021access_level;\fF:\...@developers_log[\000;\r{\000;\016{\000;\017F:\...@readonlyto;\025\016;\006{\000;\aF;\bIC;\t{\f\"\aidi\006\"\tname\"\022Active
Record\"\ttype0\"\021developer_idi\006\"\017project_idi\006\"\016joined_onu;\...@%\032\200\000\000\000\000\"\021access_leveli\006\006;\v[\f@(@)@*...@+@,@-...@.;\fF;\026[\000;\r{\000;\016{\000;\017F;\027T:\...@loadedt:\...@updatedf:\...@reflectiono:4ActiveRecord::Reflection::AssociationReflection\020:\...@name:\rprojects:\...@association_foreign_key\"\017project_id:\...@options{\a:\vextend[\006m*DeveloperProjectsAssociationExtension:\017join_table\"\030developers_projects:\...@class_name\"\fProject:\...@columns[\to:;ActiveRecord::ConnectionAdapters::OracleEnhancedColumn\020:\...@precisioni+;\034\"\021developer_id:\...@default0:\...@scalei\000:\...@type:\finteger:\...@limiti+:\...@table_name@G:\...@primary0:\...@nullf:\...@forced_column_type0:\...@sql_type\"\017NUMBER(38)o;$\020;%i+;\034\"\017project_id;&0;'i\000;(;);*i+;+...@g;,0;-F;.0;/\"\017NUMBER(38)o;$\020;%0;\034\"\016joined_on;&0;'0;(:\rdatetime;*0;+...@g;,0;-T;.0;/\"\tDATEo;$\020;%i+;\034\"\021access_level;&i\006;'i\000;(;);*i+;+...@g;,0;-T;.0;/\"\017NUMBER(38):\...@collectiont:\...@active_recordc\016developer:\...@primary_key_name\"\021developer_id:\...@klassc\fproject:\...@macro:\034has_and_belongs_to_many:\...@quoted_table_name\"\017\"PROJECTS\":\...@scope{\a:\tfind{\v:\017conditions\",\"DEVELOPERS_PROJECTS\".developer_id
= 1 :\njoins\"YINNER JOIN \"DEVELOPERS_PROJECTS\" ON \"PROJECTS\".id =
\"DEVELOPERS_PROJECTS\".project_id:\rreadonlyF:\norder0:\finclude0:\nlimit0:\vcreate{\000:\...@owner@\000;\027F"
I assume that it is some specific JRuby Marshal implementation bug as normally
you should always be able to Marshal.load the result of Marshal.dump.
Maybe you have some suggestions how to find where exactly this dump format
error is happening?
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email