This project is archived and is in readonly mode.
JRuby - FlashHash not saving in session when storing ActiveRecord items
-
Justin Coyne
Jarred. I'm using Jruby and have had problems with Cookie Store. We're having good luck with ActiveRecord Store and Servlet Session Store (if deploying in a servlet container)
-
Jarred Nicholls
Thanks Justin for sharing. I planned to setup Memcached anyways so maybe I wouldn't have an issue with a memcached session store. I still went back to MRI for now...the amount of memory the JVM instance took up was too high for my current situation (even after adjusting heap and GC gen. sizes).
-
Bryan Larsen
We're running into the same problem here, and it affects both ActiveRecordStore and CookieStore. We can work around it with the attached patch. If we do that, we then run into this JRUBY bug: http://jira.codehaus.org/browse/JRUBY-3664
-
Bryan Larsen
Note that contrary to the title, we are not storing any ActiveRecord items in the session or in the FlashHash.
-
Jarred Nicholls
Yeah, I actually did the same thing as the attached patch, but that opened up many more cans of worms. The fundamental issue is that the flash hash ceases to (de)serialize with certain content in it. I think sticking to primitive types is the only way to be safe.
-
Emrys Ingersoll
I'm also running into this problem using the JavaServletStore from the jruby-rack project as the session_store (Rails 2.3.5, jruby-rack-0.9.5, JRuby 1.4, Java 1.6.0_18 64bit on Linux 64bit). I get the same exception at same line (111) of action_controller/flash.rb
-
Emrys Ingersoll
I just built the current JRuby trunk as of commit 2770c7f5720aa23048fbef93b24140195be240ed and replaced JRuby 1.4 with the trunk version in my aforementioned environment and the problem appears to be solved.
I would, tentatively, label this a JRuby issue and not Rails. Though, confirmation that this works for others would be good to have first.
-
mtyaka
- Tag set to jruby
This was a JRuby issue that was resolved in JRuby 1.5. It was caused by a bug in JRuby's Marshal.load.
See tickets http://jira.codehaus.org/browse/JRUBY-4442 and http://jira.codehaus.org/browse/JRUBY-3530 for more information. This ticket can be closed. -
Rohit Arondekar
- State changed from new to resolved
