> On Wed, Feb 26, 2003 at 12:31:57PM -0700, mso@... wrote:
>> Clark wrote:
>> > So, in short, Webware adds a Page abstraction,
>> > with the notion that it isn't a singleton and can be put to sleep()
>> but I really don't see any advantage that this extra complexity
>> > over just storing what you need in the Request object.
>> Page is just a convenience feature. Some people find it helpful to
>> have that framework out of the box. But if it gets in your way,
>> bypass it.
> In fact I have never play enought w/ webware to understand that Page
> shouldn't be used to store some values, cause this only affect one
> servlet not the others. But i got a question so where should i wrap
> things like DB access, or a cache manager which shoud be unique in my
> case ? This not really clear for me.
I haven't personally delved into persistence, but the following seems to
PERSISTENT FOR: WHERE TO STORE:
awake-respond-sleep of this transaction in the transaction
several transactions this session in the session
the user across several sessions in something keyed by user
not user specific in a module global
Saving data in the Page instance may be reliable, but it runs the risk
that the info will leak into a future unrelated transaction if servlet
caching is on. If you religiously initialize your variables in .awake()
and blank them out in .sleep(), this is presumably a non-issue, assuming
no exception happens during .awake() and .sleep() that bypasses your
My preference is to put everything in module variables unless it has a
good reason to go elsewhere.