Monday, November 20, 2017

get the size of folder contents

du -sh 

Output

15M big_folder
0 dead.letter
4.0K some_file
4.0K some_other_file

Wednesday, November 15, 2017

challenges with grails unique: true

Grails does not evaluate a unique constraint at GORM level but at the database level

    static constraints = {
        property unique: true
    }

This means that you would not get a grails.validation.ValidationException but a org.springframework.dao.DataIntegrityViolationException.

This means that

domainInstance.validate()

would not capture a duplicate "property"