Skip to content

Commit

Permalink
issue #1042: fixes cache invalidation
Browse files Browse the repository at this point in the history
  • Loading branch information
mrk-vi committed Jul 30, 2024
1 parent 10c1d4d commit c3032ed
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
import io.openk9.datasource.actor.ActorSystemProvider;
import io.openk9.datasource.cache.P2PCache;
import io.quarkus.hibernate.orm.PersistenceUnitExtension;
import org.hibernate.CallbackException;
import org.hibernate.EmptyInterceptor;
import org.hibernate.type.Type;
import org.jboss.logging.Logger;
Expand Down Expand Up @@ -70,16 +69,17 @@ public boolean onSave(


@Override
public void onCollectionUpdate(Object collection, Serializable key)
throws CallbackException {
public boolean onFlushDirty(
Object entity, Serializable id, Object[] currentState,
Object[] previousState, String[] propertyNames, Type[] types) {

if (log.isTraceEnabled()) {
log.trace("intercepted collectionUpdate");
log.trace("intercepted flushDirty");
}

invalidateLocalCache();

super.onCollectionUpdate(collection, key);
return super.onFlushDirty(entity, id, currentState, previousState, propertyNames, types);
}

private void invalidateLocalCache() {
Expand Down

0 comments on commit c3032ed

Please sign in to comment.