AnsweredAssumed Answered

How to avoid deadlocks (possibly) created by a script task of a workflow

Question asked by mtsiak on Nov 7, 2018

Hi all.

 

In a workflow, a document is attached (package items) in order to be destributed accross users and groups.

For this reason, a script task gives read permittions to selected users and/or groups.

document.setPermission("SiteConsumer", a_userName_or_groupname);

While users use this workflow, we have been noticing various deadlock errors:

for tables like alf_node, alf_acl_member

### Error updating database.  Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLTransactionRollbackException: Lock wait timeout exceeded; try restarting transaction
### The error may involve alfresco.permissions.insert.insert_AclMember-Inline
### The error occurred while setting parameters
### SQL: insert into alf_acl_member             (version, acl_id, ace_id, pos)         values             (?, ?, ?, ?)
### Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLTransactionRollbackException: Lock wait timeout exceeded; try restarting transaction
; SQL []; Lock wait timeout exceeded; try restarting transaction; nested exception is com.mysql.jdbc.exceptions.jdbc4.MySQLTransactionRollbackException: Lock wait timeout exceeded; try restarting transaction

How could we avoid these deadlocks?

 

Thank you in advance.

Outcomes