|Collection shows different data between database and cache after two inserts [message #1835548]
||Sun, 06 December 2020 17:00
| vrivon Mising name
Registered: March 2010
I am mapping the storage of an object "fleet" as follows:|
@ElementCollection(fetch = FetchType.LAZY)
private Map<ObjectType,Long> storage = new TreeMap<>();
I open a new transaction that makes two changes in the storage:
1. inserts objects A, B, C, D, E
2. inserts A, B, F, G
Debugging the transaction I can see that the storage now has objects: A, B, C, D, E, F and G.
Databe also show objects A, B, C, D, E, F and G.
BUT... when I open the object fleet in other different transaction it shows the objects: C, D, E.
It is like somehow those objects that were in BOTH inserts were deleted from the persistance cache. They exist in the database, If I reboot the app the storage show the correct collection A, B, C, D, E, F and G.
Any idea why the persistance cache gets this corrupted data?
Thanks in advance
Powered by FUDForum
. Page generated in 0.03283 seconds