[Catalyst] using a persistent hash in a model

John Napiorkowski jjn1056 at yahoo.com
Sat Jul 7 19:28:20 GMT 2007


--- Matt S Trout <dbix-class at trout.me.uk> wrote:

> On Sat, Jul 07, 2007 at 04:52:19PM +0200, Daniel
> McBrearty wrote:
> > Hi
> > 
> > I want to use a persistent hash in a model, using
> (I guess) Storable.
> > The hash would get inititalised in new, and
> modified in the model. I
> > would use lock_store to save any changes as data
> is modified in the
> > model class.
> > 
> > This would be OK in the test app, but as the app
> will get used under
> > fast_cgi, is this safe? Given that there can be a
> number of cat
> > instances running, presumably there will be as
> many model classes, and
> > therefore they will not be in sync as data is
> updated?
> > 
> > Is there any easy way to keep some ad-hoc
> persistent data out of the 
> > database?
> 
> For a single machine deployment I'd try DBM::Deep

++vote for DBM::Deep.  I'm using it very successfully
for adhoc stuff that I need persistence for but don't
need to keep or is not important enough for a table. 
It can even do an okay job of serializing your simple
objects. but buyer beware with that behavior.


> 
> -- 
>       Matt S Trout       Need help with your
> Catalyst or DBIx::Class project?
>    Technical Director    Want a managed development
> or deployment platform?
>  Shadowcat Systems Ltd.  Contact mst (at)
> shadowcatsystems.co.uk for a quote
> http://chainsawblues.vox.com/            
> http://www.shadowcatsystems.co.uk/ 
> 
> _______________________________________________
> List: Catalyst at lists.rawmode.org
> Listinfo:
> http://lists.rawmode.org/mailman/listinfo/catalyst
> Searchable archive:
>
http://www.mail-archive.com/catalyst@lists.rawmode.org/
> Dev site: http://dev.catalyst.perl.org/
> 



       
____________________________________________________________________________________
Sick sense of humor? Visit Yahoo! TV's 
Comedy with an Edge to see what's on, when. 
http://tv.yahoo.com/collections/222



More information about the Catalyst mailing list