syncope-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ilgro...@apache.org
Subject svn commit: r1399709 - in /incubator/syncope/trunk: ./ core/src/main/java/org/apache/syncope/core/init/ core/src/main/java/org/apache/syncope/core/rest/controller/ core/src/main/java/org/apache/syncope/core/rest/data/ core/src/main/java/org/apache/sync...
Date Thu, 18 Oct 2012 15:57:28 GMT
Author: ilgrosso
Date: Thu Oct 18 15:57:27 2012
New Revision: 1399709

URL: http://svn.apache.org/viewvc?rev=1399709&view=rev
Log:
[SYNCOPE-93] Upgraded to Quartz 2.1.6 with all needed API changes

Added:
    incubator/syncope/trunk/core/src/main/resources/quartz/tables_sqlServer.sql   (with props)
Removed:
    incubator/syncope/trunk/core/src/main/resources/quartz/tables_hsqldb.sql
    incubator/syncope/trunk/core/src/main/resources/quartz/tables_sqlserver.sql
Modified:
    incubator/syncope/trunk/core/src/main/java/org/apache/syncope/core/init/ImplementationClassNamesLoader.java
    incubator/syncope/trunk/core/src/main/java/org/apache/syncope/core/init/JobInstanceLoader.java
    incubator/syncope/trunk/core/src/main/java/org/apache/syncope/core/rest/controller/ReportController.java
    incubator/syncope/trunk/core/src/main/java/org/apache/syncope/core/rest/controller/TaskController.java
    incubator/syncope/trunk/core/src/main/java/org/apache/syncope/core/rest/data/ReportDataBinder.java
    incubator/syncope/trunk/core/src/main/java/org/apache/syncope/core/rest/data/TaskDataBinder.java
    incubator/syncope/trunk/core/src/main/java/org/apache/syncope/core/scheduling/AbstractTaskJob.java
    incubator/syncope/trunk/core/src/main/java/org/apache/syncope/core/scheduling/NotificationJob.java
    incubator/syncope/trunk/core/src/main/java/org/apache/syncope/core/scheduling/ReportJob.java
    incubator/syncope/trunk/core/src/main/java/org/apache/syncope/core/scheduling/SpringBeanJobFactory.java
    incubator/syncope/trunk/core/src/main/resources/quartz/tables_h2.sql
    incubator/syncope/trunk/core/src/main/resources/quartz/tables_mysql.sql
    incubator/syncope/trunk/core/src/main/resources/quartz/tables_mysql_innodb.sql
    incubator/syncope/trunk/core/src/main/resources/quartz/tables_oracle.sql
    incubator/syncope/trunk/core/src/main/resources/quartz/tables_postgres.sql
    incubator/syncope/trunk/core/src/test/resources/sqlserver/persistence.properties
    incubator/syncope/trunk/pom.xml

Modified: incubator/syncope/trunk/core/src/main/java/org/apache/syncope/core/init/ImplementationClassNamesLoader.java
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/core/src/main/java/org/apache/syncope/core/init/ImplementationClassNamesLoader.java?rev=1399709&r1=1399708&r2=1399709&view=diff
==============================================================================
--- incubator/syncope/trunk/core/src/main/java/org/apache/syncope/core/init/ImplementationClassNamesLoader.java (original)
+++ incubator/syncope/trunk/core/src/main/java/org/apache/syncope/core/init/ImplementationClassNamesLoader.java Thu Oct 18 15:57:27 2012
@@ -24,8 +24,13 @@ import java.util.EnumMap;
 import java.util.HashSet;
 import java.util.Map;
 import java.util.Set;
+import org.apache.syncope.core.persistence.validation.attrvalue.Validator;
+import org.apache.syncope.core.report.Reportlet;
+import org.apache.syncope.core.scheduling.NotificationJob;
+import org.apache.syncope.core.scheduling.ReportJob;
+import org.apache.syncope.core.scheduling.SyncJob;
+import org.apache.syncope.core.scheduling.SyncJobActions;
 import org.quartz.Job;
-import org.quartz.StatefulJob;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -35,12 +40,6 @@ import org.springframework.core.type.Cla
 import org.springframework.core.type.classreading.CachingMetadataReaderFactory;
 import org.springframework.stereotype.Component;
 import org.springframework.util.ClassUtils;
-import org.apache.syncope.core.persistence.validation.attrvalue.Validator;
-import org.apache.syncope.core.report.Reportlet;
-import org.apache.syncope.core.scheduling.NotificationJob;
-import org.apache.syncope.core.scheduling.ReportJob;
-import org.apache.syncope.core.scheduling.SyncJob;
-import org.apache.syncope.core.scheduling.SyncJobActions;
 
 /**
  * Cache class names for all implementations of Syncope interfaces found in classpath, for later usage.
@@ -87,7 +86,7 @@ public class ImplementationClassNamesLoa
                         classNames.get(Type.REPORTLET).add(clazz.getName());
                     }
 
-                    if ((interfaces.contains(Job.class) || interfaces.contains(StatefulJob.class))
+                    if ((interfaces.contains(Job.class))
                             && !metadata.isAbstract() && !SyncJob.class.getName().equals(metadata.getClassName())
                             && !ReportJob.class.getName().equals(metadata.getClassName())
                             && !NotificationJob.class.getName().equals(metadata.getClassName())) {

Modified: incubator/syncope/trunk/core/src/main/java/org/apache/syncope/core/init/JobInstanceLoader.java
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/core/src/main/java/org/apache/syncope/core/init/JobInstanceLoader.java?rev=1399709&r1=1399708&r2=1399709&view=diff
==============================================================================
--- incubator/syncope/trunk/core/src/main/java/org/apache/syncope/core/init/JobInstanceLoader.java (original)
+++ incubator/syncope/trunk/core/src/main/java/org/apache/syncope/core/init/JobInstanceLoader.java Thu Oct 18 15:57:27 2012
@@ -40,18 +40,19 @@ import org.apache.syncope.core.schedulin
 import org.apache.syncope.core.scheduling.SyncJobActions;
 import org.apache.syncope.core.util.ApplicationContextProvider;
 import org.quartz.Job;
-import org.quartz.JobDetail;
 import org.quartz.JobExecutionContext;
+import org.quartz.JobKey;
 import org.quartz.Scheduler;
 import org.quartz.SchedulerException;
+import org.quartz.TriggerKey;
+import org.quartz.impl.JobDetailImpl;
+import org.quartz.impl.triggers.CronTriggerImpl;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.support.AbstractBeanDefinition;
 import org.springframework.beans.factory.support.DefaultListableBeanFactory;
 import org.springframework.context.ConfigurableApplicationContext;
-import org.springframework.scheduling.quartz.CronTriggerBean;
-import org.springframework.scheduling.quartz.JobDetailBean;
 import org.springframework.scheduling.quartz.SchedulerFactoryBean;
 import org.springframework.stereotype.Component;
 import org.springframework.transaction.annotation.Transactional;
@@ -124,12 +125,12 @@ public class JobInstanceLoader {
             for (JobExecutionContext jobCtx : (List<JobExecutionContext>) scheduler.getScheduler().
                     getCurrentlyExecutingJobs()) {
 
-                if (jobName.equals(jobCtx.getJobDetail().getName())
-                        && Scheduler.DEFAULT_GROUP.equals(jobCtx.getJobDetail().getGroup())) {
+                if (jobName.equals(jobCtx.getJobDetail().getKey().getName())
+                        && Scheduler.DEFAULT_GROUP.equals(jobCtx.getJobDetail().getKey().getGroup())) {
 
                     jobAlreadyRunning = true;
 
-                    LOG.debug("Job {} already running, cancel", jobCtx.getJobDetail().getFullName());
+                    LOG.debug("Job {} already running, cancel", jobCtx.getJobDetail().getKey());
                 }
             }
 
@@ -145,7 +146,7 @@ public class JobInstanceLoader {
         getBeanFactory().registerSingleton(jobName, jobInstance);
 
         // 2. JobDetail bean
-        JobDetail jobDetail = new JobDetailBean();
+        JobDetailImpl jobDetail = new JobDetailImpl();
         jobDetail.setName(jobName);
         jobDetail.setGroup(Scheduler.DEFAULT_GROUP);
         jobDetail.setJobClass(jobInstance.getClass());
@@ -154,7 +155,7 @@ public class JobInstanceLoader {
         if (cronExpression == null) {
             scheduler.getScheduler().addJob(jobDetail, true);
         } else {
-            CronTriggerBean cronTrigger = new CronTriggerBean();
+            CronTriggerImpl cronTrigger = new CronTriggerImpl();
             cronTrigger.setName(getTriggerName(jobName));
             cronTrigger.setCronExpression(cronExpression);
 
@@ -200,8 +201,8 @@ public class JobInstanceLoader {
 
     private void unregisterJob(final String jobName) {
         try {
-            scheduler.getScheduler().unscheduleJob(jobName, Scheduler.DEFAULT_GROUP);
-            scheduler.getScheduler().deleteJob(jobName, Scheduler.DEFAULT_GROUP);
+            scheduler.getScheduler().unscheduleJob(new TriggerKey(jobName, Scheduler.DEFAULT_GROUP));
+            scheduler.getScheduler().deleteJob(new JobKey(jobName, Scheduler.DEFAULT_GROUP));
         } catch (SchedulerException e) {
             LOG.error("Could not remove job " + jobName, e);
         }

Modified: incubator/syncope/trunk/core/src/main/java/org/apache/syncope/core/rest/controller/ReportController.java
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/core/src/main/java/org/apache/syncope/core/rest/controller/ReportController.java?rev=1399709&r1=1399708&r2=1399709&view=diff
==============================================================================
--- incubator/syncope/trunk/core/src/main/java/org/apache/syncope/core/rest/controller/ReportController.java (original)
+++ incubator/syncope/trunk/core/src/main/java/org/apache/syncope/core/rest/controller/ReportController.java Thu Oct 18 15:57:27 2012
@@ -57,7 +57,7 @@ import org.apache.syncope.types.ReportEx
 import org.apache.syncope.types.ReportExecStatus;
 import org.apache.syncope.types.SyncopeClientExceptionType;
 import org.apache.xmlgraphics.util.MimeConstants;
-import org.quartz.JobDataMap;
+import org.quartz.JobKey;
 import org.quartz.Scheduler;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.http.HttpStatus;
@@ -365,7 +365,8 @@ public class ReportController extends Ab
         try {
             jobInstanceLoader.registerJob(report);
 
-            scheduler.getScheduler().triggerJob(JobInstanceLoader.getJobName(report), Scheduler.DEFAULT_GROUP);
+            scheduler.getScheduler().triggerJob(
+                    new JobKey(JobInstanceLoader.getJobName(report), Scheduler.DEFAULT_GROUP));
 
             auditManager.audit(Category.report, ReportSubCategory.execute, Result.success,
                     "Successfully started execution for report: " + report.getId());

Modified: incubator/syncope/trunk/core/src/main/java/org/apache/syncope/core/rest/controller/TaskController.java
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/core/src/main/java/org/apache/syncope/core/rest/controller/TaskController.java?rev=1399709&r1=1399708&r2=1399709&view=diff
==============================================================================
--- incubator/syncope/trunk/core/src/main/java/org/apache/syncope/core/rest/controller/TaskController.java (original)
+++ incubator/syncope/trunk/core/src/main/java/org/apache/syncope/core/rest/controller/TaskController.java Thu Oct 18 15:57:27 2012
@@ -52,6 +52,7 @@ import org.apache.syncope.types.Propagat
 import org.apache.syncope.types.PropagationTaskExecStatus;
 import org.apache.syncope.types.SyncopeClientExceptionType;
 import org.quartz.JobDataMap;
+import org.quartz.JobKey;
 import org.quartz.Scheduler;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.http.HttpStatus;
@@ -322,8 +323,8 @@ public class TaskController extends Abst
 
                     JobDataMap map = new JobDataMap();
                     map.put(AbstractTaskJob.DRY_RUN_JOBDETAIL_KEY, dryRun);
-                    scheduler.getScheduler().triggerJob(JobInstanceLoader.getJobName(task), Scheduler.DEFAULT_GROUP,
-                            map);
+                    scheduler.getScheduler().triggerJob(
+                            new JobKey(JobInstanceLoader.getJobName(task), Scheduler.DEFAULT_GROUP), map);
                 } catch (Exception e) {
                     LOG.error("While executing task {}", task, e);
 
@@ -425,7 +426,7 @@ public class TaskController extends Abst
             throw new NotFoundException("Task " + taskId);
         }
         TaskUtil taskUtil = getTaskUtil(task);
-        
+
         TaskTO taskToDelete = binder.getTaskTO(task, taskUtil);
 
         if (TaskUtil.SCHED == taskUtil || TaskUtil.SYNC == taskUtil) {
@@ -436,7 +437,7 @@ public class TaskController extends Abst
 
         auditManager.audit(Category.task, TaskSubCategory.delete, Result.success,
                 "Successfully deleted task: " + task.getId() + "/" + taskUtil);
-        
+
         return taskToDelete;
     }
 
@@ -449,7 +450,7 @@ public class TaskController extends Abst
         if (taskExec == null) {
             throw new NotFoundException("Task execution " + executionId);
         }
-        
+
         TaskExecTO taskExecutionToDelete = binder.getTaskExecTO(taskExec);
 
         taskExecDAO.delete(taskExec);

Modified: incubator/syncope/trunk/core/src/main/java/org/apache/syncope/core/rest/data/ReportDataBinder.java
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/core/src/main/java/org/apache/syncope/core/rest/data/ReportDataBinder.java?rev=1399709&r1=1399708&r2=1399709&view=diff
==============================================================================
--- incubator/syncope/trunk/core/src/main/java/org/apache/syncope/core/rest/data/ReportDataBinder.java (original)
+++ incubator/syncope/trunk/core/src/main/java/org/apache/syncope/core/rest/data/ReportDataBinder.java Thu Oct 18 15:57:27 2012
@@ -33,6 +33,7 @@ import org.apache.syncope.core.report.Re
 import org.quartz.Scheduler;
 import org.quartz.SchedulerException;
 import org.quartz.Trigger;
+import org.quartz.TriggerKey;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.BeanUtils;
@@ -137,7 +138,7 @@ public class ReportDataBinder {
 
         Trigger trigger;
         try {
-            trigger = scheduler.getScheduler().getTrigger(triggerName, Scheduler.DEFAULT_GROUP);
+            trigger = scheduler.getScheduler().getTrigger(new TriggerKey(triggerName, Scheduler.DEFAULT_GROUP));
         } catch (SchedulerException e) {
             LOG.warn("While trying to get to " + triggerName, e);
             trigger = null;

Modified: incubator/syncope/trunk/core/src/main/java/org/apache/syncope/core/rest/data/TaskDataBinder.java
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/core/src/main/java/org/apache/syncope/core/rest/data/TaskDataBinder.java?rev=1399709&r1=1399708&r2=1399709&view=diff
==============================================================================
--- incubator/syncope/trunk/core/src/main/java/org/apache/syncope/core/rest/data/TaskDataBinder.java (original)
+++ incubator/syncope/trunk/core/src/main/java/org/apache/syncope/core/rest/data/TaskDataBinder.java Thu Oct 18 15:57:27 2012
@@ -47,6 +47,7 @@ import org.apache.syncope.types.SyncopeC
 import org.quartz.Scheduler;
 import org.quartz.SchedulerException;
 import org.quartz.Trigger;
+import org.quartz.TriggerKey;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.BeanUtils;
@@ -207,12 +208,11 @@ public class TaskDataBinder {
     private void setExecTime(final SchedTaskTO taskTO, final Task task) {
         String triggerName = JobInstanceLoader.getTriggerName(JobInstanceLoader.getJobName(task));
 
-        Trigger trigger;
+        Trigger trigger = null;
         try {
-            trigger = scheduler.getScheduler().getTrigger(triggerName, Scheduler.DEFAULT_GROUP);
+            trigger = scheduler.getScheduler().getTrigger(new TriggerKey(triggerName, Scheduler.DEFAULT_GROUP));
         } catch (SchedulerException e) {
             LOG.warn("While trying to get to " + triggerName, e);
-            trigger = null;
         }
 
         if (trigger != null) {

Modified: incubator/syncope/trunk/core/src/main/java/org/apache/syncope/core/scheduling/AbstractTaskJob.java
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/core/src/main/java/org/apache/syncope/core/scheduling/AbstractTaskJob.java?rev=1399709&r1=1399708&r2=1399709&view=diff
==============================================================================
--- incubator/syncope/trunk/core/src/main/java/org/apache/syncope/core/scheduling/AbstractTaskJob.java (original)
+++ incubator/syncope/trunk/core/src/main/java/org/apache/syncope/core/scheduling/AbstractTaskJob.java Thu Oct 18 15:57:27 2012
@@ -25,9 +25,10 @@ import org.apache.syncope.core.persisten
 import org.apache.syncope.core.persistence.beans.TaskExec;
 import org.apache.syncope.core.persistence.dao.TaskDAO;
 import org.apache.syncope.core.persistence.dao.TaskExecDAO;
+import org.quartz.DisallowConcurrentExecution;
+import org.quartz.Job;
 import org.quartz.JobExecutionContext;
 import org.quartz.JobExecutionException;
-import org.quartz.StatefulJob;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -36,7 +37,8 @@ import org.springframework.beans.factory
  * Base job implementation that delegates to concrete implementation the actual job execution and provides some
  * background settings (like as the corresponding Task, for example).
  */
-public abstract class AbstractTaskJob implements StatefulJob {
+@DisallowConcurrentExecution
+public abstract class AbstractTaskJob implements Job {
 
     public static final String DRY_RUN_JOBDETAIL_KEY = "dryRun";
 

Modified: incubator/syncope/trunk/core/src/main/java/org/apache/syncope/core/scheduling/NotificationJob.java
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/core/src/main/java/org/apache/syncope/core/scheduling/NotificationJob.java?rev=1399709&r1=1399708&r2=1399709&view=diff
==============================================================================
--- incubator/syncope/trunk/core/src/main/java/org/apache/syncope/core/scheduling/NotificationJob.java (original)
+++ incubator/syncope/trunk/core/src/main/java/org/apache/syncope/core/scheduling/NotificationJob.java Thu Oct 18 15:57:27 2012
@@ -33,9 +33,10 @@ import org.apache.syncope.types.AuditEle
 import org.apache.syncope.types.AuditElements.NotificationSubCategory;
 import org.apache.syncope.types.AuditElements.Result;
 import org.apache.syncope.types.TraceLevel;
+import org.quartz.DisallowConcurrentExecution;
+import org.quartz.Job;
 import org.quartz.JobExecutionContext;
 import org.quartz.JobExecutionException;
-import org.quartz.StatefulJob;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -47,7 +48,8 @@ import org.springframework.mail.javamail
  *
  * @see NotificationTask
  */
-public class NotificationJob implements StatefulJob {
+@DisallowConcurrentExecution
+public class NotificationJob implements Job {
 
     enum Status {
 

Modified: incubator/syncope/trunk/core/src/main/java/org/apache/syncope/core/scheduling/ReportJob.java
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/core/src/main/java/org/apache/syncope/core/scheduling/ReportJob.java?rev=1399709&r1=1399708&r2=1399709&view=diff
==============================================================================
--- incubator/syncope/trunk/core/src/main/java/org/apache/syncope/core/scheduling/ReportJob.java (original)
+++ incubator/syncope/trunk/core/src/main/java/org/apache/syncope/core/scheduling/ReportJob.java Thu Oct 18 15:57:27 2012
@@ -44,9 +44,10 @@ import static org.apache.syncope.core.sc
 import static org.apache.syncope.core.scheduling.ReportXMLConst.XSD_STRING;
 import org.apache.syncope.core.util.ApplicationContextProvider;
 import org.apache.syncope.types.ReportExecStatus;
+import org.quartz.DisallowConcurrentExecution;
+import org.quartz.Job;
 import org.quartz.JobExecutionContext;
 import org.quartz.JobExecutionException;
-import org.quartz.StatefulJob;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -57,7 +58,8 @@ import org.xml.sax.helpers.AttributesImp
 /**
  * Quartz job for executing a given report.
  */
-public class ReportJob implements StatefulJob {
+@DisallowConcurrentExecution
+public class ReportJob implements Job {
 
     /**
      * Logger.

Modified: incubator/syncope/trunk/core/src/main/java/org/apache/syncope/core/scheduling/SpringBeanJobFactory.java
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/core/src/main/java/org/apache/syncope/core/scheduling/SpringBeanJobFactory.java?rev=1399709&r1=1399708&r2=1399709&view=diff
==============================================================================
--- incubator/syncope/trunk/core/src/main/java/org/apache/syncope/core/scheduling/SpringBeanJobFactory.java (original)
+++ incubator/syncope/trunk/core/src/main/java/org/apache/syncope/core/scheduling/SpringBeanJobFactory.java Thu Oct 18 15:57:27 2012
@@ -51,8 +51,8 @@ public class SpringBeanJobFactory extend
     }
 
     /**
-     * An implementation of SpringBeanJobFactory that retrieves the bean from
-     * the Spring context so that autowiring and transactions work.
+     * An implementation of SpringBeanJobFactory that retrieves the bean from the Spring context so that autowiring and
+     * transactions work.
      *
      * {@inheritDoc}
      */
@@ -63,8 +63,8 @@ public class SpringBeanJobFactory extend
 
         // Try to re-create job bean from underlying task (useful for managing
         // failover scenarios)
-        if (!ctx.containsBean(bundle.getJobDetail().getName())) {
-            Long taskId = JobInstanceLoader.getTaskIdFromJobName(bundle.getJobDetail().getName());
+        if (!ctx.containsBean(bundle.getJobDetail().getKey().getName())) {
+            Long taskId = JobInstanceLoader.getTaskIdFromJobName(bundle.getJobDetail().getKey().getName());
             if (taskId != null) {
                 TaskDAO taskDAO = ctx.getBean(TaskDAO.class);
                 SchedTask task = taskDAO.find(taskId);
@@ -73,7 +73,7 @@ public class SpringBeanJobFactory extend
                 jobInstanceLoader.registerJob(task, task.getJobClassName(), task.getCronExpression());
             }
 
-            Long reportId = JobInstanceLoader.getReportIdFromJobName(bundle.getJobDetail().getName());
+            Long reportId = JobInstanceLoader.getReportIdFromJobName(bundle.getJobDetail().getKey().getName());
             if (reportId != null) {
                 ReportDAO reportDAO = ctx.getBean(ReportDAO.class);
                 Report report = reportDAO.find(reportId);
@@ -83,7 +83,7 @@ public class SpringBeanJobFactory extend
             }
         }
 
-        final Object job = ctx.getBean(bundle.getJobDetail().getName());
+        final Object job = ctx.getBean(bundle.getJobDetail().getKey().getName());
         final BeanWrapper wrapper = PropertyAccessorFactory.forBeanPropertyAccess(job);
         if (isEligibleForPropertyPopulation(wrapper.getWrappedInstance())) {
             final MutablePropertyValues pvs = new MutablePropertyValues();

Modified: incubator/syncope/trunk/core/src/main/resources/quartz/tables_h2.sql
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/core/src/main/resources/quartz/tables_h2.sql?rev=1399709&r1=1399708&r2=1399709&view=diff
==============================================================================
--- incubator/syncope/trunk/core/src/main/resources/quartz/tables_h2.sql (original)
+++ incubator/syncope/trunk/core/src/main/resources/quartz/tables_h2.sql Thu Oct 18 15:57:27 2012
@@ -26,11 +26,13 @@
 -- org.quartz.jobStore.driverDelegateClass = org.quartz.impl.jdbcjobstore.StdJDBCDelegate
 
 CREATE TABLE QRTZ_CALENDARS (
+  SCHED_NAME VARCHAR(120) NOT NULL,
   CALENDAR_NAME VARCHAR (200)  NOT NULL ,
   CALENDAR IMAGE NOT NULL
 );
 
 CREATE TABLE QRTZ_CRON_TRIGGERS (
+  SCHED_NAME VARCHAR(120) NOT NULL,
   TRIGGER_NAME VARCHAR (200)  NOT NULL ,
   TRIGGER_GROUP VARCHAR (200)  NOT NULL ,
   CRON_EXPRESSION VARCHAR (120)  NOT NULL ,
@@ -38,53 +40,52 @@ CREATE TABLE QRTZ_CRON_TRIGGERS (
 );
 
 CREATE TABLE QRTZ_FIRED_TRIGGERS (
+  SCHED_NAME VARCHAR(120) NOT NULL,
   ENTRY_ID VARCHAR (95)  NOT NULL ,
   TRIGGER_NAME VARCHAR (200)  NOT NULL ,
   TRIGGER_GROUP VARCHAR (200)  NOT NULL ,
-  IS_VOLATILE BOOLEAN  NOT NULL ,
   INSTANCE_NAME VARCHAR (200)  NOT NULL ,
   FIRED_TIME BIGINT NOT NULL ,
   PRIORITY INTEGER NOT NULL ,
   STATE VARCHAR (16)  NOT NULL,
   JOB_NAME VARCHAR (200)  NULL ,
   JOB_GROUP VARCHAR (200)  NULL ,
-  IS_STATEFUL BOOLEAN  NULL ,
+  IS_NONCONCURRENT BOOLEAN  NULL ,
   REQUESTS_RECOVERY BOOLEAN  NULL 
 );
 
 CREATE TABLE QRTZ_PAUSED_TRIGGER_GRPS (
+  SCHED_NAME VARCHAR(120) NOT NULL,
   TRIGGER_GROUP VARCHAR (200)  NOT NULL 
 );
 
 CREATE TABLE QRTZ_SCHEDULER_STATE (
+  SCHED_NAME VARCHAR(120) NOT NULL,
   INSTANCE_NAME VARCHAR (200)  NOT NULL ,
   LAST_CHECKIN_TIME BIGINT NOT NULL ,
   CHECKIN_INTERVAL BIGINT NOT NULL
 );
 
 CREATE TABLE QRTZ_LOCKS (
+  SCHED_NAME VARCHAR(120) NOT NULL,
   LOCK_NAME VARCHAR (40)  NOT NULL 
 );
 
 CREATE TABLE QRTZ_JOB_DETAILS (
+  SCHED_NAME VARCHAR(120) NOT NULL,
   JOB_NAME VARCHAR (200)  NOT NULL ,
   JOB_GROUP VARCHAR (200)  NOT NULL ,
   DESCRIPTION VARCHAR (250) NULL ,
   JOB_CLASS_NAME VARCHAR (250)  NOT NULL ,
   IS_DURABLE BOOLEAN  NOT NULL ,
-  IS_VOLATILE BOOLEAN  NOT NULL ,
-  IS_STATEFUL BOOLEAN  NOT NULL ,
+  IS_NONCONCURRENT BOOLEAN  NOT NULL ,
+  IS_UPDATE_DATA BOOLEAN  NOT NULL ,
   REQUESTS_RECOVERY BOOLEAN  NOT NULL ,
   JOB_DATA IMAGE NULL
 );
 
-CREATE TABLE QRTZ_JOB_LISTENERS (
-  JOB_NAME VARCHAR (200)  NOT NULL ,
-  JOB_GROUP VARCHAR (200)  NOT NULL ,
-  JOB_LISTENER VARCHAR (200)  NOT NULL
-);
-
 CREATE TABLE QRTZ_SIMPLE_TRIGGERS (
+  SCHED_NAME VARCHAR(120) NOT NULL,
   TRIGGER_NAME VARCHAR (200)  NOT NULL ,
   TRIGGER_GROUP VARCHAR (200)  NOT NULL ,
   REPEAT_COUNT BIGINT NOT NULL ,
@@ -92,24 +93,37 @@ CREATE TABLE QRTZ_SIMPLE_TRIGGERS (
   TIMES_TRIGGERED BIGINT NOT NULL
 );
 
-CREATE TABLE QRTZ_BLOB_TRIGGERS (
-  TRIGGER_NAME VARCHAR (200)  NOT NULL ,
-  TRIGGER_GROUP VARCHAR (200)  NOT NULL ,
-  BLOB_DATA IMAGE NULL
+CREATE TABLE qrtz_simprop_triggers
+  (          
+    SCHED_NAME VARCHAR(120) NOT NULL,
+    TRIGGER_NAME VARCHAR(200) NOT NULL,
+    TRIGGER_GROUP VARCHAR(200) NOT NULL,
+    STR_PROP_1 VARCHAR(512) NULL,
+    STR_PROP_2 VARCHAR(512) NULL,
+    STR_PROP_3 VARCHAR(512) NULL,
+    INT_PROP_1 INTEGER NULL,
+    INT_PROP_2 INTEGER NULL,
+    LONG_PROP_1 BIGINT NULL,
+    LONG_PROP_2 BIGINT NULL,
+    DEC_PROP_1 NUMERIC(13,4) NULL,
+    DEC_PROP_2 NUMERIC(13,4) NULL,
+    BOOL_PROP_1 BOOLEAN NULL,
+    BOOL_PROP_2 BOOLEAN NULL,
 );
 
-CREATE TABLE QRTZ_TRIGGER_LISTENERS (
+CREATE TABLE QRTZ_BLOB_TRIGGERS (
+  SCHED_NAME VARCHAR(120) NOT NULL,
   TRIGGER_NAME VARCHAR (200)  NOT NULL ,
   TRIGGER_GROUP VARCHAR (200)  NOT NULL ,
-  TRIGGER_LISTENER VARCHAR (200)  NOT NULL
+  BLOB_DATA IMAGE NULL
 );
 
 CREATE TABLE QRTZ_TRIGGERS (
+  SCHED_NAME VARCHAR(120) NOT NULL,
   TRIGGER_NAME VARCHAR (200)  NOT NULL ,
   TRIGGER_GROUP VARCHAR (200)  NOT NULL ,
   JOB_NAME VARCHAR (200)  NOT NULL ,
   JOB_GROUP VARCHAR (200)  NOT NULL ,
-  IS_VOLATILE BOOLEAN  NOT NULL ,
   DESCRIPTION VARCHAR (250) NULL ,
   NEXT_FIRE_TIME BIGINT NULL ,
   PREV_FIRE_TIME BIGINT NULL ,
@@ -126,12 +140,14 @@ CREATE TABLE QRTZ_TRIGGERS (
 ALTER TABLE QRTZ_CALENDARS  ADD
   CONSTRAINT PK_QRTZ_CALENDARS PRIMARY KEY  
   (
+    SCHED_NAME,
     CALENDAR_NAME
   );
 
 ALTER TABLE QRTZ_CRON_TRIGGERS  ADD
   CONSTRAINT PK_QRTZ_CRON_TRIGGERS PRIMARY KEY  
   (
+    SCHED_NAME,
     TRIGGER_NAME,
     TRIGGER_GROUP
   );
@@ -139,60 +155,59 @@ ALTER TABLE QRTZ_CRON_TRIGGERS  ADD
 ALTER TABLE QRTZ_FIRED_TRIGGERS  ADD
   CONSTRAINT PK_QRTZ_FIRED_TRIGGERS PRIMARY KEY  
   (
+    SCHED_NAME,
     ENTRY_ID
   );
 
 ALTER TABLE QRTZ_PAUSED_TRIGGER_GRPS  ADD
   CONSTRAINT PK_QRTZ_PAUSED_TRIGGER_GRPS PRIMARY KEY  
   (
+    SCHED_NAME,
     TRIGGER_GROUP
   );
 
 ALTER TABLE QRTZ_SCHEDULER_STATE  ADD
   CONSTRAINT PK_QRTZ_SCHEDULER_STATE PRIMARY KEY  
   (
+    SCHED_NAME,
     INSTANCE_NAME
   );
 
 ALTER TABLE QRTZ_LOCKS  ADD
   CONSTRAINT PK_QRTZ_LOCKS PRIMARY KEY  
   (
+    SCHED_NAME,
     LOCK_NAME
   );
 
 ALTER TABLE QRTZ_JOB_DETAILS  ADD
   CONSTRAINT PK_QRTZ_JOB_DETAILS PRIMARY KEY  
   (
+    SCHED_NAME,
     JOB_NAME,
     JOB_GROUP
   );
 
-ALTER TABLE QRTZ_JOB_LISTENERS  ADD
-  CONSTRAINT PK_QRTZ_JOB_LISTENERS PRIMARY KEY  
-  (
-    JOB_NAME,
-    JOB_GROUP,
-    JOB_LISTENER
-  );
-
 ALTER TABLE QRTZ_SIMPLE_TRIGGERS  ADD
   CONSTRAINT PK_QRTZ_SIMPLE_TRIGGERS PRIMARY KEY  
   (
+    SCHED_NAME,
     TRIGGER_NAME,
     TRIGGER_GROUP
   );
 
-ALTER TABLE QRTZ_TRIGGER_LISTENERS  ADD
-  CONSTRAINT PK_QRTZ_TRIGGER_LISTENERS PRIMARY KEY  
+ALTER TABLE QRTZ_SIMPROP_TRIGGERS  ADD
+  CONSTRAINT PK_QRTZ_SIMPROP_TRIGGERS PRIMARY KEY  
   (
+    SCHED_NAME,
     TRIGGER_NAME,
-    TRIGGER_GROUP,
-    TRIGGER_LISTENER
+    TRIGGER_GROUP
   );
 
 ALTER TABLE QRTZ_TRIGGERS  ADD
   CONSTRAINT PK_QRTZ_TRIGGERS PRIMARY KEY  
   (
+    SCHED_NAME,
     TRIGGER_NAME,
     TRIGGER_GROUP
   );
@@ -200,56 +215,51 @@ ALTER TABLE QRTZ_TRIGGERS  ADD
 ALTER TABLE QRTZ_CRON_TRIGGERS ADD
   CONSTRAINT FK_QRTZ_CRON_TRIGGERS_QRTZ_TRIGGERS FOREIGN KEY
   (
+    SCHED_NAME,
     TRIGGER_NAME,
     TRIGGER_GROUP
   ) REFERENCES QRTZ_TRIGGERS (
+    SCHED_NAME,
     TRIGGER_NAME,
     TRIGGER_GROUP
   ) ON DELETE CASCADE;
 
-ALTER TABLE QRTZ_JOB_LISTENERS ADD
-  CONSTRAINT FK_QRTZ_JOB_LISTENERS_QRTZ_JOB_DETAILS FOREIGN KEY
-  (
-    JOB_NAME,
-    JOB_GROUP
-  ) REFERENCES QRTZ_JOB_DETAILS (
-    JOB_NAME,
-    JOB_GROUP
-  ) ON DELETE CASCADE;
 
 ALTER TABLE QRTZ_SIMPLE_TRIGGERS ADD
   CONSTRAINT FK_QRTZ_SIMPLE_TRIGGERS_QRTZ_TRIGGERS FOREIGN KEY
   (
+    SCHED_NAME,
     TRIGGER_NAME,
     TRIGGER_GROUP
   ) REFERENCES QRTZ_TRIGGERS (
+    SCHED_NAME,
     TRIGGER_NAME,
     TRIGGER_GROUP
   ) ON DELETE CASCADE;
 
-ALTER TABLE QRTZ_TRIGGER_LISTENERS ADD
-  CONSTRAINT FK_QRTZ_TRIGGER_LISTENERS_QRTZ_TRIGGERS FOREIGN KEY
+ALTER TABLE QRTZ_SIMPROP_TRIGGERS ADD
+  CONSTRAINT FK_QRTZ_SIMPROP_TRIGGERS_QRTZ_TRIGGERS FOREIGN KEY
   (
+    SCHED_NAME,
     TRIGGER_NAME,
     TRIGGER_GROUP
   ) REFERENCES QRTZ_TRIGGERS (
+    SCHED_NAME,
     TRIGGER_NAME,
     TRIGGER_GROUP
   ) ON DELETE CASCADE;
 
+
 ALTER TABLE QRTZ_TRIGGERS ADD
   CONSTRAINT FK_QRTZ_TRIGGERS_QRTZ_JOB_DETAILS FOREIGN KEY
   (
+    SCHED_NAME,
     JOB_NAME,
     JOB_GROUP
   ) REFERENCES QRTZ_JOB_DETAILS (
+    SCHED_NAME,
     JOB_NAME,
     JOB_GROUP
   );
-
-INSERT INTO QRTZ_LOCKS VALUES('TRIGGER_ACCESS');
-INSERT INTO QRTZ_LOCKS VALUES('JOB_ACCESS');
-INSERT INTO QRTZ_LOCKS VALUES('CALENDAR_ACCESS');
-INSERT INTO QRTZ_LOCKS VALUES('STATE_ACCESS');
-INSERT INTO QRTZ_LOCKS VALUES('MISFIRE_ACCESS');
+  
 COMMIT;

Modified: incubator/syncope/trunk/core/src/main/resources/quartz/tables_mysql.sql
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/core/src/main/resources/quartz/tables_mysql.sql?rev=1399709&r1=1399708&r2=1399709&view=diff
==============================================================================
--- incubator/syncope/trunk/core/src/main/resources/quartz/tables_mysql.sql (original)
+++ incubator/syncope/trunk/core/src/main/resources/quartz/tables_mysql.sql Thu Oct 18 15:57:27 2012
@@ -15,37 +15,50 @@
 -- specific language governing permissions and limitations
 -- under the License.
 
+#
+# Quartz seems to work best with the driver mm.mysql-2.0.7-bin.jar
+#
+# PLEASE consider using mysql with innodb tables to avoid locking issues
+#
+# In your Quartz properties file, you'll need to set 
+# org.quartz.jobStore.driverDelegateClass = org.quartz.impl.jdbcjobstore.StdJDBCDelegate
+#
+
+DROP TABLE IF EXISTS QRTZ_FIRED_TRIGGERS;
+DROP TABLE IF EXISTS QRTZ_PAUSED_TRIGGER_GRPS;
+DROP TABLE IF EXISTS QRTZ_SCHEDULER_STATE;
+DROP TABLE IF EXISTS QRTZ_LOCKS;
+DROP TABLE IF EXISTS QRTZ_SIMPLE_TRIGGERS;
+DROP TABLE IF EXISTS QRTZ_SIMPROP_TRIGGERS;
+DROP TABLE IF EXISTS QRTZ_CRON_TRIGGERS;
+DROP TABLE IF EXISTS QRTZ_BLOB_TRIGGERS;
+DROP TABLE IF EXISTS QRTZ_TRIGGERS;
+DROP TABLE IF EXISTS QRTZ_JOB_DETAILS;
+DROP TABLE IF EXISTS QRTZ_CALENDARS;
+
+
 CREATE TABLE QRTZ_JOB_DETAILS
   (
+    SCHED_NAME VARCHAR(120) NOT NULL,
     JOB_NAME  VARCHAR(200) NOT NULL,
     JOB_GROUP VARCHAR(200) NOT NULL,
     DESCRIPTION VARCHAR(250) NULL,
     JOB_CLASS_NAME   VARCHAR(250) NOT NULL,
     IS_DURABLE VARCHAR(1) NOT NULL,
-    IS_VOLATILE VARCHAR(1) NOT NULL,
-    IS_STATEFUL VARCHAR(1) NOT NULL,
+    IS_NONCONCURRENT VARCHAR(1) NOT NULL,
+    IS_UPDATE_DATA VARCHAR(1) NOT NULL,
     REQUESTS_RECOVERY VARCHAR(1) NOT NULL,
     JOB_DATA BLOB NULL,
-    PRIMARY KEY (JOB_NAME,JOB_GROUP)
-);
-
-CREATE TABLE QRTZ_JOB_LISTENERS
-  (
-    JOB_NAME  VARCHAR(200) NOT NULL,
-    JOB_GROUP VARCHAR(200) NOT NULL,
-    JOB_LISTENER VARCHAR(200) NOT NULL,
-    PRIMARY KEY (JOB_NAME,JOB_GROUP,JOB_LISTENER),
-    FOREIGN KEY (JOB_NAME,JOB_GROUP)
-        REFERENCES QRTZ_JOB_DETAILS(JOB_NAME,JOB_GROUP)
+    PRIMARY KEY (SCHED_NAME,JOB_NAME,JOB_GROUP)
 );
 
 CREATE TABLE QRTZ_TRIGGERS
   (
+    SCHED_NAME VARCHAR(120) NOT NULL,
     TRIGGER_NAME VARCHAR(200) NOT NULL,
     TRIGGER_GROUP VARCHAR(200) NOT NULL,
     JOB_NAME  VARCHAR(200) NOT NULL,
     JOB_GROUP VARCHAR(200) NOT NULL,
-    IS_VOLATILE VARCHAR(1) NOT NULL,
     DESCRIPTION VARCHAR(250) NULL,
     NEXT_FIRE_TIME BIGINT(13) NULL,
     PREV_FIRE_TIME BIGINT(13) NULL,
@@ -57,107 +70,115 @@ CREATE TABLE QRTZ_TRIGGERS
     CALENDAR_NAME VARCHAR(200) NULL,
     MISFIRE_INSTR SMALLINT(2) NULL,
     JOB_DATA BLOB NULL,
-    PRIMARY KEY (TRIGGER_NAME,TRIGGER_GROUP),
-    FOREIGN KEY (JOB_NAME,JOB_GROUP)
-        REFERENCES QRTZ_JOB_DETAILS(JOB_NAME,JOB_GROUP)
+    PRIMARY KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP),
+    FOREIGN KEY (SCHED_NAME,JOB_NAME,JOB_GROUP)
+        REFERENCES QRTZ_JOB_DETAILS(SCHED_NAME,JOB_NAME,JOB_GROUP)
 );
 
 CREATE TABLE QRTZ_SIMPLE_TRIGGERS
   (
+    SCHED_NAME VARCHAR(120) NOT NULL,
     TRIGGER_NAME VARCHAR(200) NOT NULL,
     TRIGGER_GROUP VARCHAR(200) NOT NULL,
     REPEAT_COUNT BIGINT(7) NOT NULL,
     REPEAT_INTERVAL BIGINT(12) NOT NULL,
     TIMES_TRIGGERED BIGINT(10) NOT NULL,
-    PRIMARY KEY (TRIGGER_NAME,TRIGGER_GROUP),
-    FOREIGN KEY (TRIGGER_NAME,TRIGGER_GROUP)
-        REFERENCES QRTZ_TRIGGERS(TRIGGER_NAME,TRIGGER_GROUP)
+    PRIMARY KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP),
+    FOREIGN KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP)
+        REFERENCES QRTZ_TRIGGERS(SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP)
 );
 
 CREATE TABLE QRTZ_CRON_TRIGGERS
   (
+    SCHED_NAME VARCHAR(120) NOT NULL,
     TRIGGER_NAME VARCHAR(200) NOT NULL,
     TRIGGER_GROUP VARCHAR(200) NOT NULL,
     CRON_EXPRESSION VARCHAR(200) NOT NULL,
     TIME_ZONE_ID VARCHAR(80),
-    PRIMARY KEY (TRIGGER_NAME,TRIGGER_GROUP),
-    FOREIGN KEY (TRIGGER_NAME,TRIGGER_GROUP)
-        REFERENCES QRTZ_TRIGGERS(TRIGGER_NAME,TRIGGER_GROUP)
+    PRIMARY KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP),
+    FOREIGN KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP)
+        REFERENCES QRTZ_TRIGGERS(SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP)
 );
 
-CREATE TABLE QRTZ_BLOB_TRIGGERS
-  (
+CREATE TABLE QRTZ_SIMPROP_TRIGGERS
+  (          
+    SCHED_NAME VARCHAR(120) NOT NULL,
     TRIGGER_NAME VARCHAR(200) NOT NULL,
     TRIGGER_GROUP VARCHAR(200) NOT NULL,
-    BLOB_DATA BLOB NULL,
-    PRIMARY KEY (TRIGGER_NAME,TRIGGER_GROUP),
-    FOREIGN KEY (TRIGGER_NAME,TRIGGER_GROUP)
-        REFERENCES QRTZ_TRIGGERS(TRIGGER_NAME,TRIGGER_GROUP)
+    STR_PROP_1 VARCHAR(512) NULL,
+    STR_PROP_2 VARCHAR(512) NULL,
+    STR_PROP_3 VARCHAR(512) NULL,
+    INT_PROP_1 INT NULL,
+    INT_PROP_2 INT NULL,
+    LONG_PROP_1 BIGINT NULL,
+    LONG_PROP_2 BIGINT NULL,
+    DEC_PROP_1 NUMERIC(13,4) NULL,
+    DEC_PROP_2 NUMERIC(13,4) NULL,
+    BOOL_PROP_1 VARCHAR(1) NULL,
+    BOOL_PROP_2 VARCHAR(1) NULL,
+    PRIMARY KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP),
+    FOREIGN KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP) 
+    REFERENCES QRTZ_TRIGGERS(SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP)
 );
 
-CREATE TABLE QRTZ_TRIGGER_LISTENERS
+CREATE TABLE QRTZ_BLOB_TRIGGERS
   (
-    TRIGGER_NAME  VARCHAR(200) NOT NULL,
+    SCHED_NAME VARCHAR(120) NOT NULL,
+    TRIGGER_NAME VARCHAR(200) NOT NULL,
     TRIGGER_GROUP VARCHAR(200) NOT NULL,
-    TRIGGER_LISTENER VARCHAR(200) NOT NULL,
-    PRIMARY KEY (TRIGGER_NAME,TRIGGER_GROUP,TRIGGER_LISTENER),
-    FOREIGN KEY (TRIGGER_NAME,TRIGGER_GROUP)
-        REFERENCES QRTZ_TRIGGERS(TRIGGER_NAME,TRIGGER_GROUP)
+    BLOB_DATA BLOB NULL,
+    PRIMARY KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP),
+    FOREIGN KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP)
+        REFERENCES QRTZ_TRIGGERS(SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP)
 );
 
-
 CREATE TABLE QRTZ_CALENDARS
   (
+    SCHED_NAME VARCHAR(120) NOT NULL,
     CALENDAR_NAME  VARCHAR(200) NOT NULL,
     CALENDAR BLOB NOT NULL,
-    PRIMARY KEY (CALENDAR_NAME)
+    PRIMARY KEY (SCHED_NAME,CALENDAR_NAME)
 );
 
-
-
 CREATE TABLE QRTZ_PAUSED_TRIGGER_GRPS
   (
+    SCHED_NAME VARCHAR(120) NOT NULL,
     TRIGGER_GROUP  VARCHAR(200) NOT NULL, 
-    PRIMARY KEY (TRIGGER_GROUP)
+    PRIMARY KEY (SCHED_NAME,TRIGGER_GROUP)
 );
 
 CREATE TABLE QRTZ_FIRED_TRIGGERS
   (
+    SCHED_NAME VARCHAR(120) NOT NULL,
     ENTRY_ID VARCHAR(95) NOT NULL,
     TRIGGER_NAME VARCHAR(200) NOT NULL,
     TRIGGER_GROUP VARCHAR(200) NOT NULL,
-    IS_VOLATILE VARCHAR(1) NOT NULL,
     INSTANCE_NAME VARCHAR(200) NOT NULL,
     FIRED_TIME BIGINT(13) NOT NULL,
     PRIORITY INTEGER NOT NULL,
     STATE VARCHAR(16) NOT NULL,
     JOB_NAME VARCHAR(200) NULL,
     JOB_GROUP VARCHAR(200) NULL,
-    IS_STATEFUL VARCHAR(1) NULL,
+    IS_NONCONCURRENT VARCHAR(1) NULL,
     REQUESTS_RECOVERY VARCHAR(1) NULL,
-    PRIMARY KEY (ENTRY_ID)
+    PRIMARY KEY (SCHED_NAME,ENTRY_ID)
 );
 
 CREATE TABLE QRTZ_SCHEDULER_STATE
   (
+    SCHED_NAME VARCHAR(120) NOT NULL,
     INSTANCE_NAME VARCHAR(200) NOT NULL,
     LAST_CHECKIN_TIME BIGINT(13) NOT NULL,
     CHECKIN_INTERVAL BIGINT(13) NOT NULL,
-    PRIMARY KEY (INSTANCE_NAME)
+    PRIMARY KEY (SCHED_NAME,INSTANCE_NAME)
 );
 
 CREATE TABLE QRTZ_LOCKS
   (
+    SCHED_NAME VARCHAR(120) NOT NULL,
     LOCK_NAME  VARCHAR(40) NOT NULL, 
-    PRIMARY KEY (LOCK_NAME)
+    PRIMARY KEY (SCHED_NAME,LOCK_NAME)
 );
 
 
-INSERT INTO QRTZ_LOCKS values('TRIGGER_ACCESS');
-INSERT INTO QRTZ_LOCKS values('JOB_ACCESS');
-INSERT INTO QRTZ_LOCKS values('CALENDAR_ACCESS');
-INSERT INTO QRTZ_LOCKS values('STATE_ACCESS');
-INSERT INTO QRTZ_LOCKS values('MISFIRE_ACCESS');
-
-
 commit;

Modified: incubator/syncope/trunk/core/src/main/resources/quartz/tables_mysql_innodb.sql
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/core/src/main/resources/quartz/tables_mysql_innodb.sql?rev=1399709&r1=1399708&r2=1399709&view=diff
==============================================================================
--- incubator/syncope/trunk/core/src/main/resources/quartz/tables_mysql_innodb.sql (original)
+++ incubator/syncope/trunk/core/src/main/resources/quartz/tables_mysql_innodb.sql Thu Oct 18 15:57:27 2012
@@ -15,35 +15,46 @@
 -- specific language governing permissions and limitations
 -- under the License.
 
+#
+# In your Quartz properties file, you'll need to set 
+# org.quartz.jobStore.driverDelegateClass = org.quartz.impl.jdbcjobstore.StdJDBCDelegate
+#
+#
+# By: Ron Cordell - roncordell
+#  I didn't see this anywhere, so I thought I'd post it here. This is the script from Quartz to create the tables in a MySQL database, modified to use INNODB instead of MYISAM.
+
+DROP TABLE IF EXISTS QRTZ_FIRED_TRIGGERS;
+DROP TABLE IF EXISTS QRTZ_PAUSED_TRIGGER_GRPS;
+DROP TABLE IF EXISTS QRTZ_SCHEDULER_STATE;
+DROP TABLE IF EXISTS QRTZ_LOCKS;
+DROP TABLE IF EXISTS QRTZ_SIMPLE_TRIGGERS;
+DROP TABLE IF EXISTS QRTZ_SIMPROP_TRIGGERS;
+DROP TABLE IF EXISTS QRTZ_CRON_TRIGGERS;
+DROP TABLE IF EXISTS QRTZ_BLOB_TRIGGERS;
+DROP TABLE IF EXISTS QRTZ_TRIGGERS;
+DROP TABLE IF EXISTS QRTZ_JOB_DETAILS;
+DROP TABLE IF EXISTS QRTZ_CALENDARS;
+
 CREATE TABLE QRTZ_JOB_DETAILS(
+SCHED_NAME VARCHAR(120) NOT NULL,
 JOB_NAME VARCHAR(200) NOT NULL,
 JOB_GROUP VARCHAR(200) NOT NULL,
 DESCRIPTION VARCHAR(250) NULL,
 JOB_CLASS_NAME VARCHAR(250) NOT NULL,
 IS_DURABLE VARCHAR(1) NOT NULL,
-IS_VOLATILE VARCHAR(1) NOT NULL,
-IS_STATEFUL VARCHAR(1) NOT NULL,
+IS_NONCONCURRENT VARCHAR(1) NOT NULL,
+IS_UPDATE_DATA VARCHAR(1) NOT NULL,
 REQUESTS_RECOVERY VARCHAR(1) NOT NULL,
 JOB_DATA BLOB NULL,
-PRIMARY KEY (JOB_NAME,JOB_GROUP))
-ENGINE=InnoDB;
-
-CREATE TABLE QRTZ_JOB_LISTENERS (
-JOB_NAME VARCHAR(200) NOT NULL,
-JOB_GROUP VARCHAR(200) NOT NULL,
-JOB_LISTENER VARCHAR(200) NOT NULL,
-PRIMARY KEY (JOB_NAME,JOB_GROUP,JOB_LISTENER),
-INDEX (JOB_NAME, JOB_GROUP),
-FOREIGN KEY (JOB_NAME,JOB_GROUP)
-REFERENCES QRTZ_JOB_DETAILS(JOB_NAME,JOB_GROUP))
-ENGINE=InnoDB;
+PRIMARY KEY (SCHED_NAME,JOB_NAME,JOB_GROUP))
+TYPE=InnoDB;
 
 CREATE TABLE QRTZ_TRIGGERS (
+SCHED_NAME VARCHAR(120) NOT NULL,
 TRIGGER_NAME VARCHAR(200) NOT NULL,
 TRIGGER_GROUP VARCHAR(200) NOT NULL,
 JOB_NAME VARCHAR(200) NOT NULL,
 JOB_GROUP VARCHAR(200) NOT NULL,
-IS_VOLATILE VARCHAR(1) NOT NULL,
 DESCRIPTION VARCHAR(250) NULL,
 NEXT_FIRE_TIME BIGINT(13) NULL,
 PREV_FIRE_TIME BIGINT(13) NULL,
@@ -55,97 +66,133 @@ END_TIME BIGINT(13) NULL,
 CALENDAR_NAME VARCHAR(200) NULL,
 MISFIRE_INSTR SMALLINT(2) NULL,
 JOB_DATA BLOB NULL,
-PRIMARY KEY (TRIGGER_NAME,TRIGGER_GROUP),
-INDEX (JOB_NAME, JOB_GROUP),
-FOREIGN KEY (JOB_NAME,JOB_GROUP)
-REFERENCES QRTZ_JOB_DETAILS(JOB_NAME,JOB_GROUP))
-ENGINE=InnoDB;
+PRIMARY KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP),
+INDEX (SCHED_NAME,JOB_NAME, JOB_GROUP),
+FOREIGN KEY (SCHED_NAME,JOB_NAME,JOB_GROUP)
+REFERENCES QRTZ_JOB_DETAILS(SCHED_NAME,JOB_NAME,JOB_GROUP))
+TYPE=InnoDB;
 
 CREATE TABLE QRTZ_SIMPLE_TRIGGERS (
+SCHED_NAME VARCHAR(120) NOT NULL,
 TRIGGER_NAME VARCHAR(200) NOT NULL,
 TRIGGER_GROUP VARCHAR(200) NOT NULL,
 REPEAT_COUNT BIGINT(7) NOT NULL,
 REPEAT_INTERVAL BIGINT(12) NOT NULL,
 TIMES_TRIGGERED BIGINT(10) NOT NULL,
-PRIMARY KEY (TRIGGER_NAME,TRIGGER_GROUP),
-INDEX (TRIGGER_NAME, TRIGGER_GROUP),
-FOREIGN KEY (TRIGGER_NAME,TRIGGER_GROUP)
-REFERENCES QRTZ_TRIGGERS(TRIGGER_NAME,TRIGGER_GROUP))
-ENGINE=InnoDB;
+PRIMARY KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP),
+INDEX (SCHED_NAME,TRIGGER_NAME, TRIGGER_GROUP),
+FOREIGN KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP)
+REFERENCES QRTZ_TRIGGERS(SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP))
+TYPE=InnoDB;
 
 CREATE TABLE QRTZ_CRON_TRIGGERS (
+SCHED_NAME VARCHAR(120) NOT NULL,
 TRIGGER_NAME VARCHAR(200) NOT NULL,
 TRIGGER_GROUP VARCHAR(200) NOT NULL,
 CRON_EXPRESSION VARCHAR(120) NOT NULL,
 TIME_ZONE_ID VARCHAR(80),
-PRIMARY KEY (TRIGGER_NAME,TRIGGER_GROUP),
-INDEX (TRIGGER_NAME, TRIGGER_GROUP),
-FOREIGN KEY (TRIGGER_NAME,TRIGGER_GROUP)
-REFERENCES QRTZ_TRIGGERS(TRIGGER_NAME,TRIGGER_GROUP))
-ENGINE=InnoDB;
+PRIMARY KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP),
+INDEX (SCHED_NAME,TRIGGER_NAME, TRIGGER_GROUP),
+FOREIGN KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP)
+REFERENCES QRTZ_TRIGGERS(SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP))
+TYPE=InnoDB;
+
+CREATE TABLE QRTZ_SIMPROP_TRIGGERS
+  (          
+    SCHED_NAME VARCHAR(120) NOT NULL,
+    TRIGGER_NAME VARCHAR(200) NOT NULL,
+    TRIGGER_GROUP VARCHAR(200) NOT NULL,
+    STR_PROP_1 VARCHAR(512) NULL,
+    STR_PROP_2 VARCHAR(512) NULL,
+    STR_PROP_3 VARCHAR(512) NULL,
+    INT_PROP_1 INT NULL,
+    INT_PROP_2 INT NULL,
+    LONG_PROP_1 BIGINT NULL,
+    LONG_PROP_2 BIGINT NULL,
+    DEC_PROP_1 NUMERIC(13,4) NULL,
+    DEC_PROP_2 NUMERIC(13,4) NULL,
+    BOOL_PROP_1 VARCHAR(1) NULL,
+    BOOL_PROP_2 VARCHAR(1) NULL,
+    PRIMARY KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP),
+    FOREIGN KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP) 
+    REFERENCES QRTZ_TRIGGERS(SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP))
+TYPE=InnoDB;
 
 CREATE TABLE QRTZ_BLOB_TRIGGERS (
+SCHED_NAME VARCHAR(120) NOT NULL,
 TRIGGER_NAME VARCHAR(200) NOT NULL,
 TRIGGER_GROUP VARCHAR(200) NOT NULL,
 BLOB_DATA BLOB NULL,
-PRIMARY KEY (TRIGGER_NAME,TRIGGER_GROUP),
-INDEX (TRIGGER_NAME, TRIGGER_GROUP),
-FOREIGN KEY (TRIGGER_NAME,TRIGGER_GROUP)
-REFERENCES QRTZ_TRIGGERS(TRIGGER_NAME,TRIGGER_GROUP))
-ENGINE=InnoDB;
-
-CREATE TABLE QRTZ_TRIGGER_LISTENERS (
-TRIGGER_NAME VARCHAR(200) NOT NULL,
-TRIGGER_GROUP VARCHAR(200) NOT NULL,
-TRIGGER_LISTENER VARCHAR(200) NOT NULL,
-PRIMARY KEY (TRIGGER_NAME,TRIGGER_GROUP,TRIGGER_LISTENER),
-INDEX (TRIGGER_NAME, TRIGGER_GROUP),
-FOREIGN KEY (TRIGGER_NAME,TRIGGER_GROUP)
-REFERENCES QRTZ_TRIGGERS(TRIGGER_NAME,TRIGGER_GROUP))
-ENGINE=InnoDB;
+PRIMARY KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP),
+INDEX (SCHED_NAME,TRIGGER_NAME, TRIGGER_GROUP),
+FOREIGN KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP)
+REFERENCES QRTZ_TRIGGERS(SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP))
+TYPE=InnoDB;
 
 CREATE TABLE QRTZ_CALENDARS (
+SCHED_NAME VARCHAR(120) NOT NULL,
 CALENDAR_NAME VARCHAR(200) NOT NULL,
 CALENDAR BLOB NOT NULL,
-PRIMARY KEY (CALENDAR_NAME))
-ENGINE=InnoDB;
+PRIMARY KEY (SCHED_NAME,CALENDAR_NAME))
+TYPE=InnoDB;
 
 CREATE TABLE QRTZ_PAUSED_TRIGGER_GRPS (
+SCHED_NAME VARCHAR(120) NOT NULL,
 TRIGGER_GROUP VARCHAR(200) NOT NULL,
-PRIMARY KEY (TRIGGER_GROUP))
-ENGINE=InnoDB;
+PRIMARY KEY (SCHED_NAME,TRIGGER_GROUP))
+TYPE=InnoDB;
 
 CREATE TABLE QRTZ_FIRED_TRIGGERS (
+SCHED_NAME VARCHAR(120) NOT NULL,
 ENTRY_ID VARCHAR(95) NOT NULL,
 TRIGGER_NAME VARCHAR(200) NOT NULL,
 TRIGGER_GROUP VARCHAR(200) NOT NULL,
-IS_VOLATILE VARCHAR(1) NOT NULL,
 INSTANCE_NAME VARCHAR(200) NOT NULL,
 FIRED_TIME BIGINT(13) NOT NULL,
 PRIORITY INTEGER NOT NULL,
 STATE VARCHAR(16) NOT NULL,
 JOB_NAME VARCHAR(200) NULL,
 JOB_GROUP VARCHAR(200) NULL,
-IS_STATEFUL VARCHAR(1) NULL,
+IS_NONCONCURRENT VARCHAR(1) NULL,
 REQUESTS_RECOVERY VARCHAR(1) NULL,
-PRIMARY KEY (ENTRY_ID))
-ENGINE=InnoDB;
+PRIMARY KEY (SCHED_NAME,ENTRY_ID))
+TYPE=InnoDB;
 
 CREATE TABLE QRTZ_SCHEDULER_STATE (
+SCHED_NAME VARCHAR(120) NOT NULL,
 INSTANCE_NAME VARCHAR(200) NOT NULL,
 LAST_CHECKIN_TIME BIGINT(13) NOT NULL,
 CHECKIN_INTERVAL BIGINT(13) NOT NULL,
-PRIMARY KEY (INSTANCE_NAME))
-ENGINE=InnoDB;
+PRIMARY KEY (SCHED_NAME,INSTANCE_NAME))
+TYPE=InnoDB;
 
 CREATE TABLE QRTZ_LOCKS (
+SCHED_NAME VARCHAR(120) NOT NULL,
 LOCK_NAME VARCHAR(40) NOT NULL,
-PRIMARY KEY (LOCK_NAME))
-ENGINE=InnoDB;
+PRIMARY KEY (SCHED_NAME,LOCK_NAME))
+TYPE=InnoDB;
+
+CREATE INDEX IDX_QRTZ_J_REQ_RECOVERY ON QRTZ_JOB_DETAILS(SCHED_NAME,REQUESTS_RECOVERY);
+CREATE INDEX IDX_QRTZ_J_GRP ON QRTZ_JOB_DETAILS(SCHED_NAME,JOB_GROUP);
+
+CREATE INDEX IDX_QRTZ_T_J ON QRTZ_TRIGGERS(SCHED_NAME,JOB_NAME,JOB_GROUP);
+CREATE INDEX IDX_QRTZ_T_JG ON QRTZ_TRIGGERS(SCHED_NAME,JOB_GROUP);
+CREATE INDEX IDX_QRTZ_T_C ON QRTZ_TRIGGERS(SCHED_NAME,CALENDAR_NAME);
+CREATE INDEX IDX_QRTZ_T_G ON QRTZ_TRIGGERS(SCHED_NAME,TRIGGER_GROUP);
+CREATE INDEX IDX_QRTZ_T_STATE ON QRTZ_TRIGGERS(SCHED_NAME,TRIGGER_STATE);
+CREATE INDEX IDX_QRTZ_T_N_STATE ON QRTZ_TRIGGERS(SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP,TRIGGER_STATE);
+CREATE INDEX IDX_QRTZ_T_N_G_STATE ON QRTZ_TRIGGERS(SCHED_NAME,TRIGGER_GROUP,TRIGGER_STATE);
+CREATE INDEX IDX_QRTZ_T_NEXT_FIRE_TIME ON QRTZ_TRIGGERS(SCHED_NAME,NEXT_FIRE_TIME);
+CREATE INDEX IDX_QRTZ_T_NFT_ST ON QRTZ_TRIGGERS(SCHED_NAME,TRIGGER_STATE,NEXT_FIRE_TIME);
+CREATE INDEX IDX_QRTZ_T_NFT_MISFIRE ON QRTZ_TRIGGERS(SCHED_NAME,MISFIRE_INSTR,NEXT_FIRE_TIME);
+CREATE INDEX IDX_QRTZ_T_NFT_ST_MISFIRE ON QRTZ_TRIGGERS(SCHED_NAME,MISFIRE_INSTR,NEXT_FIRE_TIME,TRIGGER_STATE);
+CREATE INDEX IDX_QRTZ_T_NFT_ST_MISFIRE_GRP ON QRTZ_TRIGGERS(SCHED_NAME,MISFIRE_INSTR,NEXT_FIRE_TIME,TRIGGER_GROUP,TRIGGER_STATE);
+
+CREATE INDEX IDX_QRTZ_FT_TRIG_INST_NAME ON QRTZ_FIRED_TRIGGERS(SCHED_NAME,INSTANCE_NAME);
+CREATE INDEX IDX_QRTZ_FT_INST_JOB_REQ_RCVRY ON QRTZ_FIRED_TRIGGERS(SCHED_NAME,INSTANCE_NAME,REQUESTS_RECOVERY);
+CREATE INDEX IDX_QRTZ_FT_J_G ON QRTZ_FIRED_TRIGGERS(SCHED_NAME,JOB_NAME,JOB_GROUP);
+CREATE INDEX IDX_QRTZ_FT_JG ON QRTZ_FIRED_TRIGGERS(SCHED_NAME,JOB_GROUP);
+CREATE INDEX IDX_QRTZ_FT_T_G ON QRTZ_FIRED_TRIGGERS(SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP);
+CREATE INDEX IDX_QRTZ_FT_TG ON QRTZ_FIRED_TRIGGERS(SCHED_NAME,TRIGGER_GROUP);
 
-INSERT INTO QRTZ_LOCKS values('TRIGGER_ACCESS');
-INSERT INTO QRTZ_LOCKS values('JOB_ACCESS');
-INSERT INTO QRTZ_LOCKS values('CALENDAR_ACCESS');
-INSERT INTO QRTZ_LOCKS values('STATE_ACCESS');
-INSERT INTO QRTZ_LOCKS values('MISFIRE_ACCESS');
 commit; 

Modified: incubator/syncope/trunk/core/src/main/resources/quartz/tables_oracle.sql
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/core/src/main/resources/quartz/tables_oracle.sql?rev=1399709&r1=1399708&r2=1399709&view=diff
==============================================================================
--- incubator/syncope/trunk/core/src/main/resources/quartz/tables_oracle.sql (original)
+++ incubator/syncope/trunk/core/src/main/resources/quartz/tables_oracle.sql Thu Oct 18 15:57:27 2012
@@ -15,35 +15,62 @@
 -- specific language governing permissions and limitations
 -- under the License.
 
+--
+-- A hint submitted by a user: Oracle DB MUST be created as "shared" and the 
+-- job_queue_processes parameter  must be greater than 2
+-- However, these settings are pretty much standard after any
+-- Oracle install, so most users need not worry about this.
+--
+-- Many other users (including the primary author of Quartz) have had success
+-- runing in dedicated mode, so only consider the above as a hint ;-)
+--
+
+delete from qrtz_fired_triggers;
+delete from qrtz_simple_triggers;
+delete from qrtz_simprop_triggers;
+delete from qrtz_cron_triggers;
+delete from qrtz_blob_triggers;
+delete from qrtz_triggers;
+delete from qrtz_job_details;
+delete from qrtz_calendars;
+delete from qrtz_paused_trigger_grps;
+delete from qrtz_locks;
+delete from qrtz_scheduler_state;
+
+drop table qrtz_calendars;
+drop table qrtz_fired_triggers;
+drop table qrtz_blob_triggers;
+drop table qrtz_cron_triggers;
+drop table qrtz_simple_triggers;
+drop table qrtz_simprop_triggers;
+drop table qrtz_triggers;
+drop table qrtz_job_details;
+drop table qrtz_paused_trigger_grps;
+drop table qrtz_locks;
+drop table qrtz_scheduler_state;
+
+
 CREATE TABLE qrtz_job_details
   (
+    SCHED_NAME VARCHAR2(120) NOT NULL,
     JOB_NAME  VARCHAR2(200) NOT NULL,
     JOB_GROUP VARCHAR2(200) NOT NULL,
     DESCRIPTION VARCHAR2(250) NULL,
     JOB_CLASS_NAME   VARCHAR2(250) NOT NULL, 
     IS_DURABLE VARCHAR2(1) NOT NULL,
-    IS_VOLATILE VARCHAR2(1) NOT NULL,
-    IS_STATEFUL VARCHAR2(1) NOT NULL,
+    IS_NONCONCURRENT VARCHAR2(1) NOT NULL,
+    IS_UPDATE_DATA VARCHAR2(1) NOT NULL,
     REQUESTS_RECOVERY VARCHAR2(1) NOT NULL,
     JOB_DATA BLOB NULL,
-    PRIMARY KEY (JOB_NAME,JOB_GROUP)
-);
-CREATE TABLE qrtz_job_listeners
-  (
-    JOB_NAME  VARCHAR2(200) NOT NULL, 
-    JOB_GROUP VARCHAR2(200) NOT NULL,
-    JOB_LISTENER VARCHAR2(200) NOT NULL,
-    PRIMARY KEY (JOB_NAME,JOB_GROUP,JOB_LISTENER),
-    FOREIGN KEY (JOB_NAME,JOB_GROUP) 
-	REFERENCES QRTZ_JOB_DETAILS(JOB_NAME,JOB_GROUP)
+    CONSTRAINT QRTZ_JOB_DETAILS_PK PRIMARY KEY (SCHED_NAME,JOB_NAME,JOB_GROUP)
 );
 CREATE TABLE qrtz_triggers
   (
+    SCHED_NAME VARCHAR2(120) NOT NULL,
     TRIGGER_NAME VARCHAR2(200) NOT NULL,
     TRIGGER_GROUP VARCHAR2(200) NOT NULL,
     JOB_NAME  VARCHAR2(200) NOT NULL, 
     JOB_GROUP VARCHAR2(200) NOT NULL,
-    IS_VOLATILE VARCHAR2(1) NOT NULL,
     DESCRIPTION VARCHAR2(250) NULL,
     NEXT_FIRE_TIME NUMBER(13) NULL,
     PREV_FIRE_TIME NUMBER(13) NULL,
@@ -55,108 +82,128 @@ CREATE TABLE qrtz_triggers
     CALENDAR_NAME VARCHAR2(200) NULL,
     MISFIRE_INSTR NUMBER(2) NULL,
     JOB_DATA BLOB NULL,
-    PRIMARY KEY (TRIGGER_NAME,TRIGGER_GROUP),
-    FOREIGN KEY (JOB_NAME,JOB_GROUP) 
-	REFERENCES QRTZ_JOB_DETAILS(JOB_NAME,JOB_GROUP) 
+    CONSTRAINT QRTZ_TRIGGERS_PK PRIMARY KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP),
+    CONSTRAINT QRTZ_TRIGGER_TO_JOBS_FK FOREIGN KEY (SCHED_NAME,JOB_NAME,JOB_GROUP) 
+      REFERENCES QRTZ_JOB_DETAILS(SCHED_NAME,JOB_NAME,JOB_GROUP) 
 );
 CREATE TABLE qrtz_simple_triggers
   (
+    SCHED_NAME VARCHAR2(120) NOT NULL,
     TRIGGER_NAME VARCHAR2(200) NOT NULL,
     TRIGGER_GROUP VARCHAR2(200) NOT NULL,
     REPEAT_COUNT NUMBER(7) NOT NULL,
     REPEAT_INTERVAL NUMBER(12) NOT NULL,
     TIMES_TRIGGERED NUMBER(10) NOT NULL,
-    PRIMARY KEY (TRIGGER_NAME,TRIGGER_GROUP),
-    FOREIGN KEY (TRIGGER_NAME,TRIGGER_GROUP) 
-	REFERENCES QRTZ_TRIGGERS(TRIGGER_NAME,TRIGGER_GROUP)
+    CONSTRAINT QRTZ_SIMPLE_TRIG_PK PRIMARY KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP),
+    CONSTRAINT QRTZ_SIMPLE_TRIG_TO_TRIG_FK FOREIGN KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP) 
+	REFERENCES QRTZ_TRIGGERS(SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP)
 );
 CREATE TABLE qrtz_cron_triggers
   (
+    SCHED_NAME VARCHAR2(120) NOT NULL,
     TRIGGER_NAME VARCHAR2(200) NOT NULL,
     TRIGGER_GROUP VARCHAR2(200) NOT NULL,
     CRON_EXPRESSION VARCHAR2(120) NOT NULL,
     TIME_ZONE_ID VARCHAR2(80),
-    PRIMARY KEY (TRIGGER_NAME,TRIGGER_GROUP),
-    FOREIGN KEY (TRIGGER_NAME,TRIGGER_GROUP) 
-	REFERENCES QRTZ_TRIGGERS(TRIGGER_NAME,TRIGGER_GROUP)
+    CONSTRAINT QRTZ_CRON_TRIG_PK PRIMARY KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP),
+    CONSTRAINT QRTZ_CRON_TRIG_TO_TRIG_FK FOREIGN KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP) 
+      REFERENCES QRTZ_TRIGGERS(SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP)
+);
+CREATE TABLE qrtz_simprop_triggers
+  (          
+    SCHED_NAME VARCHAR2(120) NOT NULL,
+    TRIGGER_NAME VARCHAR2(200) NOT NULL,
+    TRIGGER_GROUP VARCHAR2(200) NOT NULL,
+    STR_PROP_1 VARCHAR2(512) NULL,
+    STR_PROP_2 VARCHAR2(512) NULL,
+    STR_PROP_3 VARCHAR2(512) NULL,
+    INT_PROP_1 NUMBER(10) NULL,
+    INT_PROP_2 NUMBER(10) NULL,
+    LONG_PROP_1 NUMBER(13) NULL,
+    LONG_PROP_2 NUMBER(13) NULL,
+    DEC_PROP_1 NUMERIC(13,4) NULL,
+    DEC_PROP_2 NUMERIC(13,4) NULL,
+    BOOL_PROP_1 VARCHAR2(1) NULL,
+    BOOL_PROP_2 VARCHAR2(1) NULL,
+    CONSTRAINT QRTZ_SIMPROP_TRIG_PK PRIMARY KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP),
+    CONSTRAINT QRTZ_SIMPROP_TRIG_TO_TRIG_FK FOREIGN KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP) 
+      REFERENCES QRTZ_TRIGGERS(SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP)
 );
 CREATE TABLE qrtz_blob_triggers
   (
+    SCHED_NAME VARCHAR2(120) NOT NULL,
     TRIGGER_NAME VARCHAR2(200) NOT NULL,
     TRIGGER_GROUP VARCHAR2(200) NOT NULL,
     BLOB_DATA BLOB NULL,
-    PRIMARY KEY (TRIGGER_NAME,TRIGGER_GROUP),
-    FOREIGN KEY (TRIGGER_NAME,TRIGGER_GROUP) 
-        REFERENCES QRTZ_TRIGGERS(TRIGGER_NAME,TRIGGER_GROUP)
-);
-CREATE TABLE qrtz_trigger_listeners
-  (
-    TRIGGER_NAME  VARCHAR2(200) NOT NULL, 
-    TRIGGER_GROUP VARCHAR2(200) NOT NULL,
-    TRIGGER_LISTENER VARCHAR2(200) NOT NULL,
-    PRIMARY KEY (TRIGGER_NAME,TRIGGER_GROUP,TRIGGER_LISTENER),
-    FOREIGN KEY (TRIGGER_NAME,TRIGGER_GROUP) 
-	REFERENCES QRTZ_TRIGGERS(TRIGGER_NAME,TRIGGER_GROUP)
+    CONSTRAINT QRTZ_BLOB_TRIG_PK PRIMARY KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP),
+    CONSTRAINT QRTZ_ BLOB_TRIG_TO_TRIG_FK FOREIGN KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP) 
+        REFERENCES QRTZ_TRIGGERS(SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP)
 );
 CREATE TABLE qrtz_calendars
   (
+    SCHED_NAME VARCHAR2(120) NOT NULL,
     CALENDAR_NAME  VARCHAR2(200) NOT NULL, 
     CALENDAR BLOB NOT NULL,
-    PRIMARY KEY (CALENDAR_NAME)
+    CONSTRAINT QRTZ_CALENDARS_PK PRIMARY KEY (SCHED_NAME,CALENDAR_NAME)
 );
 CREATE TABLE qrtz_paused_trigger_grps
   (
+    SCHED_NAME VARCHAR2(120) NOT NULL,
     TRIGGER_GROUP  VARCHAR2(200) NOT NULL, 
-    PRIMARY KEY (TRIGGER_GROUP)
+    CONSTRAINT QRTZ_PAUSED_TRIG_GRPS_PK PRIMARY KEY (SCHED_NAME,TRIGGER_GROUP)
 );
 CREATE TABLE qrtz_fired_triggers 
   (
+    SCHED_NAME VARCHAR2(120) NOT NULL,
     ENTRY_ID VARCHAR2(95) NOT NULL,
     TRIGGER_NAME VARCHAR2(200) NOT NULL,
     TRIGGER_GROUP VARCHAR2(200) NOT NULL,
-    IS_VOLATILE VARCHAR2(1) NOT NULL,
     INSTANCE_NAME VARCHAR2(200) NOT NULL,
     FIRED_TIME NUMBER(13) NOT NULL,
     PRIORITY NUMBER(13) NOT NULL,
     STATE VARCHAR2(16) NOT NULL,
     JOB_NAME VARCHAR2(200) NULL,
     JOB_GROUP VARCHAR2(200) NULL,
-    IS_STATEFUL VARCHAR2(1) NULL,
+    IS_NONCONCURRENT VARCHAR2(1) NULL,
     REQUESTS_RECOVERY VARCHAR2(1) NULL,
-    PRIMARY KEY (ENTRY_ID)
+    CONSTRAINT QRTZ_FIRED_TRIGGER_PK PRIMARY KEY (SCHED_NAME,ENTRY_ID)
 );
 CREATE TABLE qrtz_scheduler_state 
   (
+    SCHED_NAME VARCHAR2(120) NOT NULL,
     INSTANCE_NAME VARCHAR2(200) NOT NULL,
     LAST_CHECKIN_TIME NUMBER(13) NOT NULL,
     CHECKIN_INTERVAL NUMBER(13) NOT NULL,
-    PRIMARY KEY (INSTANCE_NAME)
+    CONSTRAINT QRTZ_SCHEDULER_STATE_PK PRIMARY KEY (SCHED_NAME,INSTANCE_NAME)
 );
 CREATE TABLE qrtz_locks
   (
+    SCHED_NAME VARCHAR2(120) NOT NULL,
     LOCK_NAME  VARCHAR2(40) NOT NULL, 
-    PRIMARY KEY (LOCK_NAME)
+    CONSTRAINT QRTZ_LOCKS_PK PRIMARY KEY (SCHED_NAME,LOCK_NAME)
 );
-INSERT INTO qrtz_locks values('TRIGGER_ACCESS');
-INSERT INTO qrtz_locks values('JOB_ACCESS');
-INSERT INTO qrtz_locks values('CALENDAR_ACCESS');
-INSERT INTO qrtz_locks values('STATE_ACCESS');
-INSERT INTO qrtz_locks values('MISFIRE_ACCESS');
-create index idx_qrtz_j_req_recovery on qrtz_job_details(REQUESTS_RECOVERY);
-create index idx_qrtz_t_next_fire_time on qrtz_triggers(NEXT_FIRE_TIME);
-create index idx_qrtz_t_state on qrtz_triggers(TRIGGER_STATE);
-create index idx_qrtz_t_nft_st on qrtz_triggers(NEXT_FIRE_TIME,TRIGGER_STATE);
-create index idx_qrtz_t_volatile on qrtz_triggers(IS_VOLATILE);
-create index idx_qrtz_ft_trig_name on qrtz_fired_triggers(TRIGGER_NAME);
-create index idx_qrtz_ft_trig_group on qrtz_fired_triggers(TRIGGER_GROUP);
-create index idx_qrtz_ft_trig_nm_gp on qrtz_fired_triggers(TRIGGER_NAME,TRIGGER_GROUP);
-create index idx_qrtz_ft_trig_volatile on qrtz_fired_triggers(IS_VOLATILE);
-create index idx_qrtz_ft_trig_inst_name on qrtz_fired_triggers(INSTANCE_NAME);
-create index idx_qrtz_ft_job_name on qrtz_fired_triggers(JOB_NAME);
-create index idx_qrtz_ft_job_group on qrtz_fired_triggers(JOB_GROUP);
-create index idx_qrtz_ft_job_stateful on qrtz_fired_triggers(IS_STATEFUL);
-create index idx_qrtz_ft_job_req_recovery on qrtz_fired_triggers(REQUESTS_RECOVERY);
 
+create index idx_qrtz_j_req_recovery on qrtz_job_details(SCHED_NAME,REQUESTS_RECOVERY);
+create index idx_qrtz_j_grp on qrtz_job_details(SCHED_NAME,JOB_GROUP);
+
+create index idx_qrtz_t_j on qrtz_triggers(SCHED_NAME,JOB_NAME,JOB_GROUP);
+create index idx_qrtz_t_jg on qrtz_triggers(SCHED_NAME,JOB_GROUP);
+create index idx_qrtz_t_c on qrtz_triggers(SCHED_NAME,CALENDAR_NAME);
+create index idx_qrtz_t_g on qrtz_triggers(SCHED_NAME,TRIGGER_GROUP);
+create index idx_qrtz_t_state on qrtz_triggers(SCHED_NAME,TRIGGER_STATE);
+create index idx_qrtz_t_n_state on qrtz_triggers(SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP,TRIGGER_STATE);
+create index idx_qrtz_t_n_g_state on qrtz_triggers(SCHED_NAME,TRIGGER_GROUP,TRIGGER_STATE);
+create index idx_qrtz_t_next_fire_time on qrtz_triggers(SCHED_NAME,NEXT_FIRE_TIME);
+create index idx_qrtz_t_nft_st on qrtz_triggers(SCHED_NAME,TRIGGER_STATE,NEXT_FIRE_TIME);
+create index idx_qrtz_t_nft_misfire on qrtz_triggers(SCHED_NAME,MISFIRE_INSTR,NEXT_FIRE_TIME);
+create index idx_qrtz_t_nft_st_misfire on qrtz_triggers(SCHED_NAME,MISFIRE_INSTR,NEXT_FIRE_TIME,TRIGGER_STATE);
+create index idx_qrtz_t_nft_st_misfire_grp on qrtz_triggers(SCHED_NAME,MISFIRE_INSTR,NEXT_FIRE_TIME,TRIGGER_GROUP,TRIGGER_STATE);
+
+create index idx_qrtz_ft_trig_inst_name on qrtz_fired_triggers(SCHED_NAME,INSTANCE_NAME);
+create index idx_qrtz_ft_inst_job_req_rcvry on qrtz_fired_triggers(SCHED_NAME,INSTANCE_NAME,REQUESTS_RECOVERY);
+create index idx_qrtz_ft_j_g on qrtz_fired_triggers(SCHED_NAME,JOB_NAME,JOB_GROUP);
+create index idx_qrtz_ft_jg on qrtz_fired_triggers(SCHED_NAME,JOB_GROUP);
+create index idx_qrtz_ft_t_g on qrtz_fired_triggers(SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP);
+create index idx_qrtz_ft_tg on qrtz_fired_triggers(SCHED_NAME,TRIGGER_GROUP);
 
 
-commit;

Modified: incubator/syncope/trunk/core/src/main/resources/quartz/tables_postgres.sql
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/core/src/main/resources/quartz/tables_postgres.sql?rev=1399709&r1=1399708&r2=1399709&view=diff
==============================================================================
--- incubator/syncope/trunk/core/src/main/resources/quartz/tables_postgres.sql (original)
+++ incubator/syncope/trunk/core/src/main/resources/quartz/tables_postgres.sql Thu Oct 18 15:57:27 2012
@@ -15,37 +15,45 @@
 -- specific language governing permissions and limitations
 -- under the License.
 
+-- Thanks to Patrick Lightbody for submitting this...
+--
+-- In your Quartz properties file, you'll need to set 
+-- org.quartz.jobStore.driverDelegateClass = org.quartz.impl.jdbcjobstore.PostgreSQLDelegate
+
+drop table qrtz_fired_triggers;
+DROP TABLE QRTZ_PAUSED_TRIGGER_GRPS;
+DROP TABLE QRTZ_SCHEDULER_STATE;
+DROP TABLE QRTZ_LOCKS;
+drop table qrtz_simple_triggers;
+drop table qrtz_cron_triggers;
+drop table qrtz_simprop_triggers;
+DROP TABLE QRTZ_BLOB_TRIGGERS;
+drop table qrtz_triggers;
+drop table qrtz_job_details;
+drop table qrtz_calendars;
+
 CREATE TABLE qrtz_job_details
   (
+    SCHED_NAME VARCHAR(120) NOT NULL,
     JOB_NAME  VARCHAR(200) NOT NULL,
     JOB_GROUP VARCHAR(200) NOT NULL,
     DESCRIPTION VARCHAR(250) NULL,
     JOB_CLASS_NAME   VARCHAR(250) NOT NULL, 
     IS_DURABLE BOOL NOT NULL,
-    IS_VOLATILE BOOL NOT NULL,
-    IS_STATEFUL BOOL NOT NULL,
+    IS_NONCONCURRENT BOOL NOT NULL,
+    IS_UPDATE_DATA BOOL NOT NULL,
     REQUESTS_RECOVERY BOOL NOT NULL,
     JOB_DATA BYTEA NULL,
-    PRIMARY KEY (JOB_NAME,JOB_GROUP)
-);
-
-CREATE TABLE qrtz_job_listeners
-  (
-    JOB_NAME  VARCHAR(200) NOT NULL, 
-    JOB_GROUP VARCHAR(200) NOT NULL,
-    JOB_LISTENER VARCHAR(200) NOT NULL,
-    PRIMARY KEY (JOB_NAME,JOB_GROUP,JOB_LISTENER),
-    FOREIGN KEY (JOB_NAME,JOB_GROUP) 
-	REFERENCES QRTZ_JOB_DETAILS(JOB_NAME,JOB_GROUP) 
+    PRIMARY KEY (SCHED_NAME,JOB_NAME,JOB_GROUP)
 );
 
 CREATE TABLE qrtz_triggers
   (
+    SCHED_NAME VARCHAR(120) NOT NULL,
     TRIGGER_NAME VARCHAR(200) NOT NULL,
     TRIGGER_GROUP VARCHAR(200) NOT NULL,
     JOB_NAME  VARCHAR(200) NOT NULL, 
     JOB_GROUP VARCHAR(200) NOT NULL,
-    IS_VOLATILE BOOL NOT NULL,
     DESCRIPTION VARCHAR(250) NULL,
     NEXT_FIRE_TIME BIGINT NULL,
     PREV_FIRE_TIME BIGINT NULL,
@@ -57,120 +65,139 @@ CREATE TABLE qrtz_triggers
     CALENDAR_NAME VARCHAR(200) NULL,
     MISFIRE_INSTR SMALLINT NULL,
     JOB_DATA BYTEA NULL,
-    PRIMARY KEY (TRIGGER_NAME,TRIGGER_GROUP),
-    FOREIGN KEY (JOB_NAME,JOB_GROUP) 
-	REFERENCES QRTZ_JOB_DETAILS(JOB_NAME,JOB_GROUP) 
+    PRIMARY KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP),
+    FOREIGN KEY (SCHED_NAME,JOB_NAME,JOB_GROUP) 
+	REFERENCES QRTZ_JOB_DETAILS(SCHED_NAME,JOB_NAME,JOB_GROUP) 
 );
 
 CREATE TABLE qrtz_simple_triggers
   (
+    SCHED_NAME VARCHAR(120) NOT NULL,
     TRIGGER_NAME VARCHAR(200) NOT NULL,
     TRIGGER_GROUP VARCHAR(200) NOT NULL,
     REPEAT_COUNT BIGINT NOT NULL,
     REPEAT_INTERVAL BIGINT NOT NULL,
     TIMES_TRIGGERED BIGINT NOT NULL,
-    PRIMARY KEY (TRIGGER_NAME,TRIGGER_GROUP),
-    FOREIGN KEY (TRIGGER_NAME,TRIGGER_GROUP) 
-	REFERENCES QRTZ_TRIGGERS(TRIGGER_NAME,TRIGGER_GROUP)
+    PRIMARY KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP),
+    FOREIGN KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP) 
+	REFERENCES QRTZ_TRIGGERS(SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP)
 );
 
 CREATE TABLE qrtz_cron_triggers
   (
+    SCHED_NAME VARCHAR(120) NOT NULL,
     TRIGGER_NAME VARCHAR(200) NOT NULL,
     TRIGGER_GROUP VARCHAR(200) NOT NULL,
     CRON_EXPRESSION VARCHAR(120) NOT NULL,
     TIME_ZONE_ID VARCHAR(80),
-    PRIMARY KEY (TRIGGER_NAME,TRIGGER_GROUP),
-    FOREIGN KEY (TRIGGER_NAME,TRIGGER_GROUP) 
-	REFERENCES QRTZ_TRIGGERS(TRIGGER_NAME,TRIGGER_GROUP)
+    PRIMARY KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP),
+    FOREIGN KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP) 
+	REFERENCES QRTZ_TRIGGERS(SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP)
 );
 
-CREATE TABLE qrtz_blob_triggers
-  (
+CREATE TABLE qrtz_simprop_triggers
+  (          
+    SCHED_NAME VARCHAR(120) NOT NULL,
     TRIGGER_NAME VARCHAR(200) NOT NULL,
     TRIGGER_GROUP VARCHAR(200) NOT NULL,
-    BLOB_DATA BYTEA NULL,
-    PRIMARY KEY (TRIGGER_NAME,TRIGGER_GROUP),
-    FOREIGN KEY (TRIGGER_NAME,TRIGGER_GROUP) 
-        REFERENCES QRTZ_TRIGGERS(TRIGGER_NAME,TRIGGER_GROUP)
+    STR_PROP_1 VARCHAR(512) NULL,
+    STR_PROP_2 VARCHAR(512) NULL,
+    STR_PROP_3 VARCHAR(512) NULL,
+    INT_PROP_1 INT NULL,
+    INT_PROP_2 INT NULL,
+    LONG_PROP_1 BIGINT NULL,
+    LONG_PROP_2 BIGINT NULL,
+    DEC_PROP_1 NUMERIC(13,4) NULL,
+    DEC_PROP_2 NUMERIC(13,4) NULL,
+    BOOL_PROP_1 BOOL NULL,
+    BOOL_PROP_2 BOOL NULL,
+    PRIMARY KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP),
+    FOREIGN KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP) 
+    REFERENCES QRTZ_TRIGGERS(SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP)
 );
 
-CREATE TABLE qrtz_trigger_listeners
+CREATE TABLE qrtz_blob_triggers
   (
-    TRIGGER_NAME  VARCHAR(200) NOT NULL, 
+    SCHED_NAME VARCHAR(120) NOT NULL,
+    TRIGGER_NAME VARCHAR(200) NOT NULL,
     TRIGGER_GROUP VARCHAR(200) NOT NULL,
-    TRIGGER_LISTENER VARCHAR(200) NOT NULL,
-    PRIMARY KEY (TRIGGER_NAME,TRIGGER_GROUP,TRIGGER_LISTENER),
-    FOREIGN KEY (TRIGGER_NAME,TRIGGER_GROUP) 
-	REFERENCES QRTZ_TRIGGERS(TRIGGER_NAME,TRIGGER_GROUP)
+    BLOB_DATA BYTEA NULL,
+    PRIMARY KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP),
+    FOREIGN KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP) 
+        REFERENCES QRTZ_TRIGGERS(SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP)
 );
 
-
 CREATE TABLE qrtz_calendars
   (
+    SCHED_NAME VARCHAR(120) NOT NULL,
     CALENDAR_NAME  VARCHAR(200) NOT NULL, 
     CALENDAR BYTEA NOT NULL,
-    PRIMARY KEY (CALENDAR_NAME)
+    PRIMARY KEY (SCHED_NAME,CALENDAR_NAME)
 );
 
 
 CREATE TABLE qrtz_paused_trigger_grps
   (
+    SCHED_NAME VARCHAR(120) NOT NULL,
     TRIGGER_GROUP  VARCHAR(200) NOT NULL, 
-    PRIMARY KEY (TRIGGER_GROUP)
+    PRIMARY KEY (SCHED_NAME,TRIGGER_GROUP)
 );
 
 CREATE TABLE qrtz_fired_triggers 
   (
+    SCHED_NAME VARCHAR(120) NOT NULL,
     ENTRY_ID VARCHAR(95) NOT NULL,
     TRIGGER_NAME VARCHAR(200) NOT NULL,
     TRIGGER_GROUP VARCHAR(200) NOT NULL,
-    IS_VOLATILE BOOL NOT NULL,
     INSTANCE_NAME VARCHAR(200) NOT NULL,
     FIRED_TIME BIGINT NOT NULL,
     PRIORITY INTEGER NOT NULL,
     STATE VARCHAR(16) NOT NULL,
     JOB_NAME VARCHAR(200) NULL,
     JOB_GROUP VARCHAR(200) NULL,
-    IS_STATEFUL BOOL NULL,
+    IS_NONCONCURRENT BOOL NULL,
     REQUESTS_RECOVERY BOOL NULL,
-    PRIMARY KEY (ENTRY_ID)
+    PRIMARY KEY (SCHED_NAME,ENTRY_ID)
 );
 
 CREATE TABLE qrtz_scheduler_state 
   (
+    SCHED_NAME VARCHAR(120) NOT NULL,
     INSTANCE_NAME VARCHAR(200) NOT NULL,
     LAST_CHECKIN_TIME BIGINT NOT NULL,
     CHECKIN_INTERVAL BIGINT NOT NULL,
-    PRIMARY KEY (INSTANCE_NAME)
+    PRIMARY KEY (SCHED_NAME,INSTANCE_NAME)
 );
 
 CREATE TABLE qrtz_locks
   (
+    SCHED_NAME VARCHAR(120) NOT NULL,
     LOCK_NAME  VARCHAR(40) NOT NULL, 
-    PRIMARY KEY (LOCK_NAME)
+    PRIMARY KEY (SCHED_NAME,LOCK_NAME)
 );
 
+create index idx_qrtz_j_req_recovery on qrtz_job_details(SCHED_NAME,REQUESTS_RECOVERY);
+create index idx_qrtz_j_grp on qrtz_job_details(SCHED_NAME,JOB_GROUP);
+
+create index idx_qrtz_t_j on qrtz_triggers(SCHED_NAME,JOB_NAME,JOB_GROUP);
+create index idx_qrtz_t_jg on qrtz_triggers(SCHED_NAME,JOB_GROUP);
+create index idx_qrtz_t_c on qrtz_triggers(SCHED_NAME,CALENDAR_NAME);
+create index idx_qrtz_t_g on qrtz_triggers(SCHED_NAME,TRIGGER_GROUP);
+create index idx_qrtz_t_state on qrtz_triggers(SCHED_NAME,TRIGGER_STATE);
+create index idx_qrtz_t_n_state on qrtz_triggers(SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP,TRIGGER_STATE);
+create index idx_qrtz_t_n_g_state on qrtz_triggers(SCHED_NAME,TRIGGER_GROUP,TRIGGER_STATE);
+create index idx_qrtz_t_next_fire_time on qrtz_triggers(SCHED_NAME,NEXT_FIRE_TIME);
+create index idx_qrtz_t_nft_st on qrtz_triggers(SCHED_NAME,TRIGGER_STATE,NEXT_FIRE_TIME);
+create index idx_qrtz_t_nft_misfire on qrtz_triggers(SCHED_NAME,MISFIRE_INSTR,NEXT_FIRE_TIME);
+create index idx_qrtz_t_nft_st_misfire on qrtz_triggers(SCHED_NAME,MISFIRE_INSTR,NEXT_FIRE_TIME,TRIGGER_STATE);
+create index idx_qrtz_t_nft_st_misfire_grp on qrtz_triggers(SCHED_NAME,MISFIRE_INSTR,NEXT_FIRE_TIME,TRIGGER_GROUP,TRIGGER_STATE);
+
+create index idx_qrtz_ft_trig_inst_name on qrtz_fired_triggers(SCHED_NAME,INSTANCE_NAME);
+create index idx_qrtz_ft_inst_job_req_rcvry on qrtz_fired_triggers(SCHED_NAME,INSTANCE_NAME,REQUESTS_RECOVERY);
+create index idx_qrtz_ft_j_g on qrtz_fired_triggers(SCHED_NAME,JOB_NAME,JOB_GROUP);
+create index idx_qrtz_ft_jg on qrtz_fired_triggers(SCHED_NAME,JOB_GROUP);
+create index idx_qrtz_ft_t_g on qrtz_fired_triggers(SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP);
+create index idx_qrtz_ft_tg on qrtz_fired_triggers(SCHED_NAME,TRIGGER_GROUP);
 
-INSERT INTO qrtz_locks values('TRIGGER_ACCESS');
-INSERT INTO qrtz_locks values('JOB_ACCESS');
-INSERT INTO qrtz_locks values('CALENDAR_ACCESS');
-INSERT INTO qrtz_locks values('STATE_ACCESS');
-INSERT INTO qrtz_locks values('MISFIRE_ACCESS');
-
-create index idx_qrtz_j_req_recovery on qrtz_job_details(REQUESTS_RECOVERY);
-create index idx_qrtz_t_next_fire_time on qrtz_triggers(NEXT_FIRE_TIME);
-create index idx_qrtz_t_state on qrtz_triggers(TRIGGER_STATE);
-create index idx_qrtz_t_nft_st on qrtz_triggers(NEXT_FIRE_TIME,TRIGGER_STATE);
-create index idx_qrtz_t_volatile on qrtz_triggers(IS_VOLATILE);
-create index idx_qrtz_ft_trig_name on qrtz_fired_triggers(TRIGGER_NAME);
-create index idx_qrtz_ft_trig_group on qrtz_fired_triggers(TRIGGER_GROUP);
-create index idx_qrtz_ft_trig_nm_gp on qrtz_fired_triggers(TRIGGER_NAME,TRIGGER_GROUP);
-create index idx_qrtz_ft_trig_volatile on qrtz_fired_triggers(IS_VOLATILE);
-create index idx_qrtz_ft_trig_inst_name on qrtz_fired_triggers(INSTANCE_NAME);
-create index idx_qrtz_ft_job_name on qrtz_fired_triggers(JOB_NAME);
-create index idx_qrtz_ft_job_group on qrtz_fired_triggers(JOB_GROUP);
-create index idx_qrtz_ft_job_stateful on qrtz_fired_triggers(IS_STATEFUL);
-create index idx_qrtz_ft_job_req_recovery on qrtz_fired_triggers(REQUESTS_RECOVERY);
 
 commit;

Added: incubator/syncope/trunk/core/src/main/resources/quartz/tables_sqlServer.sql
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/core/src/main/resources/quartz/tables_sqlServer.sql?rev=1399709&view=auto
==============================================================================
--- incubator/syncope/trunk/core/src/main/resources/quartz/tables_sqlServer.sql (added)
+++ incubator/syncope/trunk/core/src/main/resources/quartz/tables_sqlServer.sql Thu Oct 18 15:57:27 2012
@@ -0,0 +1,365 @@
+-- Licensed to the Apache Software Foundation (ASF) under one
+-- or more contributor license agreements.  See the NOTICE file
+-- distributed with this work for additional information
+-- regarding copyright ownership.  The ASF licenses this file
+-- to you under the Apache License, Version 2.0 (the
+-- "License"); you may not use this file except in compliance
+-- with the License.  You may obtain a copy of the License at
+--
+--   http://www.apache.org/licenses/LICENSE-2.0
+--
+-- Unless required by applicable law or agreed to in writing,
+-- software distributed under the License is distributed on an
+-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+-- KIND, either express or implied.  See the License for the
+-- specific language governing permissions and limitations
+-- under the License.
+
+--# thanks to George Papastamatopoulos for submitting this ... and Marko Lahma for
+--# updating it.
+--#
+--# In your Quartz properties file, you'll need to set 
+--# org.quartz.jobStore.driverDelegateClass = org.quartz.impl.jdbcjobstore.MSSQLDelegate
+--#
+--# you shouse enter your DB instance's name on the next line in place of "enter_db_name_here"
+--#
+--#
+--# From a helpful (but anonymous) Quartz user:
+--#
+--# Regarding this error message:  
+--#
+--#     [Microsoft][SQLServer 2000 Driver for JDBC]Can't start a cloned connection while in manual transaction mode.
+--#
+--#
+--#     I added "SelectMethod=cursor;" to my Connection URL in the config file. 
+--#     It Seems to work, hopefully no side effects.
+--#
+--#		example:
+--#		"jdbc:microsoft:sqlserver://dbmachine:1433;SelectMethod=cursor"; 
+--#
+--# Another user has pointed out that you will probably need to use the 
+--# JTDS driver
+--#
+
+USE [enter_db_name_here]
+GO
+
+IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[dbo].[FK_QRTZ_TRIGGERS_QRTZ_JOB_DETAILS]') AND OBJECTPROPERTY(id, N'ISFOREIGNKEY') = 1)
+ALTER TABLE [dbo].[QRTZ_TRIGGERS] DROP CONSTRAINT FK_QRTZ_TRIGGERS_QRTZ_JOB_DETAILS
+GO
+
+IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[dbo].[FK_QRTZ_CRON_TRIGGERS_QRTZ_TRIGGERS]') AND OBJECTPROPERTY(id, N'ISFOREIGNKEY') = 1)
+ALTER TABLE [dbo].[QRTZ_CRON_TRIGGERS] DROP CONSTRAINT FK_QRTZ_CRON_TRIGGERS_QRTZ_TRIGGERS
+GO
+
+IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[dbo].[FK_QRTZ_SIMPLE_TRIGGERS_QRTZ_TRIGGERS]') AND OBJECTPROPERTY(id, N'ISFOREIGNKEY') = 1)
+ALTER TABLE [dbo].[QRTZ_SIMPLE_TRIGGERS] DROP CONSTRAINT FK_QRTZ_SIMPLE_TRIGGERS_QRTZ_TRIGGERS
+GO
+
+IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[dbo].[FK_QRTZ_SIMPROP_TRIGGERS_QRTZ_TRIGGERS]') AND OBJECTPROPERTY(id, N'ISFOREIGNKEY') = 1)
+ALTER TABLE [dbo].[QRTZ_SIMPROP_TRIGGERS] DROP CONSTRAINT FK_QRTZ_SIMPROP_TRIGGERS_QRTZ_TRIGGERS
+GO
+
+IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[dbo].[QRTZ_CALENDARS]') AND OBJECTPROPERTY(id, N'ISUSERTABLE') = 1)
+DROP TABLE [dbo].[QRTZ_CALENDARS]
+GO
+
+IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[dbo].[QRTZ_CRON_TRIGGERS]') AND OBJECTPROPERTY(id, N'ISUSERTABLE') = 1)
+DROP TABLE [dbo].[QRTZ_CRON_TRIGGERS]
+GO
+
+IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[dbo].[QRTZ_BLOB_TRIGGERS]') AND OBJECTPROPERTY(id, N'ISUSERTABLE') = 1)
+DROP TABLE [dbo].[QRTZ_BLOB_TRIGGERS]
+GO
+
+IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[dbo].[QRTZ_FIRED_TRIGGERS]') AND OBJECTPROPERTY(id, N'ISUSERTABLE') = 1)
+DROP TABLE [dbo].[QRTZ_FIRED_TRIGGERS]
+GO
+
+IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[dbo].[QRTZ_PAUSED_TRIGGER_GRPS]') AND OBJECTPROPERTY(id, N'ISUSERTABLE') = 1)
+DROP TABLE [dbo].[QRTZ_PAUSED_TRIGGER_GRPS]
+GO
+
+IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[dbo].[QRTZ_SCHEDULER_STATE]') AND OBJECTPROPERTY(id, N'ISUSERTABLE') = 1)
+DROP TABLE [dbo].[QRTZ_SCHEDULER_STATE]
+GO
+
+IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[dbo].[QRTZ_LOCKS]') AND OBJECTPROPERTY(id, N'ISUSERTABLE') = 1)
+DROP TABLE [dbo].[QRTZ_LOCKS]
+GO
+
+IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[dbo].[QRTZ_JOB_DETAILS]') AND OBJECTPROPERTY(id, N'ISUSERTABLE') = 1)
+DROP TABLE [dbo].[QRTZ_JOB_DETAILS]
+GO
+
+IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[dbo].[QRTZ_SIMPLE_TRIGGERS]') AND OBJECTPROPERTY(id, N'ISUSERTABLE') = 1)
+DROP TABLE [dbo].[QRTZ_SIMPLE_TRIGGERS]
+GO
+
+IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[dbo].[QRTZ_SIMPROP_TRIGGERS]') AND OBJECTPROPERTY(id, N'ISUSERTABLE') = 1)
+DROP TABLE [dbo].[QRTZ_SIMPROP_TRIGGERS]
+GO
+
+IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[dbo].[QRTZ_TRIGGERS]') AND OBJECTPROPERTY(id, N'ISUSERTABLE') = 1)
+DROP TABLE [dbo].[QRTZ_TRIGGERS]
+GO
+
+CREATE TABLE [dbo].[QRTZ_CALENDARS] (
+  [SCHED_NAME] [VARCHAR] (120)  NOT NULL ,
+  [CALENDAR_NAME] [VARCHAR] (200)  NOT NULL ,
+  [CALENDAR] [IMAGE] NOT NULL
+) ON [PRIMARY]
+GO
+
+CREATE TABLE [dbo].[QRTZ_CRON_TRIGGERS] (
+  [SCHED_NAME] [VARCHAR] (120)  NOT NULL ,
+  [TRIGGER_NAME] [VARCHAR] (200)  NOT NULL ,
+  [TRIGGER_GROUP] [VARCHAR] (200)  NOT NULL ,
+  [CRON_EXPRESSION] [VARCHAR] (120)  NOT NULL ,
+  [TIME_ZONE_ID] [VARCHAR] (80) 
+) ON [PRIMARY]
+GO
+
+CREATE TABLE [dbo].[QRTZ_FIRED_TRIGGERS] (
+  [SCHED_NAME] [VARCHAR] (120)  NOT NULL ,
+  [ENTRY_ID] [VARCHAR] (95)  NOT NULL ,
+  [TRIGGER_NAME] [VARCHAR] (200)  NOT NULL ,
+  [TRIGGER_GROUP] [VARCHAR] (200)  NOT NULL ,
+  [INSTANCE_NAME] [VARCHAR] (200)  NOT NULL ,
+  [FIRED_TIME] [BIGINT] NOT NULL ,
+  [PRIORITY] [INTEGER] NOT NULL ,
+  [STATE] [VARCHAR] (16)  NOT NULL,
+  [JOB_NAME] [VARCHAR] (200)  NULL ,
+  [JOB_GROUP] [VARCHAR] (200)  NULL ,
+  [IS_NONCONCURRENT] [VARCHAR] (1)  NULL ,
+  [REQUESTS_RECOVERY] [VARCHAR] (1)  NULL 
+) ON [PRIMARY]
+GO
+
+CREATE TABLE [dbo].[QRTZ_PAUSED_TRIGGER_GRPS] (
+  [SCHED_NAME] [VARCHAR] (120)  NOT NULL ,
+  [TRIGGER_GROUP] [VARCHAR] (200)  NOT NULL 
+) ON [PRIMARY]
+GO
+
+CREATE TABLE [dbo].[QRTZ_SCHEDULER_STATE] (
+  [SCHED_NAME] [VARCHAR] (120)  NOT NULL ,
+  [INSTANCE_NAME] [VARCHAR] (200)  NOT NULL ,
+  [LAST_CHECKIN_TIME] [BIGINT] NOT NULL ,
+  [CHECKIN_INTERVAL] [BIGINT] NOT NULL
+) ON [PRIMARY]
+GO
+
+CREATE TABLE [dbo].[QRTZ_LOCKS] (
+  [SCHED_NAME] [VARCHAR] (120)  NOT NULL ,
+  [LOCK_NAME] [VARCHAR] (40)  NOT NULL 
+) ON [PRIMARY]
+GO
+
+CREATE TABLE [dbo].[QRTZ_JOB_DETAILS] (
+  [SCHED_NAME] [VARCHAR] (120)  NOT NULL ,
+  [JOB_NAME] [VARCHAR] (200)  NOT NULL ,
+  [JOB_GROUP] [VARCHAR] (200)  NOT NULL ,
+  [DESCRIPTION] [VARCHAR] (250) NULL ,
+  [JOB_CLASS_NAME] [VARCHAR] (250)  NOT NULL ,
+  [IS_DURABLE] [VARCHAR] (1)  NOT NULL ,
+  [IS_NONCONCURRENT] [VARCHAR] (1)  NOT NULL ,
+  [IS_UPDATE_DATA] [VARCHAR] (1)  NOT NULL ,
+  [REQUESTS_RECOVERY] [VARCHAR] (1)  NOT NULL ,
+  [JOB_DATA] [IMAGE] NULL
+) ON [PRIMARY]
+GO
+
+CREATE TABLE [dbo].[QRTZ_SIMPLE_TRIGGERS] (
+  [SCHED_NAME] [VARCHAR] (120)  NOT NULL ,
+  [TRIGGER_NAME] [VARCHAR] (200)  NOT NULL ,
+  [TRIGGER_GROUP] [VARCHAR] (200)  NOT NULL ,
+  [REPEAT_COUNT] [BIGINT] NOT NULL ,
+  [REPEAT_INTERVAL] [BIGINT] NOT NULL ,
+  [TIMES_TRIGGERED] [BIGINT] NOT NULL
+) ON [PRIMARY]
+GO
+
+CREATE TABLE [dbo].[QRTZ_SIMPROP_TRIGGERS] (
+  [SCHED_NAME] [VARCHAR] (120)  NOT NULL ,
+  [TRIGGER_NAME] [VARCHAR] (200)  NOT NULL ,
+  [TRIGGER_GROUP] [VARCHAR] (200)  NOT NULL ,
+  [STR_PROP_1] [VARCHAR] (512) NULL,
+  [STR_PROP_2] [VARCHAR] (512) NULL,
+  [STR_PROP_3] [VARCHAR] (512) NULL,
+  [INT_PROP_1] [INT] NULL,
+  [INT_PROP_2] [INT] NULL,
+  [LONG_PROP_1] [BIGINT] NULL,
+  [LONG_PROP_2] [BIGINT] NULL,
+  [DEC_PROP_1] [NUMERIC] (13,4) NULL,
+  [DEC_PROP_2] [NUMERIC] (13,4) NULL,
+  [BOOL_PROP_1] [VARCHAR] (1) NULL,
+  [BOOL_PROP_2] [VARCHAR] (1) NULL,
+) ON [PRIMARY]
+GO
+
+CREATE TABLE [dbo].[QRTZ_BLOB_TRIGGERS] (
+  [SCHED_NAME] [VARCHAR] (120)  NOT NULL ,
+  [TRIGGER_NAME] [VARCHAR] (200)  NOT NULL ,
+  [TRIGGER_GROUP] [VARCHAR] (200)  NOT NULL ,
+  [BLOB_DATA] [IMAGE] NULL
+) ON [PRIMARY]
+GO
+
+CREATE TABLE [dbo].[QRTZ_TRIGGERS] (
+  [SCHED_NAME] [VARCHAR] (120)  NOT NULL ,
+  [TRIGGER_NAME] [VARCHAR] (200)  NOT NULL ,
+  [TRIGGER_GROUP] [VARCHAR] (200)  NOT NULL ,
+  [JOB_NAME] [VARCHAR] (200)  NOT NULL ,
+  [JOB_GROUP] [VARCHAR] (200)  NOT NULL ,
+  [DESCRIPTION] [VARCHAR] (250) NULL ,
+  [NEXT_FIRE_TIME] [BIGINT] NULL ,
+  [PREV_FIRE_TIME] [BIGINT] NULL ,
+  [PRIORITY] [INTEGER] NULL ,
+  [TRIGGER_STATE] [VARCHAR] (16)  NOT NULL ,
+  [TRIGGER_TYPE] [VARCHAR] (8)  NOT NULL ,
+  [START_TIME] [BIGINT] NOT NULL ,
+  [END_TIME] [BIGINT] NULL ,
+  [CALENDAR_NAME] [VARCHAR] (200)  NULL ,
+  [MISFIRE_INSTR] [SMALLINT] NULL ,
+  [JOB_DATA] [IMAGE] NULL
+) ON [PRIMARY]
+GO
+
+ALTER TABLE [dbo].[QRTZ_CALENDARS] WITH NOCHECK ADD
+  CONSTRAINT [PK_QRTZ_CALENDARS] PRIMARY KEY  CLUSTERED
+  (
+    [SCHED_NAME],
+    [CALENDAR_NAME]
+  )  ON [PRIMARY]
+GO
+
+ALTER TABLE [dbo].[QRTZ_CRON_TRIGGERS] WITH NOCHECK ADD
+  CONSTRAINT [PK_QRTZ_CRON_TRIGGERS] PRIMARY KEY  CLUSTERED
+  (
+    [SCHED_NAME],
+    [TRIGGER_NAME],
+    [TRIGGER_GROUP]
+  )  ON [PRIMARY]
+GO
+
+ALTER TABLE [dbo].[QRTZ_FIRED_TRIGGERS] WITH NOCHECK ADD
+  CONSTRAINT [PK_QRTZ_FIRED_TRIGGERS] PRIMARY KEY  CLUSTERED
+  (
+    [SCHED_NAME],
+    [ENTRY_ID]
+  )  ON [PRIMARY]
+GO
+
+ALTER TABLE [dbo].[QRTZ_PAUSED_TRIGGER_GRPS] WITH NOCHECK ADD
+  CONSTRAINT [PK_QRTZ_PAUSED_TRIGGER_GRPS] PRIMARY KEY  CLUSTERED
+  (
+    [SCHED_NAME],
+    [TRIGGER_GROUP]
+  )  ON [PRIMARY]
+GO
+
+ALTER TABLE [dbo].[QRTZ_SCHEDULER_STATE] WITH NOCHECK ADD
+  CONSTRAINT [PK_QRTZ_SCHEDULER_STATE] PRIMARY KEY  CLUSTERED
+  (
+    [SCHED_NAME],
+    [INSTANCE_NAME]
+  )  ON [PRIMARY]
+GO
+
+ALTER TABLE [dbo].[QRTZ_LOCKS] WITH NOCHECK ADD
+  CONSTRAINT [PK_QRTZ_LOCKS] PRIMARY KEY  CLUSTERED
+  (
+    [SCHED_NAME],
+    [LOCK_NAME]
+  )  ON [PRIMARY]
+GO
+
+ALTER TABLE [dbo].[QRTZ_JOB_DETAILS] WITH NOCHECK ADD
+  CONSTRAINT [PK_QRTZ_JOB_DETAILS] PRIMARY KEY  CLUSTERED
+  (
+    [SCHED_NAME],
+    [JOB_NAME],
+    [JOB_GROUP]
+  )  ON [PRIMARY]
+GO
+
+ALTER TABLE [dbo].[QRTZ_SIMPLE_TRIGGERS] WITH NOCHECK ADD
+  CONSTRAINT [PK_QRTZ_SIMPLE_TRIGGERS] PRIMARY KEY  CLUSTERED
+  (
+    [SCHED_NAME],
+    [TRIGGER_NAME],
+    [TRIGGER_GROUP]
+  )  ON [PRIMARY]
+GO
+
+ALTER TABLE [dbo].[QRTZ_SIMPROP_TRIGGERS] WITH NOCHECK ADD
+  CONSTRAINT [PK_QRTZ_SIMPROP_TRIGGERS] PRIMARY KEY  CLUSTERED
+  (
+    [SCHED_NAME],
+    [TRIGGER_NAME],
+    [TRIGGER_GROUP]
+  )  ON [PRIMARY]
+GO
+
+ALTER TABLE [dbo].[QRTZ_TRIGGERS] WITH NOCHECK ADD
+  CONSTRAINT [PK_QRTZ_TRIGGERS] PRIMARY KEY  CLUSTERED
+  (
+    [SCHED_NAME],
+    [TRIGGER_NAME],
+    [TRIGGER_GROUP]
+  )  ON [PRIMARY]
+GO
+
+ALTER TABLE [dbo].[QRTZ_CRON_TRIGGERS] ADD
+  CONSTRAINT [FK_QRTZ_CRON_TRIGGERS_QRTZ_TRIGGERS] FOREIGN KEY
+  (
+    [SCHED_NAME],
+    [TRIGGER_NAME],
+    [TRIGGER_GROUP]
+  ) REFERENCES [dbo].[QRTZ_TRIGGERS] (
+    [SCHED_NAME],
+    [TRIGGER_NAME],
+    [TRIGGER_GROUP]
+  ) ON DELETE CASCADE
+GO
+
+ALTER TABLE [dbo].[QRTZ_SIMPLE_TRIGGERS] ADD
+  CONSTRAINT [FK_QRTZ_SIMPLE_TRIGGERS_QRTZ_TRIGGERS] FOREIGN KEY
+  (
+    [SCHED_NAME],
+    [TRIGGER_NAME],
+    [TRIGGER_GROUP]
+  ) REFERENCES [dbo].[QRTZ_TRIGGERS] (
+    [SCHED_NAME],
+    [TRIGGER_NAME],
+    [TRIGGER_GROUP]
+  ) ON DELETE CASCADE
+GO
+
+ALTER TABLE [dbo].[QRTZ_SIMPROP_TRIGGERS] ADD
+  CONSTRAINT [FK_QRTZ_SIMPROP_TRIGGERS_QRTZ_TRIGGERS] FOREIGN KEY
+  (
+    [SCHED_NAME],
+    [TRIGGER_NAME],
+    [TRIGGER_GROUP]
+  ) REFERENCES [dbo].[QRTZ_TRIGGERS] (
+    [SCHED_NAME],
+    [TRIGGER_NAME],
+    [TRIGGER_GROUP]
+  ) ON DELETE CASCADE
+GO
+
+ALTER TABLE [dbo].[QRTZ_TRIGGERS] ADD
+  CONSTRAINT [FK_QRTZ_TRIGGERS_QRTZ_JOB_DETAILS] FOREIGN KEY
+  (
+    [SCHED_NAME],
+    [JOB_NAME],
+    [JOB_GROUP]
+  ) REFERENCES [dbo].[QRTZ_JOB_DETAILS] (
+    [SCHED_NAME],
+    [JOB_NAME],
+    [JOB_GROUP]
+  )
+GO
+

Propchange: incubator/syncope/trunk/core/src/main/resources/quartz/tables_sqlServer.sql
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/syncope/trunk/core/src/main/resources/quartz/tables_sqlServer.sql
------------------------------------------------------------------------------
    svn:keywords = Date Revision Author HeadURL Id

Propchange: incubator/syncope/trunk/core/src/main/resources/quartz/tables_sqlServer.sql
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: incubator/syncope/trunk/core/src/test/resources/sqlserver/persistence.properties
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/core/src/test/resources/sqlserver/persistence.properties?rev=1399709&r1=1399708&r2=1399709&view=diff
==============================================================================
--- incubator/syncope/trunk/core/src/test/resources/sqlserver/persistence.properties (original)
+++ incubator/syncope/trunk/core/src/test/resources/sqlserver/persistence.properties Thu Oct 18 15:57:27 2012
@@ -21,5 +21,5 @@ jpa.username=syncope
 jpa.password=syncope
 jpa.dialect=org.apache.openjpa.jdbc.sql.SQLServerDictionary
 quartz.jobstore=org.quartz.impl.jdbcjobstore.MSSQLDelegate
-quartz.sql=tables_sqlserver.sql
-logback.sql=sqlserver.sql
\ No newline at end of file
+quartz.sql=tables_sqlServer.sql
+logback.sql=sqlserver.sql

Modified: incubator/syncope/trunk/pom.xml
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/pom.xml?rev=1399709&r1=1399708&r2=1399709&view=diff
==============================================================================
--- incubator/syncope/trunk/pom.xml (original)
+++ incubator/syncope/trunk/pom.xml Thu Oct 18 15:57:27 2012
@@ -251,7 +251,7 @@ under the License.
     <jackson.version>1.9.10</jackson.version>
     <xstream.version>1.4.3</xstream.version>
     <velocity.version>1.7</velocity.version>
-    <quartz.version>1.8.6</quartz.version>
+    <quartz.version>2.1.6</quartz.version>
 
     <openjpa.version>2.2.0</openjpa.version>
     <bval.version>0.5</bval.version>



Mime
View raw message