[
https://issues.apache.org/jira/browse/OPENJPA-362?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12526259
]
Patrick Linskey commented on OPENJPA-362:
-----------------------------------------
> 1) In EntityManagerImpl,
>
> Missing method implementation
> public void lockAll(Object... pcs, LockModeType mode, long timeout);
> But found this instead.
> public void lockAll(Object[] entities, LockModeType mode, int timeout)
> {
That's a docs problem; it's only possible to do varargs at the end of the args
list.
> 2) For those API methods with timeout argument, what is the behavior
> when timeout occurs? Will an exception be thrown? Since these method
> has void return, no return value can be used to indicate the timeout
> condition.
A LockException will be thrown, IIRC.
> 3) For those API methods with timeout argument, the timeout value does not
> seem to be used at all, hence the timeout feature is a NOP.
> i.e. EntityManagerImpl.lock*() -> BrokerImpl.lock() -->
> VersionLockManager | NonLockManager
>
> a) Is the API just an architected feature?
> b) Is the timeout feature not implemented and require user to implements
> its
> lock manager that support the timeout feature?
The information is provided to the LockManager; it's up to the LockManager to
take advantage of it. So, for example, PessimisticLockManager uses this
information (PessimisticLockManager.java:142).
> Object Locking API problems
> ---------------------------
>
> Key: OPENJPA-362
> URL: https://issues.apache.org/jira/browse/OPENJPA-362
> Project: OpenJPA
> Issue Type: Bug
> Components: kernel
> Affects Versions: 1.0.0
> Environment: All platforms
> Reporter: Albert Lee
>
> The manual describes the following Object Locking API
> public void lock(Object pc);
> public void lock(Object pc, LockModeType mode, long timeout);
> public void lockAll(Object... pcs);
> public void lockAll(Object... pcs, LockModeType mode, long timeout);
> public void lockAll(Collection pcs);
> public void lockAll(Collection pcs, LockModeType mode, long timeout);
> Problems observed:
> 1) In EntityManagerImpl,
> Missing method implementation
> public void lockAll(Object... pcs, LockModeType mode, long timeout);
> But found this instead.
> public void lockAll(Object[] entities, LockModeType mode, int
> timeout) {
> 2) For those API methods with timeout argument, what is the behavior when
> timeout occurs? Will an exception be thrown? Since these method has void
> return, no return value can be used to indicate the timeout condition.
> 3) For those API methods with timeout argument, the timeout value does not
> seem to be used at all, hence the timeout feature is a NOP.
> i.e. EntityManagerImpl.lock*() -> BrokerImpl.lock() -->
> VersionLockManager | NonLockManager
> a) Is the API just an architected feature?
> b) Is the timeout feature not implemented and require user to implements
> its lock manager that support the timeout feature?
> Albert Lee.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.