Tuesday, June 12, 2012

JBoss 7 and Quartz

Had to get an application which uses Quartz running under JBoss for XA Transactions.  Anything that updates a table and then schedules a job has to use XA Transactions or you will run into data consistency problems when things go bad.  I have had a hell of a time.

When i ran my code under JBoss, it would create jobs in Quartz but they would not be persisted to the database.  This same code, ran just fine under Tomcat, although it had the data integrity hole of not using XA Transactions.

What i found is, to make things work in JBoss, you have to set a flag in your Quartz properties file:

org.quartz.jobStore.dontSetAutoCommitFalse = true

After setting this, my jobs actually persisted!  Hope this helps someone.