[hibernate-issues] [Hibernate-JIRA] Updated: (HHH-1352) Session.setReadOnly(Object, boolean) fails for proxies

Gail Badner (JIRA) noreply at atlassian.com
Tue Jan 12 19:56:30 EST 2010


     [ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1352?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Gail Badner updated HHH-1352:
-----------------------------

    Fix Version/s: 3.5.0-Beta-3

> Session.setReadOnly(Object, boolean) fails for proxies
> ------------------------------------------------------
>
>                 Key: HHH-1352
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1352
>             Project: Hibernate Core
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 3.1
>         Environment: Hibernate 3.1, MySQL 5.0.15-nt
>            Reporter: Stewart Cambridge
>            Assignee: Gail Badner
>            Priority: Minor
>             Fix For: 3.5.0-Beta-3
>
>   Original Estimate: 1 day
>  Remaining Estimate: 1 day
>
> Session.setReadOnly(Object, boolean) is broken. It throws a TransientObjectException with the message "Instance was not associated with the session" when the object is quite obvious associated with the current session, because we only just loaded it using Session.load(Class, Serializable)
> Here is a simple JUnit test, for an arbitrary entity:
>   public void testReadOnly()
>     throws Exception
>   {
>     User user = (User) session.load(User.class, new Long(7));
>     System.out.println("\n=== " + user + " ===");
>     session.setReadOnly(user, true);
>   }
> This is the exception stack trace:
> org.hibernate.TransientObjectException: Instance was not associated with the session at org.hibernate.engine.StatefulPersistenceContext.setReadOnly(StatefulPersistenceContext.java:1167) at org.hibernate.impl.SessionImpl.setReadOnly(SessionImpl.java:1740) at
> test.persistence.HibernateObjectTest.testReadOnly(HibernateObjectTest.java:30) ....

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