I have a test case (attached) which performs the following actions:
- Open a new transaction
- Create & persist a simple entity object, EntityManager is flushed, Transaction is not committed
- Count the number of simple entity objects in the database
- Retrieve the simple entity object using find by id
- Remove the entity object, EntityManager is flushed & cleared, Transaction is not committed
- Count the number of simple entity objects in the database
- Commit the transaction
The count operations in step 3 & 6 both return 1 but I would've expected step 6 to return 0.
Could you let me know if this is a bug you can fix or whether my expectation is incorrect (and if so, is there a workaround)? Thanks