Grails

Log SQL Query with Data Bindings in grails for a piece of code

Although in grails, we can use the logSql property in the DataSource file to log SQL queries or enable loggers "org.hibernate.SQL" for logging queries and "org.hibernate.type.descriptor.sql.BasicBinder" for logging bindings. But this solution wouldn't be that much helpful if we just want the logging for a particular piece of code rather...

by Sandeep Poonia
Tag: grails sql logging
23-Apr-2015

Grails

Grails performance optimization – Unique constraint

Grails unique constraint is very powerful way to check duplicate keys in any DBMS, but it has some impact on application performance. Lets check it by one example: Suppose we have one domain having the following structure: [code] class User { String firstName String lastName String emailId static constraints = { ...

by Deepak Kumar Mittal
Tag: grails sql logging
20-Dec-2014

Grails

Log Sql in grails for a piece of code

There are time when we need to see the sql logging statement just for a method of for a particular code. Although we already have logSql property in DataSource to do it for us but it sometimes makes difficult if we need to see the log for a small piece of code rather than for whole project. So I need something that will execute my code...

by Uday Pratap Singh
Tag: grails sql logging
21-Oct-2011