When I change it to save(flush: true), the data persists as expected.
While I understand 100% GORM-hibernate compatibility is not the goal, I would expect that calling save() would still allow the underlying implementation to handle flushing the session for me.
I am having the same issue with both hibernate and redis-gorm plugins installed.
When saving redis-mapped entity with save() method and without flush: true argument, changes are not persisted to redis and subsequent call of refresh() method or querying from another thread clearly shows it.
When saving redis-mapped entity with flush: true argument, changes are successfully persisted, but indexed properties become broken, so subsequent querying by indexed property does not return entity instance, while it should. However, list() method (and list().find { it.someIndexedProperty = someValue }) returns the instance as usual.
This is a major index/saving issue that breaks its effectiveness.
Reproduced with a sample application.
When I create a new GORM instance and call
save()
, the expected behavior is for the data to be written when the session is flushed automatically.What appears to be happening is that the insert never happens completely, though redis-cli monitor prints
When I change it to
save(flush: true)
, the data persists as expected.While I understand 100% GORM-hibernate compatibility is not the goal, I would expect that calling
save()
would still allow the underlying implementation to handle flushing the session for me.Example project: https://github.com/joemccall86/gorm-redis-test
Instructions: Run the grails app, and use cURL according to the following examples:
Tested with
"org.grails.plugins:redis-gorm:6.0.4"
andgormVersion=6.1.0.RELEASE
.