Puneet Behl

I am Puneet Behl working as Associate Technical Lead at TO THE NEW in Technology division. Please go through my blog posts below

Grails

Removing Triggers and Rescheduling a Quartz 2 Job programatically

In my recent project there was a use case to change repeat interval of job so that job runs after every 8 seconds instead of 1 second. [java] class TestJob { def concurrent = false static triggers = { simple repeatInterval: 1000l // execute job once in 1 sec } def execute() { println...

17-Jul-2012

Grails

Using aliases in aggregate functions of criteria queries

When using criteria queries, many times we encounter a use case where we need to order our result not on any field of domain class but on our result set, in these cases aliases can be used. In my project, use case was to find most liked products from the domain: [java] ProductStat{ Date dateCreated Product product } [/java] ...

13-Feb-2012

Grails

Using transactional behaviour with Gorm

All communication between Hibernate and the database runs within the context of a database transaction but the Session itself is lazy in that it only ever initiates a database transaction at the last possible moment.Given that there is a transaction, you would think that if something went wrong, any problems would be rolled back. However,...

14-Mar-2011