[
https://issues.apache.org/jira/browse/OFBIZ-5215?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13788206#comment-13788206
]
Joe Eckard commented on OFBIZ-5215:
-----------------------------------
1) Yes, GenericDelegator.rollback() is used to roll back test operations when
running in test mode.
2) Why close an issue when there is no evidence the actual problem has been
resolved?
I don't recall exactly what I was suggesting with the "proposed fix: ?" - most
likely it was disabling the locking only long enough to revert an UPDATE. I
would have to find the old test case or create a new one from scratch to be
sure.
To reproduce the problem, enable locking for an entity (enable-lock="true" in
the entity def.), then write a test that updates a value object - when the test
operations are rolled back, you should see the problem described above.
> GenericDelegator rollback can fail when optimistic locking is enabled
> ---------------------------------------------------------------------
>
> Key: OFBIZ-5215
> URL: https://issues.apache.org/jira/browse/OFBIZ-5215
> Project: OFBiz
> Issue Type: Bug
> Components: framework
> Affects Versions: SVN trunk
> Reporter: Joe Eckard
>
> If an entity uses optimistic (timestamp) locking, then when rollback()
> attempts to revert an UPDATE test operation an EntityLockedException is
> thrown (because it calls store() on the original value which has old
> timestamps).
> Proposed fix: disable the locking with modelEntity.setDoLock(false)? I'm not
> sure if we need to re-enable it afterwards of if it is ok at this point to
> leave it disabled.
--
This message was sent by Atlassian JIRA
(v6.1#6144)