[Seaside] Request start/end (and Glorp)
philippe.marschall at gmail.com
Sun Jan 19 19:17:23 UTC 2014
On Sun, Jan 19, 2014 at 8:41 AM, Daniel Lyons <fusion at storytotell.org> wrote:
> I'm thinking about integrating Glorp with a Seaside app. Based on the earlier conversation on the Glorp group between Esteban Maringolo and Alan Knight (https://groups.google.com/forum/#!topic/glorp-group/pNw3fpPE1wk) three possibilities were offered:
> 1. "In the model of a client-server application normally you would create a session when the user logs in and discard it when they log out. In a web application you may want to associate one with the user's session. In a really high-volume application where you don't want to keep a per-user cache around you might create and destroy them more frequently."
> This can be done by hitching a ride on #initialize and #unregister, yes?
> 2. "Or more likely, empty the cache and re-use them."
> In order to do that, I think I'd need a pool of some kind to check Glorp sessions in/out at request start and completion. Is there a hook in Seaside that the WASession can tie into to do work at those moments?
> I see references to GlorpSession etc. in the Seaside codebase (the class comment on WAApplication, for instance) but I don't see a package with that around. Is this a VW-specific piece of functionality?
I don't know but it sounds like somebody already implemented what you need.
In JPA/Hinternate you would usually create an
EnityManager/HibernateSesion per request (can be done with a request
filter). Enities that stay around longer (are referenced from either
the session or components) would then get dettached/attached on a per
More information about the seaside