[
http://opensource.atlassian.com/projects/hibernate/browse/HHH-3818?page=c...
]
Brian Stansberry updated HHH-3818:
----------------------------------
Description:
EntityRegionAccessStrategy and CollectionRegionAccessStrategy have evict(Object key) and
evictAll() that say they must cause removal of items from the cache "immediately
without regard for transaction isolation." The Hibernate/JBC integration is not
properly handling this as the JBC removeNode calls it makes are not dealing with
transactional issues. The integration needs to:
1) Perhaps suspend any ongoing tx (particularly since these calls are typically made from
a tx Synchronization's afterCompletion() callback, when the tx is Status.COMMITTED and
it isn't appropriate to call into the cache expecting the cache to incorporate the
call into the transaction. (Alhthough I believe JBC handles this correctly by ignoring the
tx, since it isn't ACTIVE).
2) Deal with the fact that the tx that is being committed is likely holding locks in JBC.
This is the big issue. I believe dealing with this will a) require keeping state in the
Hib/JBC integration layer's Region to track that an eviction has occurred but may not
be reflected in JBC b) using JBC as a notification bus to propagate the fact of the
eviction to other nodes c) attempting to evict the data from JBC locally, failing promptly
in the face of lock conflicts d) including in any get() or putFromLoad() calls logic to
check the state from a), again attempting to evict locally (with a very short timeout) if
not yet evicted and not allowing calls to proceed into JBC until successful.
This JIRA is for handling evictAll(), which Hibernate core itself executes as part of
handling bulk updates. This is the call for which user problems have been reported. See
HHH-4517 for evict(Object).
was:
EntityRegionAccessStrategy and CollectionRegionAccessStrategy have evict(Object key) and
evictAll() that say they must cause removal of items from the cache "immediately
without regard for transaction isolation." The Hibernate/JBC integration is not
properly handling this as the JBC removeNode calls it makes are not dealing with
transactional issues. The integration needs to:
1) Perhaps suspend any ongoing tx (particularly since these calls are typically made from
a tx Synchronization's afterCompletion() callback, when the tx is Status.COMMITTED and
it isn't appropriate to call into the cache expecting the cache to incorporate the
call into the transaction. (Alhthough I believe JBC handles this correctly by ignoring the
tx, since it isn't ACTIVE).
2) Deal with the fact that the tx that is being committed is likely holding locks in JBC.
This is the big issue. I believe dealing with this will a) require keeping state in the
Hib/JBC integration layer's Region to track that an eviction has occurred but may not
be reflected in JBC b) using JBC as a notification bus to propagate the fact of the
eviction to other nodes c) attempting to evict the data from JBC locally, failing promptly
in the face of lock conflicts d) including in any get() or putFromLoad() calls logic to
check the state from a), again attempting to evict locally (with a very short timeout) if
not yet evicted and not allowing calls to proceed into JBC until successful.
Requires Release Note: [Affirmative]
Summary: Hibernate/JBC integration doesn't property handle
Entity/CollectionRegionAccessStrategy evictAll (was: Hibernate/JBC integration
doesn't property handle Entity/CollectionRegionAccessStrategy evict)
See HHH-4517 for evict(Object).
Hibernate/JBC integration doesn't property handle
Entity/CollectionRegionAccessStrategy evictAll
------------------------------------------------------------------------------------------------
Key: HHH-3818
URL:
http://opensource.atlassian.com/projects/hibernate/browse/HHH-3818
Project: Hibernate Core
Issue Type: Bug
Components: caching (L2)
Affects Versions: 3.3.1
Reporter: Brian Stansberry
Assignee: Brian Stansberry
Fix For: 3.3.x, 3.5
EntityRegionAccessStrategy and CollectionRegionAccessStrategy have evict(Object key) and
evictAll() that say they must cause removal of items from the cache "immediately
without regard for transaction isolation." The Hibernate/JBC integration is not
properly handling this as the JBC removeNode calls it makes are not dealing with
transactional issues. The integration needs to:
1) Perhaps suspend any ongoing tx (particularly since these calls are typically made from
a tx Synchronization's afterCompletion() callback, when the tx is Status.COMMITTED and
it isn't appropriate to call into the cache expecting the cache to incorporate the
call into the transaction. (Alhthough I believe JBC handles this correctly by ignoring the
tx, since it isn't ACTIVE).
2) Deal with the fact that the tx that is being committed is likely holding locks in JBC.
This is the big issue. I believe dealing with this will a) require keeping state in the
Hib/JBC integration layer's Region to track that an eviction has occurred but may not
be reflected in JBC b) using JBC as a notification bus to propagate the fact of the
eviction to other nodes c) attempting to evict the data from JBC locally, failing promptly
in the face of lock conflicts d) including in any get() or putFromLoad() calls logic to
check the state from a), again attempting to evict locally (with a very short timeout) if
not yet evicted and not allowing calls to proceed into JBC until successful.
This JIRA is for handling evictAll(), which Hibernate core itself executes as part of
handling bulk updates. This is the call for which user problems have been reported. See
HHH-4517 for evict(Object).
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira