[hibernate-issues] [Hibernate-JIRA] Created: (HHH-3991) Bad performance when clearing big sessions

Thomas Jacob (JIRA) noreply at atlassian.com
Thu Jun 25 09:48:33 EDT 2009


Bad performance when clearing big sessions
------------------------------------------

                 Key: HHH-3991
                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-3991
             Project: Hibernate Core
          Issue Type: Bug
          Components: core
            Reporter: Thomas Jacob


If a session has many proxies, clearing is very slow.
The reason is the AbstractLazyInitializer.setSession checks if the proxy is already connected to another session, which in turn linearily iterates through a referenced map.
Since the method receives a null (clearing unsets the session), this check is not necessary.

I suggest setSession's line 2 to be changed from
	if ( isConnectedToSession() ) {
to
	if ( s!= null && isConnectedToSession() ) {

In addition, the linear iterations should be replaced, as a performance improvement.


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the hibernate-issues mailing list