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