Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 315591 - JPA 2.0 Cache API Test Suite is not reentrant - refactor for generated Ids
Summary: JPA 2.0 Cache API Test Suite is not reentrant - refactor for generated Ids
Status: NEW
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Eclipselink (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 7
: P3 minor (vote)
Target Milestone: ---   Edit
Assignee: Nobody - feel free to take it CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on: 248780
Blocks: 454799
  Show dependency tree
 
Reported: 2010-06-03 10:00 EDT by Michael OBrien CLA
Modified: 2022-06-09 10:35 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michael OBrien CLA 2010-06-03 10:00:04 EDT
>The original CacheImplJUnitTest is not reentrant - in that it has hardcoded @Id numbers
- the result is that running the test repeatedly (in development) fails with a constraint violation on the 2nd run unless the manual id numbers are cycled before each test (or the database is cleared)

>Fix:
By it's nature the suite is evicting objects based on a specific ID - so DDL sequence generation may have issues.
However, the suite should move away from hardcoded @Id references like
e6.setId(141);
int ID_PADS = ID_TEST_BASE + 2100;
e1.setSerialNumber(new Integer(ID_PADS));

>and just get the id that is set after the first persist()
Comment 1 Eclipse Webmaster CLA 2022-06-09 10:35:19 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink