Forum OpenACS Q&A: Response to Storing java Objects in PostgreSQL

Collapse
Posted by Joshua Ginsberg on
Thank you for responding... sorry I've not been, but I've been out of town with a wonderful 16.8K Internet connection, so I've not been checking mail as frequently as I would normally...

Krzysztof and Dan - I would love to be able to have some alternate thread to store Java Objects which could interact with client threads... unfortunately, my C hacking skills are @!$#...

Dan - I'm familiar with the caching issues which you've mentioned... The particular application that I'm discussing right now is a WYSIWYG web-based HTML editor... I've got controls in place to make sure that the cache does not overflow with abandoned objects... this control includes sweeping the database periodically for orphaned sessions, making sure that there does not exist more than one cached Object for each user, and if a user comes back to the editor when there is already a cached object for that user, it is given back to the user under their new session identifier... I'm not too particularly worried about DoS attacks because of the cache control I just mentioned and because access to the editor requires deliberate authorization from the sysadmin...

Dan and John - I've considered moving to a servlet engine, but I'm not wanting to because of a couple of reasons... first, I love TclBlend... it has done incredible things for the applications I've written... second, I'm trying to find a reasonable way to extend the ideal of TclBlend (TCL scripting code gluing together large, reusable, application components written in Java) to AOLServer... Dan's ns_tclblend module is a foot in the door, but I'm looking for a way to really make this a viable choice other than loading a separate application server...

So, all of that having been said...

It's true... db's are a massive bottleneck, and the serialization/stick-in-db/pull-from-db/deserialization process from page to page would be a resource hog... so now I'm left with trying to find some sort of built-in mechanism within AOLServer to preserve values between threads... nsv buckets seem inappropriate... are there other options I'm not considering?  Some sort of persistent set where I can make a user's sessionid the key and the Java Object the value? Would the Object be saved from garbage collection by such a method?

Thanks again for your feedback...

-jag