On Mar 29, 2007, at 3:23 AM, James Masters wrote:

> Thanks for your very helpful reply, Jonathan.  It answered my general
> question but I'm left with a couple of more specific ones.
>
> Pl. see in line.
>
>> I do that with ~20 tables that hold data I consider 'constants'.  If
>> this data is unchanging, there's no need to continually hit the db.
>> ( note, i do this in a persistent environment , and i use that data
>> nonstop.   i think its easier putting config/constant data in a db
>> than an xml / hash )
>
> Yes, that's it. It's for data that is constant, for the purposes of  
> the
> script in question.  But I am v. interested to know how you do  
> this.  Do you
> do a Rose call and then iterate through all the objects creating a  
> hash?
> I've now written something to do this.

Pretty much, yes.
Some of it is done via rose + a loop, but much is done via generic  
sql queries too.
my applications are only ~50% rose
fwiw, i also do this: ( completely not rose related )

        for (k,v) in objects:
                hash{'id'}{ $key } = $value
        hash{'name'}= reverse $MyApp::Config::fieldname{'id'}

        ( which works, because all the related tables have name as unique )

I develop under mod_perl -- so on startup i connect to the db, pull  
all the 'static' info , and toss that into a series of hashes in a  
MyApp::Config namespace.  That info is then available to all the  
other modules after apache forks.
I don't keep complex data in there - 90% of it is just key/value  
pairs: states, dropdown select options, etc.  maybe 50k worth of  
stuff ( in terms of apache bloat ) -- but its all stuff that never  
changes and there'es a 80% chance that  a mod_perl child would have  
requested it several times by termination , so i trade memory for  
fewer db calls.

if you're under mod_perl, it might make sense to play around with the  
cache version of rose objects.

rose is *really nice* under mod perl.  it sucks a ton of memory for  
all the pregeneration of sql , but if flys soooo fast once its running.

John addressed the rest.





// Jonathan Vanasco

| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  
- - - - - - - - - - - - - - - - - - -
| SyndiClick.com
| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  
- - - - - - - - - - - - - - - - - - -
|      FindMeOn.com - The cure for Multiple Web Personality Disorder
|      Web Identity Management and 3D Social Networking
| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  
- - - - - - - - - - - - - - - - - - -
|      RoadSound.com - Tools For Bands, Stuff For Fans
|      Collaborative Online Management And Syndication Tools
| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  
- - - - - - - - - - - - - - - - - - -



-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Rose-db-object mailing list
Rose-db-object@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rose-db-object

Reply via email to