KB Article #160907

database - missing index for MS SQL server database leading to deadlock issues

Problem

-- missing index for MS SQL server database leading to deadlock issues

-- 2012-03-20 12:36:46,143 - ERROR [ClientConnection] (QueryManager.executeQuery:60) - Error while executing query
com.solarmetric.jdbc.ReportingSQLException: Transaction (Process ID 119) was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun the transaction. {prepstmnt 3590622 Select m.OID from Messages m, CustomData c1 where (m.OID=c1.MessageOID AND c1.Name='LoggerId' AND c1.DataValue IN ('logger_5301_0000000000104925'))} [code=1205, state=40001]
    at com.solarmetric.jdbc.LoggingConnectionDecorator.wrap(LoggingConnectionDecorator.java:196)
    at com.solarmetric.jdbc.LoggingConnectionDecorator.access$800(LoggingConnectionDecorator.java:20)
    at com.solarmetric.jdbc.LoggingConnectionDecorator$LoggingConnection$LoggingPreparedStatement.executeQuery(LoggingConnectionDecorator.java:1110)
    at com.solarmetric.jdbc.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:352)
    at kodo.jdbc.runtime.JDBCStoreManager$CancelPreparedStatement.executeQuery(JDBCStoreManager.java:1730)
    at com.solarmetric.jdbc.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:352)
    at com.solarmetric.jdbc.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:339)
    at com.cyclonecommerce.tradingengine.messaging.tracker.QueryManager.executeQuery(QueryManager.java:53)
    at b2bx.pluggabletransport.IntegratorPluggableServer$IntegratorClient.isMessageInInterchange(IntegratorPluggableServer.java:388)
    at b2bx.pluggabletransport.IntegratorPluggableServer$IntegratorClient.run(IntegratorPluggableServer.java:328)

 

Resolution

* until it is fixed by a future service pack(check readmes) missing index can be created manually by command below:

CREATE nonclustered  INDEX [ix_customdata_compound] ON [dbo].[CustomData] ([[Name]) INCLUDE (datavalue)