Set an image for Centric CRM 4.1 (Stable and Released)

Sign In or Register

Centric CRM 4.1 (Stable and Released)

Core Team
PUBLIC PROFILE

Assignment

Priority: Scheduled
Assigned To: Kailash Bhoopalam

Ticket # 100

This ticket is open
Severity: Critical
Category: Blocker
Entered by: Matt Rajkowski 1/8/2007, 9:53 AM
Last modified: Matt Rajkowski 4/16/2007, 9:24 AM

Description

In branch-41, a code review was conducted and several action classes were identified as potential risk for database deadlock under high load. When the deadlock occurs the application hangs until the database connection has been closed and requests processed. To fix this, an action class should never call an executeCommand method itself, so either move the executeCommand after the freeing of the database connection or use chaining to have the ServletController execute the next method (preferred).

The code in branch-41 has been updated with the following comment in those areas...
TODO: Executing a new action within an open db can create a deadlock

Targets
String '// TODO: Executing a new action within an open db can create a deadlock'
Found usages (32 usages)
Accounts.java (3 usages)
(1803, 11) // TODO: Executing a new action within an open db can create a deadlock
(1807, 11) // TODO: Executing a new action within an open db can create a deadlock
(1810, 11) // TODO: Executing a new action within an open db can create a deadlock
ActionPlanEditor.java (7 usages)
(312, 11) // TODO: Executing a new action within an open db can create a deadlock
(315, 11) // TODO: Executing a new action within an open db can create a deadlock
(790, 11) // TODO: Executing a new action within an open db can create a deadlock
(793, 11) // TODO: Executing a new action within an open db can create a deadlock
(1314, 11) // TODO: Executing a new action within an open db can create a deadlock
(1317, 11) // TODO: Executing a new action within an open db can create a deadlock
(1603, 9) // TODO: Executing a new action within an open db can create a deadlock
KnowledgeBaseManager.java (2 usages)
(446, 11) // TODO: Executing a new action within an open db can create a deadlock
(449, 11) // TODO: Executing a new action within an open db can create a deadlock
Leads.java (1 usage)
(1469, 9) // TODO: Executing a new action within an open db can create a deadlock
PageGroups.java (2 usages)
(199, 11) // TODO: Executing a new action within an open db can create a deadlock
(202, 11) // TODO: Executing a new action within an open db can create a deadlock
Pages.java (2 usages)
(200, 11) // TODO: Executing a new action within an open db can create a deadlock
(203, 11) // TODO: Executing a new action within an open db can create a deadlock
PortfolioEditor.java (2 usages)
(640, 11) // TODO: Executing a new action within an open db can create a deadlock
(643, 11) // TODO: Executing a new action within an open db can create a deadlock
ProductCatalogImports.java (1 usage)
(513, 11) // TODO: Executing a new action within an open db can create a deadlock
Reassignments.java (1 usage)
(481, 11) // TODO: Executing a new action within an open db can create a deadlock
Sales.java (4 usages)
(601, 11) // TODO: Executing a new action within an open db can create a deadlock
(604, 11) // TODO: Executing a new action within an open db can create a deadlock
(728, 9) // TODO: Executing a new action within an open db can create a deadlock
(852, 9) // TODO: Executing a new action within an open db can create a deadlock
SalesImports.java (1 usage)
(423, 11) // TODO: Executing a new action within an open db can create a deadlock
Tabs.java (2 usages)
(198, 11) // TODO: Executing a new action within an open db can create a deadlock
(201, 11) // TODO: Executing a new action within an open db can create a deadlock
TroubleTicketDefects.java (2 usages)
(207, 11) // TODO: Executing a new action within an open db can create a deadlock
(210, 11) // TODO: Executing a new action within an open db can create a deadlock
UserGroups.java (2 usages)
(206, 11) // TODO: Executing a new action within an open db can create a deadlock
(209, 11) // TODO: Executing a new action within an open db can create a deadlock

Solution

solution: instead of calling freeConnection() we can redesign classes for example:


executeCommandCheckFields(ActionContext context) {

return executeCommandFields(context,db);

}

public String executeCommandFields(ActionContext context) {
Connection db = null;
String status = null;
try{
db = this.getConnection(context);
status = this.executeCommandFields(context,db);
} catch (Exception e) {
context.getRequest().setAttribute("Error", e);
return ("SystemError"); } finally {
this.freeConnection(context, db);
}
return status;
}

private String executeCommandFields(ActionContext context, Connection db) throws NumberFormatException, SQLException {

}

File Attachments

There are no file attachments

Ticket Activity

Date Event
Matt Rajkowski 1/8/2007, 9:53 AM [ Ticket Opened ]
Matt Rajkowski 1/8/2007, 9:53 AM [ Assigned to Bhoopalam, Kailash ]
Matt Rajkowski 1/8/2007, 9:53 AM [ Priority set to Scheduled ]
Matt Rajkowski 1/8/2007, 9:53 AM [ Severity set to Critical ]
Matt Rajkowski 1/8/2007, 9:53 AM Please make yourself aware of this issue and forward to coder so that they understand the issue and can resolve this.
Kailash Bhoopalam 1/8/2007, 8:10 PM [ Reassigned from Bhoopalam, Kailash to Kartautsau, Pavel ]
Pavel Kartautsau 1/11/2007, 6:50 AM [ Reassigned from Kartautsau, Pavel to Yarotski, Aliaksei ]
Aliaksei Yarotski 1/30/2007, 8:39 AM [ Reassigned from Yarotski, Aliaksei to Bhoopalam, Kailash ]
Matt Rajkowski 4/16/2007, 9:24 AM The solution that was decided in the emails between Matt and Aliaksie is to "move the executeCommand after the freeing of the database connection" in the listed methods.

However, the code added new executeCommand methods with database connection parameters which complicates the maintenance. I'm going to skip merging this code for now.
Distribution List

There are no recipients