>
> Do you support multiple, concurrent long hibernate sessions in one http
> user session?
>
> I am asking because I was shocked that a really simple hibernate query
> with a little number
> of objects already used up around 64kb in the http session. so storing
> long sessions should be
> done _very_ careful. having multiple long sessions can really suck up
> your memory.
>
I had the some "oh %$%!" moment when I realized how big my sessions
were getting. So what I did was go through and hand-identify those
transaction which were atomic, and those which spanned requests. Then I only
used the long session for the request-spanning transactions e.g. wizards,
transactions which create an entire graph of objects and require all or
nothing save, etc.
Roughly 80% of my use cases are atomic transactions, so I got about
a 4 fold improvement in memory use that way.
As for multiple concurrent Hibernate sessions per HTTPSession, yeah.
I wrote my own persistence manager, and each page render has a "Persistence"
object that may (or may not) embed within it a DAO. If you bring up three
forms, I store three persistence context, each one of which could
potentially hold a DAO, and each one of which could potentially hold a
session.
One curious thing though is that I didn't find my sessions were
getting quite as big as you were. When I serialized single-object holding
sessions they were only a couple of k. How many objects do you have rattling
around in the session you're storing because usually I only have a few. I
still do housekeeping I/O through a session that I dispose of after form
render. That way I don't clutter up the long session with lots of stuff I
don't really need to bring with me to the next step in the transaction.
-- Pat
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]