dateCreated is updated after save an object obtained withNewSession

17 views
Skip to first unread message

Diego Castro

unread,
Sep 22, 2016, 3:31:09 PM9/22/16
to Grails Dev Discuss
Hi,

I'm working with grails 1.3.7 and I have an issue when an object obtained withNewSession is saved.

The dateCreated filed is updated to the current date.

This is my code:

def myDomainObject
  
DomainObject.withNewSession{
    myDomainObject =  DomainObject.createCriteria().get {
        eq 'id', 123456
    }
}

println myDomainObject.dump()

shp.save()

println myDomainObject.dump()

On the second println  dateCreated is updated to the current date.

However if I remove withNewSession the dateCreated is not updated as expected.

Do you have any clue about what is going on?

Thanks in advance.

Diego.

Jeff Brown

unread,
Sep 23, 2016, 11:24:48 AM9/23/16
to grails-de...@googlegroups.com, Diego Castro
On September 22, 2016 at 2:39:34 PM, Diego Castro
That sounds like a bug.  It is very unlikely that a bug in 1.3.x will
ever be fixed at this point.  If the problem occurs in recent versions
of Grails we could investigate and fix it.



JSB

--
Jeff Scott Brown
OCI Grails Practice Lead
Principal Software Engineer

Autism Strikes 1 in 166
Find The Cause ~ Find The Cure
http://www.autismspeaks.org/
Reply all
Reply to author
Forward
0 new messages