[hibernate-issues] [Hibernate-JIRA] Created: (HHH-4070) createProxy() called even when hasProxy() returns false

Philip Borlin (JIRA) noreply at atlassian.com
Tue Aug 4 13:04:14 EDT 2009


createProxy() called even when hasProxy() returns false
-------------------------------------------------------

                 Key: HHH-4070
                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-4070
             Project: Hibernate Core
          Issue Type: Bug
          Components: core
    Affects Versions: 3.3.2
         Environment: 3.3.2GA, PostgresQL 8.3
            Reporter: Philip Borlin


This problem occurs when an EntityTuplizer is used.  In my case I throw an UnsupportedOperationException in my createProxy() method.  I would expect that would be ok since my hasProxy() method returns false.  This was working in 3.3.1 but broke in 3.3.2.

In DefaultLoadEventListener in the proxyOrLoad() method there is a call to persister.hasProxy().  This makes a call to AbstractEntityPersister which simply checks to see whether the entityMetamodel isLazy().

That check succeeds since lazy is sent to true.

The next check sees if isAllowProxyCreation() is false in the options.

Lastly creatProxyIfNecessary() is called which if the entity does not exist calls createProxy() on the persister.  AnstractEntityPersister delegates this directly to the tuplizer.

At no point was the tuplizer's hasProxy() method ever consulted.

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