> The implementation of the write() method in
> cirrus.hibernate.collections.PersistentCollection
> states:
> 
> This means the session needs to be open.
> Also, the Docs mentions that lazy collections
> need to have an open session.

Gavin:

I have also other problems with lazy collections. I get WARNings about
Unclosed Sessions (finalize method in SessionImpl). I use Maverick Web
MVC Framework and it has discard() method in one interface that you can
implement. I have put my Session closing code in it, but it doesn't
help. It continues to leave sessions open. I have tried almost
everything, but I cannot get rid of those Unclosed Sessions. Only
solution I have found is closing session before going to a view
rendering phase, and that means that lazy initialization is not an
option anymore.

Also I see that Hibernate uses a lot of finally {} blocks to do some
cleaning. If I understand correctly, at least what I have read from some
of IBM's whitepapers, they don't recommend you to use finally {} to do a
cleaning (mainly they don't recommend to put connection closing code in
it) as it cannot be determined when that block gets called. I migth be
wrong, but I can get the article if you like (?).

Any ideas? Do you want the example code that leaves connections some
times open (ie. under load)?

For resin users:

You should enable...

<ignore-client-disconnect>true</ignore-client-disconnect>

.. if you don't, you are going to get potential problems. i.e. resin
starts executing the code, but meanwhile client disconnects and resin
recognices that and then immediately stops code execution (you can
demonstrate this by yourself by using e.g. Internet Explorer and then
hit a page and push F5 key down for about 15 seconds). What this means
in practice is that if you close connections after serving client, then
that code never gets executed -> you are going to run out of db
connections that you have in some pool (i.e. jndi). I think that this
settings should be put in some FAQ.

Kind Regards
Aapo Laakkonen



-------------------------------------------------------
This SF.net email is sponsored by: Get the new Palm Tungsten T 
handheld. Power & Color in a compact size! 
http://ads.sourceforge.net/cgi-bin/redirect.pl?palm0002en
_______________________________________________
hibernate-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/hibernate-devel

Reply via email to