user1191386
user1191386

Reputation: 43

Grails GORM events being called multiple times

Just trying to implement a simple audit logging solution with Grails 2.0.2 and it looks like any of the domain class events are being called multiple times. It is the same for the before* and after* events.

 def afterUpdate () {
        log.info "Updating..."
 }

I would have expected only 1 event to be triggered, so if this is being called many times by design how will I ensure only 1 audit entry is made?

Thanks!

Upvotes: 2

Views: 518

Answers (1)

Steve
Steve

Reputation: 1467

Just encountered the same issue myself recently. There is a JIRA open for this, which mentions it will be fixed in 2.0.4, looks like it fires the event for each datasource...meanwhile a JIRA user has kindly donated a simple workaround.

I tried the Auditable plugin but couldnt get that working how I want (maybe affected by the same issue)

Upvotes: 2

Related Questions