[ https://issues.apache.org/jira/browse/OPENJPA-1562?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12845673#action_12845673 ]
Dianne Richards commented on OPENJPA-1562:
------------------------------------------
Thanks for reviewing this patch Mike.
For question #1:
When I first made the change and ran all of the tests, one set of lock tests failed because of remove followed by lock.
So, I searched through the spec related to this. Section 3.2.5 says, for a refresh operation, "If X is a new, detched, or removed entity, the IllegalArgumentException is thrown." In other parts of the spec (including the javadoc that you quoted), it says an IllegalArgumentException is thrown for a Lock request on a "detached" entity. But, I couldn't find any such statement fot a "removed" entity.
For question #2
At this point, I don't have an answer. I'll do a little digging.
> EntityManager:Refresh on Removed entity does not trigger IllegalArgumentException
> ---------------------------------------------------------------------------------
>
> Key: OPENJPA-1562
> URL: https://issues.apache.org/jira/browse/OPENJPA-1562
> Project: OpenJPA
> Issue Type: Bug
> Affects Versions: 2.0.0-beta2
> Environment: Mac OS X, OpenJPA 2.0.0-beta2, Spring 3.0
> Reporter: Jerry Carter
> Assignee: Dianne Richards
> Priority: Minor
> Attachments: openjpa1562.tar.zip, patch.txt, simple_entity_tests.txt
>
>
> My application unit tests turned up some unexpected behavior from basic OpenJPA entity manager functions. It appears, for instance, that a detached entity can still be refreshed. I decided to write a few basic tests (attached) which report five potential errors. This does not go into the testing of cascading behavior which would require additional work.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.