History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: QUARTZ-340
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: James House
Reporter: Jasper Rosenberg
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
Quartz Scheduler

In JobRunShell.run() notifyJobStoreJobComplete exception always returns

Created: 02/Mar/06 02:58 PM   Updated: 01/May/07 09:07 PM
Component/s: Core
Affects Version/s: 1.6, 1.5.2
Fix Version/s: 1.6.1

File Attachments: 1. Text File QUARTZ-340.patch (11 kb)



 Description  « Hide
JTAJobRunShell tries to make sure that the UserTransaction is always returned to the UserTransactionHelper.

However, it has to depend on JobRunShell.run() eventually calling either complete() or passivate() (via jobRunShellFactory.returnJobRunShell())

There are two worries I have with the following code in JobRunShell.run():

                if (!completeTriggerRetryLoop(trigger, jobDetail, instCode))
                ;
                return;

1. It looks like a bug because the if doesn't do anything. The code is the same as:
               completeTriggerRetryLoop(trigger, jobDetail, instCode);
               return;
  Presumably the intent was
                if (!completeTriggerRetryLoop(trigger, jobDetail, instCode)) {
                    return;
                }


2. When it does return, it does not call jobRunShellFactory.returnJobRunShell(this). I guess this used to be okay if the first problem was fixed because it meant that the scheduler was shutdown anyway, but now it means that the UserTransaction is never returned. It seems like it would be fine to still return the JobRunShell even if the scheduler is shutdown, so maybe that last line can just be moved into a finally block around the entire run() method.

 All   Comments   Change History      Sort Order:
Jasper Rosenberg - [20/Mar/06 01:20 PM ]
During the course of the checkstyle work (QUARTZ-374), I went ahead and fixed issue 1 to be what it looked like the intent was.

Henri Yandell - [30/Apr/07 06:02 PM ]
Wrapping the run() body in a finally so the returnJobShell always happens.

Henri Yandell - [01/May/07 09:07 PM ]
To the branch:

svn ci -m "Wrapping the body of the run() method in a try-finally so that the UserTransaction in JTAJobRunShell is assured of being released as per QUARTZ-340" src/
Sending src/java/org/quartz/core/JobRunShell.java
Transmitting file data .
Committed revision 702.

To trunk:

svn ci -m "Wrapping the body of the run() method in a try-finally so that the UserTransaction in JTAJobRunShell is assured of being released as per QUARTZ-340" src/
Sending src/java/org/quartz/core/JobRunShell.java
Transmitting file data .
Committed revision 703.