JetBrains / JetBrains/Exposed

Entity instance in cache differs from the provided when using EntityHooks

Open
#2,443 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Kotlin
Stars
9.3k
Forks
798
Avg merge
4d 2h
Merged PRs (30d)
26

Description

i am using EntityHooks to ensure that i record an updatedAt date

EntityHook.subscribe { entityChange ->
if (entityChange.changeType == EntityChangeType.Updated) {
if (entityChange.entityClass == FanArtistTable.FanArtist) entityChange.toEntity(FanArtistTable.FanArtist)?.updatedAt = DateTime.now()
}
}

however, when I do, I see this a lot

ERROR Exposed - Entity instance in cache differs from the provided: FanArtist with ID b8dc8bb6-4ddc-48bb-b528-9510a86935bc. Changes on entity could be missed.

if I remove the hook, everything is fine.

exposed 0.59.0

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.