Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 342041

Summary: Non-recoverable error while moving a opened Test Case
Product: [Technology] Jubula Reporter: Tim Winselmann <tim.winselmann>
Component: CoreAssignee: Zeb Ford-Reitz <zeb.ford-reitz>
Status: CLOSED FIXED QA Contact: Oliver Goetz <Oliver.Goetz>
Severity: blocker    
Priority: P3 CC: zeb.ford-reitz
Version: 0.9.0   
Target Milestone: 1.0   
Hardware: All   
OS: All   
Whiteboard:
Bug Depends on:    
Bug Blocks: 342406    

Description Tim Winselmann CLA 2011-04-06 12:10:59 EDT
1. Create a New Test Case and a New Category
2. Open the New Test Case
3. Move the New Test Case into the New Category (while the Test Case is opened)

--> 
At first four DatabaseLoadFailed-errors appear, than appears a Non-recoverable-error:

An error occurred.
Reason:
2001: Database load failed.

An error occurred.
Reason:
7007: Non-recoverable error. Please restart the application.

In GUIdancer 4.3 it was possible to move a opened Test Case into a category.
We should decide if it should be possible to move opened test cases or we should modify the error message text to "object is in use by another transaction".
Comment 1 Zeb Ford-Reitz CLA 2011-04-08 11:09:47 EDT
The problem seems to be caused by a combination of EntityManager management, JFace TreeViewers, and Decorators. When the Test Case Editor is opened, the Workbench's Managed Decorator is triggered. As a result, the elements in the Tree Viewer in the TCB are updated (the TreeItems receive new data). This confuses EclipseLink, because there is a "new" object (not Java identical, or ==, to any other managed object) in the EntityManager. This is what causes the error: At some point later, a JPA query is executed, and the pre-query flush causes an exception because the PK constraint for the Test Case (the object that is recognized by EclipseLink as "new") is violated.
Comment 2 Zeb Ford-Reitz CLA 2011-04-08 11:14:14 EDT
A possible fix might be to somehow separate the Decorators by EntityManager. This would mean that each Editor has its own set of Decorators, and the views that use the master session would share a set of Decorators.
Comment 4 Oliver Goetz CLA 2011-04-15 05:18:31 EDT
Bug fixed, tested manually