[Hibernate-JIRA] Resolved: (HHH-1352) Session.setReadOnly(Object, boolean) fails for proxies
by Gail Badner (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1352?page=c... ]
Gail Badner resolved HHH-1352.
------------------------------
Resolution: Fixed
Fixed in trunk.
> 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....
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
16 years, 3 months
[Hibernate-JIRA] Updated: (HHH-1352) Session.setReadOnly(Object, boolean) fails for proxies
by Gail Badner (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1352?page=c... ]
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....
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
16 years, 3 months
[Hibernate-JIRA] Created: (HHH-4642) Unexpected results when an entity with non-flushed changes is changed from read-only to modifiable
by Gail Badner (JIRA)
Unexpected results when an entity with non-flushed changes is changed from read-only to modifiable
--------------------------------------------------------------------------------------------------
Key: HHH-4642
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-4642
Project: Hibernate Core
Issue Type: Bug
Components: core
Affects Versions: 3.5.0-Beta-2, 3.5.0.Beta-1
Reporter: Gail Badner
Assignee: Gail Badner
When an entity is changed from being read-only to modifiable, its snapshot is created from its current state (in the session), not its persistent state (in the DB).
This can cause unexpected results when:
- an entity had non-flushed changes when it was set to read-only, or
- an entity's state (in the session) was changed after being made read-only.
If no other changes are made to the entity after being made modifiable, Hibernate will not detect that the entity is dirty, and those changes will not be pushed to the DB. If other changes are made, Hibernate will detect that the entity is dirty, and the newer changes will be persisted, but the older changes may not be.
--
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....
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
16 years, 3 months