]
Gunther Schadow commented on HHH-2501:
--------------------------------------
Yes, absolutely, being able to put an entire session into read-only mode would be very
useful. It is useful for our rich client application but it is even more useful for a
reporting or OLAP use of the data base where you never need snapshots but you need to
churn through tons of data.
I am concerned that no response exists till date from the developers. For us it could be
important enough to just do the session.setReadOnly() by ourselves. What are the chances
of our changes to stick in future versions of Hibernate?
Read-only state of an entity in a session to propagate into
subsequently lazy-loaded entities.
----------------------------------------------------------------------------------------------
Key: HHH-2501
URL:
http://opensource.atlassian.com/projects/hibernate/browse/HHH-2501
Project: Hibernate3
Issue Type: New Feature
Components: core
Environment: any
Reporter: Gunther Schadow
Priority: Minor
ISSUE:
Given an Entity entity and after Session.setReadOnly(entity), if the entity has lazy
collections, lazy properties etc., other Entities are loaded into the Session upon
navigating the object graph in the default read-writable state. However, it seems more
reasonable to maintain the read-only state of the owning object.
REQUEST:
Ability to propagate read-only state of an entity in a session into other lazy-loaded
entities.
BACKGROUND:
We have a system which permits users to make concurrent transactions which involve many
of the same objects. Usually no changes happen on these shared objects, but instead
connections (links) are made between these objects and new objects. For example, say you
have an online meeting system, and every Meeting held has a link to a number of User
object. The User objects are never changed in a Meeting, but there is a Relation called
Participation (of User in Meeting) to which new relationships are added. When a new
meeting is saved, it wants to save the User objects simply because a new Participation
link entry was added to the collection.
To an extent we can prevent this from happening by setting the Users explicitly to
read-only. However, now suppose we added a function "Invite your Friends" to a
Meeting, in which we would simply go:
for(User friend : currentUser.getFriends())
meeting.addInvitation(friend);
Now an Invitation is like a Participation, and would be added into the User but now it
wants to save these users just for a version upgrade only because they have received an
Invitation.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: