<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<body link="#355491" alink="#4262a1" vlink="#355491" style="background: #e2e2e2; margin: 0; padding: 20px;">

<div>
        <table cellpadding="0" bgcolor="#FFFFFF" border="0" cellspacing="0" style="border: 1px solid #dadada; margin-bottom: 30px; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                <tbody>
                        <tr>

                                <td>

                                        <table border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" style="border: solid 2px #ccc; background: #dadada; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                                                <tbody>
                                                        <tr>
                                                                <td bgcolor="#000000" valign="middle" height="58px" style="border-bottom: 1px solid #ccc; padding: 20px; -moz-border-radius-topleft: 3px; -moz-border-radius-topright: 3px; -webkit-border-top-right-radius: 5px; -webkit-border-top-left-radius: 5px;">
                                                                        <h1 style="color: #333333; font: bold 22px Arial, Helvetica, sans-serif; margin: 0; display: block !important;">
                                                                        <!-- To have a header image/logo replace the name below with your img tag -->
                                                                        <!-- Email clients will render the images when the message is read so any image -->
                                                                        <!-- must be made available on a public server, so that all recipients can load the image. -->
                                                                        <a href="http://community.jboss.org/index.jspa" style="text-decoration: none; color: #E1E1E1">Community</a></h1>
                                                                </td>

                                                        </tr>
                                                        <tr>
                                                                <td bgcolor="#FFFFFF" style="font: normal 12px Arial, Helvetica, sans-serif; color:#333333; padding: 20px;  -moz-border-radius-bottomleft: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 5px; -webkit-border-bottom-left-radius: 5px;"><h3 style="margin: 10px 0 5px; font-size: 17px; font-weight: normal;">
    Quartz Deadlocks
</h3>
<span style="margin-bottom: 10px;">
    created by <a href="http://community.jboss.org/people/aehrensberger">aaron ehrensberger</a> in <i>jBPM</i> - <a href="http://community.jboss.org/message/533394#533394">View the full discussion</a>
</span>
<hr style="margin: 20px 0; border: none; background-color: #dadada; height: 1px;">

<div class="jive-rendered-content"><p>We are using Quartz with&#160; Spring and our configuration is throwing deadlocks when quartz has more than 1&#160; thread configured. I'm starting to believe that it's because we don't have our&#160; quartz configured correctly with Spring, but I can't find enough documentation&#160; on how to configure the two to play nicely.&#160; I'm also starting to believe that Quartz is not going to be our solution, unfortunately, because of this issue.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>We are running tests under heavy load, starting as many as 1000 jobs in a matter of minutes, all scheduled to be picked up by 50 quartz threads after 10 second delays.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>We are running on both&#160; Windows and Linux environments - pointing at MSSQL and Oracle DBs. With both OS,&#160; using either DB, we can throw the following deadlock errors...</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>2010-03-17 18:52:31,737 [] [] ERROR [DocFinityScheduler_Worker-42]&#160; core.ErrorLogger core.ErrorLogger (QuartzScheduler.java:2185) - An error occured&#160; while marking executed job complete. job= 'BPM.6e41a6567f0000020100362a51dc7a50'</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>org.quartz.JobPersistenceException: Couldn't remove trigger: Transaction&#160; (Process ID 87) was deadlocked on lock resources with another process and has&#160; been chosen as the deadlock victim. Rerun the transaction. [See nested&#160; exception: com.microsoft.sqlserver.jdbc.SQLServerException: Transaction (Process&#160; ID 87) was deadlocked on lock resources with another process and has been chosen&#160; as the deadlock victim. Rerun the transaction.] <br/>at&#160; org.quartz.impl.jdbcjobstore.JobStoreSupport.removeTrigger(JobStoreSupport.java:1469)at&#160; org.quartz.impl.jdbcjobstore.JobStoreSupport.triggeredJobComplete(JobStoreSupport.java:2978)at&#160; org.quartz.impl.jdbcjobstore.JobStoreSupport$39.execute(JobStoreSupport.java:2962)&#160; at&#160; org.quartz.impl.jdbcjobstore.JobStoreSupport$41.execute(JobStoreSupport.java:3713)at&#160; org.quartz.impl.jdbcjobstore.JobStoreSupport.executeInNonManagedTXLock(JobStoreSupport.java:3747)&#160; <br/>at&#160; org.quartz.impl.jdbcjobstore.JobStoreSupport.executeInNonManagedTXLock(JobStoreSupport.java:3709)at&#160; org.quartz.impl.jdbcjobstore.JobStoreSupport.triggeredJobComplete(JobStoreSupport.java:2958)at&#160; org.quartz.core.QuartzScheduler.notifyJobStoreJobComplete(QuartzScheduler.java:1727)at&#160; org.quartz.core.JobRunShell.run(JobRunShell.java:273) <br/>at&#160; org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:534)</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: Transaction&#160; (Process ID 87) was deadlocked on lock resources with another process and has&#160; been chosen as the deadlock victim. Rerun the transaction. <br/>at&#160; com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(Unknown&#160; Source at com.microsoft.sqlserver.jdbc.SQLServerStatement.getNextResult(Unknown&#160; Source) at&#160; com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.doExecutePreparedStatement(Unknown&#160; Source) at&#160; com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement$PrepStmtExecCmd.doExecute(Unknown&#160; Source) at com.microsoft.sqlserver.jdbc.TDSCommand.execute(Unknown Source) at&#160; com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(Unknown Source)&#160; at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeCommand(Unknown&#160; Source)at&#160; com.microsoft.sqlserver.jdbc.SQLServerStatement.executeStatement(Unknown Source)&#160; at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.executeUpdate(Unknown&#160; Source)at&#160; com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeUpdate(NewProxyPreparedStatement.java:105)&#160; at&#160; org.quartz.impl.jdbcjobstore.StdJDBCDelegate.deleteSimpleTrigger(StdJDBCDelegate.java:1820)&#160; at&#160; org.quartz.impl.jdbcjobstore.JobStoreSupport.deleteTriggerAndChildren(JobStoreSupport.java:1345&#160; at&#160; org.quartz.impl.jdbcjobstore.JobStoreSupport.removeTrigger(JobStoreSupport.java:1453&#160; ... 9 more</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p><br/>I have attached as many files as I could think of that relate to the issue.&#160; Can anybody help me out here?&#160;&#160; Do I have it&#160; configured incorrectly to not use a JobStoreCMT versus a JobStoreTX? Do I have&#160; it configured incorrectly in terms of threads or something else?</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>I'm&#160; really at a loss. We've been scouring the web for this stuff for documentation&#160; for two days and are still scratching our heads.</p></div>

<div style="background-color: #f4f4f4; padding: 10px; margin-top: 20px;">
    <p style="margin: 0;">Reply to this message by <a href="http://community.jboss.org/message/533394#533394">going to Community</a></p>
        <p style="margin: 0;">Start a new discussion in jBPM at <a href="http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034">Community</a></p>
</div></td>
                        </tr>
                    </tbody>
                </table>


                </td>
            </tr>
        </tbody>
    </table>

</div>

</body>
</html>