[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-1100) Invalidate cache on StaleObjectStateException
Nico De Groote (JIRA)
noreply at atlassian.com
Mon Oct 16 10:14:24 EDT 2006
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1100?page=comments#action_24812 ]
Nico De Groote commented on HHH-1100:
-------------------------------------
I did fix the problem mentioned above.
I performed the following change in the execute method of the EntityUpdateAction class.
...
if ( !veto ) {
try{
persister.update( id, fields, dirtyFields, hasDirtyCollection, oldFields, lastVersion, instance, rowId, session );
} catch (StaleObjectStateException ex){
if (persister.hasCache()){
EvictEvent evictEvent = new EvictEvent(instance, session);
session.getListeners().getEvictEventListener().onEvict(evictEvent);
}
throw ex;
}
}
...
It does the trick for me, however this might not be completely correct for you.
> Invalidate cache on StaleObjectStateException
> ----------------------------------------------
>
> Key: HHH-1100
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1100
> Project: Hibernate3
> Type: Improvement
> Components: core
> Reporter: Gavin King
> Assignee: Gavin King
> Priority: Critical
>
>
> We should probably invalidate the second-level cache when a StaleObjectStateException occurs. Need to think this through.
--
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.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
More information about the hibernate-issues
mailing list