Issue Details (XML | Word | Printable)

Key: TRAILS-142
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Alejandro Scandroli
Reporter: Ken in nashua
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Trails

OpenSessionInView - detached entities eventually comes apart after span 3 levels associations

Created: 05/Mar/08 12:53 PM   Updated: 12/Apr/08 07:47 AM
Component/s: trails-core, trails-hibernate
Affects Version/s: 1.2.0
Fix Version/s: 1.2.0

Time Tracking:
Not Specified

File Attachments: 1. Text File stack.trace.txt (41 kB)
2. Text File trails-142.example.roster.code.update.txt (58 kB)
3. Text File trails-142.trails-core.code.update.txt (25 kB)
4. Text File trails-142.trails-core.code.update.txt (25 kB)

Environment: XP Pro, apache-maven-2.0.8, eclipse-3.3.1.1, jre-1.5.0_14, ognl-2.7.3-SNAPSHOT, tapestry-4.1.6-SNAPSHOT , MySQL-5.0.45
Issue Links:
Duplicate
 
Related
 


 Description  « Hide
OpenSessionInView - detached entities eventually comes apart after span 3 levels associations

While operating roster demo... see attached updated code

1. create league
2. create save league
3. edit league
4. create organization
5. save organization
6. edit organization
7. create team
8. save team
9. edit team
10. see stack trace for app crash

These associations span 3 levels.



 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Alejandro Scandroli added a comment - 12/Apr/08 07:47 AM
fixed in rev 942

In this particular case, when the parent of a collection is referenced in the child edit page, a simple lock
on the parent object

getSession().lock(model, LockMode.NONE);

is not enough, the parent object needs to be reloaded.
To reload it there is a new PropertyPersistenceStrategy called ReloadReattachPropertyPersistenceStrategy
I've configure roster example to use ReloadReattachPropertyPersistenceStrategy by default when dealing with "parent" objects.

You can also explicitly use the ReloadReattachPropertyPersistenceStrategy, it's strategy-id is: "reattach-reload"