[hibernate-issues] [Hibernate-JIRA] Created: (HHH-2450) SessionImpl.setReadOnly and SessionImpl.contains() inconsisten wrt handling proxied entities

Ken Logan (JIRA) noreply at atlassian.com
Mon Feb 26 12:31:31 EST 2007


SessionImpl.setReadOnly and SessionImpl.contains() inconsisten wrt handling proxied entities
--------------------------------------------------------------------------------------------

         Key: HHH-2450
         URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2450
     Project: Hibernate3
        Type: Bug

  Components: core  
    Versions: 3.2.0.ga    
    Reporter: Ken Logan



There doesn't seem to be a correct way to use Session.setReadOnly() when working with possibly detatched and proxied objects.

This is because SessionImpl.setReadOnly() doesn't unwrap the proxied object in the same fashion as SessionImpl.contains() does. 

Passing in a proxied object to SessionImpl.setReadOnly() seems to always result in a TransientObjectException even for this code:

if(session.contains(myProxiedObject)) 
{
    session.setReadOnly(myProxiedObject, false);  // throws TransientObjectException if myProxiedObject is really proxied
}

This is because SessionImpl.contains has special code to check the underlying object in the case of a proxy.




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