Friday, 25 November 2016

How to execute a Cron job every 5 minutes ?


Execute a Cron job every 5 minutes
  • Cron syntax [minute 0-59 | */n] [hour 0-23 | */n] [day 1-31] [month 1-12] [DoW 0-6]
  • The first field is for minutes.
    • If you specify * in this field, it runs every minutes.
    • If you specify */5 in the 1st field, it runs every 5 minutes 
      • In the same way, use */10 for every 10 minutes
      • */15 for every 15 minutes
      • */30 for every 30 minutes
*/5 * * * * /home/script/myscript.sh

Friday, 4 November 2016

Hibernate4 : What is cause of error - Hibernate: “Field 'id' doesn't have a default value” ?


Error : Hibernate: “Field 'id' doesn't have a default value”

Cause : Sometimes changes made to the model or to the ORM may not reflect accurately on the database

(Changes made in model after database created)

Solution : Drop and Re-create the table / database