2 Replies Latest reply on Feb 17, 2009 3:37 PM by kgoedert

    quatz and databases

    kgoedert

      Hi,


      I'm trying to use quartz on my seam application. I followed the example provided with seam 2.1.1.GA and everything worked. The difference from the example is that I can't loose the schedule configurations after a redeploy so, I need a database.


      Can anyone point to an example, on how to use a database? Every time I try to execute the method annotated with @Asynchronous I get:


      Caused by: org.quartz.JobPersistenceException: Couldn't rollback jdbc connection. You cannot rollback during a managed transaction! [See nested exception: java.sql.SQLException: You cannot rollback during a managed transaction!]
           at org.quartz.impl.jdbcjobstore.JobStoreSupport.rollbackConnection(JobStoreSupport.java:2319)
           at org.quartz.impl.jdbcjobstore.JobStoreTX.storeJobAndTrigger(JobStoreTX.java:172)
           at org.quartz.core.QuartzScheduler.scheduleJob(QuartzScheduler.java:613)
           at org.quartz.impl.StdScheduler.scheduleJob(StdScheduler.java:238)
           at org.jboss.seam.async.QuartzDispatcher.scheduleWithQuartzService(QuartzDispatcher.java:151)
           at org.jboss.seam.async.QuartzDispatcher.scheduleWithQuartzServiceAndWrapExceptions(QuartzDispatcher.java:115)
           ... 88 more
      10:20:40,859 WARN  [ExceptionFilter] running exception handlers



      Appreciate any help


      Kelly

        • 1. Re: quatz and databases
          baspet
          Create a file named seam.quartz.properties and place it together with seam.properties. Change quartzDS to yours datasource.

          org.quartz.scheduler.instanceName = Sched1
          org.quartz.scheduler.instanceId = AUTO
          org.quartz.scheduler.instanceIdGenerator.class = org.quartz.simpl.SimpleInstanceIdGenerator
          org.quartz.scheduler.rmi.export = false
          org.quartz.scheduler.rmi.proxy = false

          org.quartz.threadPool.class = org.quartz.simpl.SimpleThreadPool
          org.quartz.threadPool.threadCount = 3

          #org.quartz.jobStore.class = org.quartz.simpl.RAMJobStore
          org.quartz.jobStore.useProperties = false
          org.quartz.jobStore.class = org.quartz.impl.jdbcjobstore.JobStoreCMT
          org.quartz.jobStore.driverDelegateClass = org.quartz.impl.jdbcjobstore.StdJDBCDelegate
          org.quartz.jobStore.tablePrefix = QRTZ_

          org.quartz.jobStore.dataSource = quartzDS
          org.quartz.dataSource.quartzDS.jndiURL = java:/AVTUDatasource

          org.quartz.jobStore.nonManagedTXDataSource = quartzDS
          • 2. Re: quatz and databases
            kgoedert

            I did my looks as follows



            org.quartz.scheduler.instanceName = BillingImporter
            org.quartz.scheduler.instanceId = 1
            org.quartz.scheduler.rmi.export = false
            org.quartz.scheduler.rmi.proxy = false
            
            org.quartz.threadPool.class = org.quartz.simpl.SimpleThreadPool
            org.quartz.threadPool.threadCount = 3
            
            org.quartz.jobStore.class = org.quartz.impl.jdbcjobstore.JobStoreTX
            org.quartz.jobStore.driverDelegateClass = org.quartz.impl.jdbcjobstore.PostgreSQLDelegate
            org.quartz.jobStore.tablePrefix = QRTZ_BILLING_
            org.quartz.jobStore.dataSource = pcc-ds 
            
            org.quartz.dataSource.pcc-ds.jndiURL=java:/pcc-ds
            org.quartz.dataSource.pcc-ds.java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
            org.quartz.dataSource.pcc-ds.java.naming.provider.url=localhost\:1099