I was skimming some of the Grails documentation and found this bit about the read()
method in Grails. If I'm understanding this correctly, you can pull a "read-only" version of an object from the database that will only be saved on an explicit save()
call. It seems to me then, that you should use a read()
call whenever you have an object that you don't expect to be changed.
But why wouldn't you just always use a read()
call? Since the object will be changed to read/write permissions if you save()
it anyway, wouldn't it be safer to just read in the object instead of getting it?