Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8003379
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T16:38:05+00:00 2026-06-04T16:38:05+00:00

I am using quartz, Spring with Hibernate as the JPA provider. Database is Oracle.

  • 0

I am using quartz, Spring with Hibernate as the JPA provider. Database is Oracle.

I’ve got a method which writes a file to the file system and update the database with the details.
This method can be called in two ways:

  1. Using a web service
  2. Or, as a scheduled quatrz job.

I’ve set up quartz as:

<bean id="scheduler" class="org.springframework.scheduling.quartz.SchedulerFactoryBean" lazy-init="false" scope="singleton">
        <property name="autoStartup" value="true"/>
        <property name="waitForJobsToCompleteOnShutdown" value="true"/>
        <property name="overwriteExistingJobs" value="true"/>
        <property name="dataSource" ref="dataSource"/>
        <property name="transactionManager" ref="transactionManager"/>
        <property name="quartzProperties">
            <props>
                <prop key="org.quartz.scheduler.instanceName">FileScheduler</prop>
                <prop key="org.quartz.scheduler.instanceId">AUTO</prop>
                <prop key="org.quartz.jobStore.misfireThreshold">6000</prop>
                <prop key="org.quartz.jobStore.class">org.quartz.impl.jdbcjobstore.JobStoreTX</prop>
                <prop key="org.quartz.jobStore.driverDelegateClass">${driverDelegateClass}</prop>
                <prop key="org.quartz.jobStore.tablePrefix">QRTZ_</prop>
                <prop key="org.quartz.jobStore.isClustered">true</prop>
                <prop key="org.quartz.threadPool.class">org.quartz.simpl.SimpleThreadPool</prop>
                <prop key="org.quartz.threadPool.threadCount">5</prop>
                <prop key="org.quartz.threadPool.threadPriority">5</prop>
            </props>
        </property>
    </bean>

This method is using spring managed transaction.

Problem is when this method is invoked by the quartz scheduler, the file gets created but the database is not updated (there should be two tables updated and one table insert).

I’ve enabled hibernate show_SQL as well, but in case of scheduler no update\insert statements are getting logged.

Though this works fine when this method is invoked by a web service request. Log shows update\insert statements as well.

UPDATE 1

To summarize my problem, this is what I am trying to achieve:

  1. Create a new record in the employee table.
  2. Save the employee_id in the job_store (quartz).
  3. When trigger is fired, quartz gives back the employee_id
  4. Retrieve (load) the employee record based on this key.
  5. Send Employee an email
  6. Update the Notification with status as ‘Sent’ (insert statement)

In the end, I expect all the tables to be updated.

When quartz triggers the job, all is working except point 6.
Code is correct as when I invoke this method using a web service call, the table is getting updated.

UPDATE 2

I updated the code to use

<prop key="org.quartz.jobStore.class">org.springframework.scheduling.quartz.LocalDataSourceJobStore</prop>

but this also doest’nt help.

Please help. Thanks.
Adi

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T16:38:06+00:00Added an answer on June 4, 2026 at 4:38 pm

    Quartz runs in its own context, even if started by the Spring convenience methods, so you actually don’t end up getting your whole Spring application context, unless you explicitly at a JobDataMap to pass in beans (see http://forum.springsource.org/showthread.php?76974-Why-autowired-doesn-t-work-on-a-QuartzJobBean-bean). So, you can pass in Spring-managed beans, but it all seems kind of messy if you don’t need the full capabilities of Quartz.

    If your scheduling needs aren’t that complex, you might want to consider using the @Scheduled Spring annotation (see here), as then the entire method call happens natively in the Spring context, and your transactions will then work as they do in the web service call.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In a spring servlet xml file, I'm using org.springframework.scheduling.quartz.SchedulerFactoryBean to regularly fire a set
I'm using Spring's SchedulerFactoryBean to run some Quartz jobs within a Spring based java
Started using Quartz.net in my project. But got stuck. Using cron trigger fires only
I developed an EAR using Quartz API. I have put my quartz.properties file in
In my webapp I am using Quartz to call a method defined in some
I am using quartz scheduler in my spring project. I have to run a
I'm using Quartz.NET with a database, i.e. ADO.NET. Problem is, when my jobs are
greetings all i have a web application using (spring-hibernate) frameworks and when tried to
I have a web application that using Struts + Spring + Hibernate . In
I'm using Quartz together with Spring. The JobStore that I'm using is the RAMJobStore.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.