将IAS从Quartz移植到JBoss AS

问题描述:

我将我们的代码从IAS移植到JBoss AS。 石英根本不会触发任何事件,并且在石英原木上不会出现任何错误。我也注意到Quartz表没有被填充(QRTZ_JOB_DETAILS,QRTZ_TRIGGERS等)。将IAS从Quartz移植到JBoss AS

我正在使用JOBStoreCMT与石英版本1.5.2。数据源是很好的声明。工作和触发器在IAS中运行良好,并在代码中声明。

石英属性:

#============================================================================ 
# Configure Main Scheduler Properties 
#============================================================================ 

org.quartz.scheduler.instanceName = bitbandScheduler 
org.quartz.scheduler.instanceId = AUTO 

#============================================================================ 
# Configure ThreadPool 
#============================================================================ 

org.quartz.threadPool.class = org.quartz.simpl.SimpleThreadPool 
org.quartz.threadPool.threadCount = 15 
org.quartz.threadPool.threadPriority = 5 

#============================================================================ 
# Configure JobStore 
#============================================================================ 

org.quartz.jobStore.misfireThreshold = 60000 

org.quartz.jobStore.class = org.quartz.impl.jdbcjobstore.JobStoreCMT 
org.quartz.jobStore.driverDelegateClass = org.quartz.impl.jdbcjobstore.StdJDBCDelegate 
org.quartz.jobStore.useProperties = false 
org.quartz.jobStore.dataSource = bitband_pluginDS 
org.quartz.jobStore.nonManagedTXDataSource = bitband_pluginDSTX 
org.quartz.jobStore.tablePrefix = QRTZ_ 

org.quartz.jobStore.isClustered = false 
org.quartz.jobStore.clusterCheckinInterval = 20000 

#============================================================================ 
# Configure Datasources 
#============================================================================ 

org.quartz.dataSource.bitband_pluginDS.jndiURL=java:bitband_pluginDS 
org.quartz.dataSource.bitband_pluginDSTX.jndiURL=java:bitband_pluginDS 

甲骨文ds.xml文件:

<xa-datasource> 
      <jndi-name>bitband_pluginDS</jndi-name> 
      <!-- uncomment to enable interleaving <interleaving/> --> 
      <isSameRM-override-value>false</isSameRM-override-value> 
      <xa-datasource-class>oracle.jdbc.xa.client.OracleXADataSource</xa-datasource-class> 
      <xa-datasource-property name="URL">jdbc:oracle:thin:@ord-rtv063.orca.ent:1521:DB11g</xa-datasource-property> 

      <xa-datasource-property name="User">RIGHTV7_VS</xa-datasource-property> 
      <xa-datasource-property name="Password">RIGHTV7_VS</xa-datasource-property> 
       <max-pool-size>100</max-pool-size> 
       <min-pool-size>20</min-pool-size> 
       <valid-connection-checker-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleValidConnectionChecker</valid-connection-checker-class-name> 
       <check-valid-connection-sql>select 1 from dual</check-valid-connection-sql> 
      <!-- Uses the pingDatabase method to check a connection is still valid before handing it out from the pool --> 
      <!--valid-connection-checker-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleValidConnectionChecker</valid-connection-checker-class-name--> 
      <!-- Checks the Oracle error codes and messages for fatal errors --> 
      <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleExceptionSorter</exception-sorter-class-name> 
      <!-- Oracles XA datasource cannot reuse a connection outside a transaction once enlisted in a global transaction and vice-versa --> 
      <no-tx-separate-pools/> 
       <!-- corresponding type-mapping in the standardjbosscmp-jdbc.xml (optional) --> 
       <metadata> 
        <type-mapping>Oracle9i</type-mapping> 
       </metadata> 
    </xa-datasource> 

我缺少什么? PS,使用JobStoreTX时,一切正常,所以我猜这是与容器事务管理器相关的事情。

在过去的几天里,问题悬而未决之后,我找到了解决方案。

将下面的属性添加到quartz.properties文件中。就如此容易。

org.quartz.jobStore.dontSetAutoCommitFalse=false 

此参数设置为true告诉石英不调用setAutoCommit(false)上从数据源(一个或多个)获得的连接。在一些情况下,这可能会有所帮助,例如,如果驱动程序在已关闭时调用它,则会发出抱怨。此属性默认为false,因为大多数驱动程序要求调用setAutoCommit(false)

由于某种原因,JBoss重写了默认值,所以我不得不明确地添加它。

功劳归于未知用户: http://osdir.com/ml/java.quartz.user/2007-10/msg00123.html