Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

getDirtyPropertyNames() returns all HstoreMapType fields, even if not dirty #96

Closed
Taack opened this issue Sep 15, 2016 · 7 comments
Closed

Comments

@Taack
Copy link

Taack commented Sep 15, 2016

def beforeUpdate() {
        println id + " " + getDirtyPropertyNames()
}

prints all HstoreMapType fields, even if none has been updated.

I am using org.grails.plugins:postgresql-extensions:4.6.6 with Grails 3.1.6.

Thanks for your support,
Adrien

@ilopmar
Copy link
Collaborator

ilopmar commented Oct 31, 2016

Could you please create a sample application that reproduces the issue, upload to github and post here the link?

@jglapa
Copy link
Contributor

jglapa commented May 17, 2017

I'm seeing the same problem also with the 4.x.x extension and Grails 3.2.6 and hibernate4.
But I prepared an example with Grails 3.2.6, hibernate5 and plugin 5.x.x. Same thing.
Here's the project https://github.com/jglapa/hstore-dirty-property

just run it and hit the http://localhost:8080/testDomain/index URL then observe the console.
PS.
you need to have a hstore_dirty_property database on localhost with user and password test

PS2.
In my app I see even worse behaviour. For such cases when retrieving a domain object by simple get with empty hstore my optimisting locking version field gets incremented six times! But I suspect it has something to do with the audit-logging plugin which I'm using and this relies on the dirty checking...

@ilopmar
Copy link
Collaborator

ilopmar commented May 17, 2017

I don't know the internals of how dirty checking works but in the plugin we don't do anything special to support it. Actually we never thought about it.

I haven't used postgres in a while and I don't have enough spare time at this moment so I'm afraid I won't be able to try to fix this. If you have some time and want to send a PR that fixes this I'll make a new release.

jglapa added a commit to jglapa/grails-postgresql-extensions that referenced this issue May 18, 2017
@jglapa
Copy link
Contributor

jglapa commented May 18, 2017

hey @ilopmar I've submitted a PR #104 with short explanation.

ilopmar pushed a commit that referenced this issue May 21, 2017
@ilopmar
Copy link
Collaborator

ilopmar commented May 21, 2017

Merged PR #104

@ilopmar ilopmar closed this as completed May 21, 2017
@ilopmar
Copy link
Collaborator

ilopmar commented May 21, 2017

Released version 5.0.1

ilopmar pushed a commit that referenced this issue May 21, 2017
@ilopmar
Copy link
Collaborator

ilopmar commented May 21, 2017

Released also version4.6.9 with the backported changes to 4.x branch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants