No! If an session has been closed forcefully or by other means, hibernate
internals should not reopen the session - at least not per default! If the
session has been closed there is a reason for it - one might be to ensure
that the ui-layer does not accidently fetches data by "dotting" around in
the object graph.

If you want the session to be (re)opend - why don't you just keep the
session open ?

/max

----- Original Message -----
From: "Jonas Van Poucke" <[EMAIL PROTECTED]>
To: "Hibernate Developers" <[EMAIL PROTECTED]>
Sent: Tuesday, December 03, 2002 9:20 AM
Subject: [Hibernate] Lazy Collections


The implementation of the write() method in
cirrus.hibernate.collections.PersistentCollection
states:

protected final void write() {
initialize(true);
if ( session!=null && session.isOpen() ) session.dirty(this);
}

This means the session needs to be open.
Also, the Docs mentions that lazy collections need to have an open session.
Could we safely modify the code to reopen the session when needed?
protected final void write() {
initialize(true);
if ( session != null ) {
                    if ( session.isOpen() ) {
                        session.dirty(this);
                    } else {
                        // Re-open session
                        session.reopen(); // ommitted try-catch
                        session.dirty(this);
                    }
                }
}


****************************************************************************
***
Hou uw internetverbruik beter onder controle ... surf met Tiscali Complete
.. http://tiscali.complete.be





-------------------------------------------------------
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




-------------------------------------------------------
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