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...
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 = { ...
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...