On Thursday 11 September 2008 05:58:31 pm Nigel Stuckey wrote: > Matt > > I stand corrected on DBIx! Yes, indeed I mean DBIx::Class. > > The code is in and works, but has a couple of issues. Firstly, it > creates new classes and carries out a DB connect every time there is > a request. Is there a way to make it more efficient by caching the > classes and DB connects once there is a successful authentication? > If you know what all of the possible "organizations" are, then write a model that instantiates all the DB connections (schemas, whatever) at 'new' time, then returns the appropriate one at ACCEPT_CONTEXT time. It's the "here's one we prepared earlier" approach. If that's not feasible, it should be obvious how to change it to doing nothing at startup, creating connections on demand, and "caching" them for the life of the process.
Andrew _______________________________________________ List: Catalyst@lists.scsys.co.uk Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/ Dev site: http://dev.catalyst.perl.org/