View Issue Details

IDProjectCategoryView StatusLast Update
0003265SymmetricDS ProBugpublic2017-10-06 11:53
Reportermmichalek Assigned Tommichalek  
Prioritynormal 
Status closedResolutionfixed 
Product Version3.8.30 
Target Version3.8.30Fixed in Version3.8.30 
Summary0003265: Outgoing batch query causes deadlocks
DescriptionThe following query was found to cause deadlocks on SQL Server. Since this is a reporting query, used by Symmetric Pro dashboard, it will be changed to use the "dirty" SQL template, instead of the regular SQL template.

Below is an example of the error:

2017-10-02 12:59:14,806 ERROR [gui] [a] [ui-refresher-1] Exception while refreshing class com.jumpmind.symmetric.console.ui.screen.c StackTraceKey.init [SqlException:1689863977]
org.jumpmind.db.sql.SqlException: Failed to execute sql: select min(b.batch_id) as batch_id, b.node_id, b.status, b.channel_id from sym_outgoing_batch b where status != 'OK' and status != 'RT' group by b.node_id, b.status, b.channel_id
    at org.jumpmind.db.sql.AbstractSqlTemplate.translate(AbstractSqlTemplate.java:300)
    at org.jumpmind.db.sql.JdbcSqlReadCursor.<init>(JdbcSqlReadCursor.java:120)
    at org.jumpmind.db.sql.JdbcSqlTemplate.queryForCursor(JdbcSqlTemplate.java:140)
    at org.jumpmind.db.sql.AbstractSqlTemplate.query(AbstractSqlTemplate.java:199)
    at org.jumpmind.db.sql.AbstractSqlTemplate.query(AbstractSqlTemplate.java:195)
    at org.jumpmind.db.sql.AbstractSqlTemplate.query(AbstractSqlTemplate.java:185)
    at org.jumpmind.db.sql.AbstractSqlTemplate.query(AbstractSqlTemplate.java:121)
    at org.jumpmind.symmetric.service.impl.OutgoingBatchService.getNextOutgoingBatchForEachNode(OutgoingBatchService.java:558)
    at com.jumpmind.symmetric.console.model.DashboardInfo.refreshBatchActivity(DashboardInfo.java:135)
    at com.jumpmind.symmetric.console.model.DashboardInfo.refresh(DashboardInfo.java:103)
    at com.jumpmind.symmetric.console.ui.screen.c.onBackgroundRefresh(DashboardScreen.java:83)
    at com.jumpmind.symmetric.console.ui.a$1.run(BackgroundRefresherService.java:60)
    at org.springframework.scheduling.support.DelegatingErrorHandlingRunnable.run(DelegatingErrorHandlingRunnable.java:54)
    at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
    at java.util.concurrent.FutureTask.runAndReset(Unknown Source)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(Unknown Source)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
Caused by: java.sql.SQLException: Transaction (Process ID 192) was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun the transaction.
    at net.sourceforge.jtds.jdbc.SQLDiagnostic.addDiagnostic(SQLDiagnostic.java:372)
    at net.sourceforge.jtds.jdbc.TdsCore.tdsErrorToken(TdsCore.java:2894)
    at net.sourceforge.jtds.jdbc.TdsCore.nextToken(TdsCore.java:2334)
    at net.sourceforge.jtds.jdbc.TdsCore.getNextRow(TdsCore.java:777)
    at net.sourceforge.jtds.jdbc.MSCursorResultSet.processOutput(MSCursorResultSet.java:956)
    at net.sourceforge.jtds.jdbc.MSCursorResultSet.cursorCreate(MSCursorResultSet.java:541)
    at net.sourceforge.jtds.jdbc.MSCursorResultSet.<init>(MSCursorResultSet.java:154)
    at net.sourceforge.jtds.jdbc.JtdsStatement.executeSQLQuery(JtdsStatement.java:453)
    at net.sourceforge.jtds.jdbc.JtdsPreparedStatement.executeQuery(JtdsPreparedStatement.java:979)
    at org.apache.commons.dbcp.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:96)
    at org.apache.commons.dbcp.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:96)
    at org.jumpmind.db.sql.JdbcSqlReadCursor.<init>(JdbcSqlReadCursor.java:97)
    ... 18 more
TagsNo tags attached.

Activities

There are no notes attached to this issue.

Related Changesets

SymmetricDS: 3.8 106de93c

2017-10-02 16:45:33

mmichalek

Details Diff
0003265: Outgoing batch query causes deadlocks Affected Issues
0003265
mod - symmetric-core/src/main/java/org/jumpmind/symmetric/service/impl/OutgoingBatchService.java Diff File

Issue History

Date Modified Username Field Change
2017-10-02 20:44 mmichalek New Issue
2017-10-02 20:44 mmichalek Status new => assigned
2017-10-02 20:44 mmichalek Assigned To => mmichalek
2017-10-02 21:00 mmichalek Changeset attached => SymmetricDS 3.8 106de93c
2017-10-05 16:45 mmichalek Status assigned => resolved
2017-10-05 16:45 mmichalek Resolution open => fixed
2017-10-05 16:45 mmichalek Fixed in Version => 3.8.30
2017-10-06 11:53 chenson Status resolved => closed