Open luke10 opened 5 years ago
What's your plugin config?
grails:
plugin:
auditLog:
auditDomainClassName: 'my.package.AuditTrail'
excluded: ['createdBy','dateCreated','lastUpdatedBy','lastUpdated','version']
Are you using the Stampable
trait on the entities?
I'm experiencing the same problem using version 3.0.1 (with Hibernate 5.1.16.Final) and the Stampable trait. I'm not trying to make lastUpdatedBy nullable like OP and initial value is set to match createdBy as expected. But changes to lastUpdatedBy afterwards are not saved to the database, whereas changes to other fields including lastUpdated are.
I can see that StampListener.handleUpdate is called after calling save(flush:true) and the value in the domain object is updated within the session of the one request. However, it's not saved to the database and subsequent requests show the unchanged value of lastUpdatedBy while all other changes to the domain including lastUpdated were persisted.
A similar problem occurs if you independently implement the abstract class AbstractPersistenceEventListener. Within one thread, the changes applied in the implementation of the AbstractPersistenceEventListener class are available, and there are no changes in the other thread.
Example: https://github.com/MaxMoto1702/grails-AbstractPersistenceEventListener and grails-data-mapping/issues/1237
@tekells-usgs How did you finally deal with this problem? I had the same problem,thanks
Version: org.grails.plugins:audit-logging:3.0.3
I am new to this plugin, but have noticed a fairly critical issue. The last_updated_by column is not being updated when entities are updated. However, it is being set when the entity is first created (along with created_by)
Could this be a bug in the new version?
I'm not sure what the expected behaviour is, but I would expect: