[Dev] Wat is the way to handle DB deadlock issues

2014-11-10 Thread Amila Maha Arachchi
Hi all, I have seen deadlock issues occurring during database transactions within our code. [1] is such a situation. What is the best way to handle such cases? Should we retry from the code where we invoked the authorisation manager in this case (i.e. AF code) or should the authorisation

Re: [Dev] Wat is the way to handle DB deadlock issues

2014-11-10 Thread Sumedha Rubasinghe
How frequent is this? does this come with a load or even on single execution? SQL in concern here is following? DELETE FROM UM_ROLE_PERMISSION WHERE UM_ROLE_NAME=? AND UM_PERMISSION_ID = (SELECT UM_ID FROM UM_PERMISSION WHERE UM_RESOURCE_ID = ? AND UM_ACTION = ? AND UM_TENANT_ID=?) AND

Re: [Dev] Wat is the way to handle DB deadlock issues

2014-11-10 Thread Amila Maha Arachchi
AFAIR, when this issue occurred, it was not under a load. This does not occur on all execution. This is an intermittent issue. But I am thinking of a way to code for failures and handle the situation. On Mon, Nov 10, 2014 at 5:03 PM, Sumedha Rubasinghe sume...@wso2.com wrote: How frequent is

Re: [Dev] Wat is the way to handle DB deadlock issues

2014-11-10 Thread Akalanka Pagoda Arachchi
Hi Amila, Agree with Senaka. Also note that as Sumedha's query suggests this might lock few more tables other than 'UM_ROLE_PERMISSION' table. So try to beak down this into several queries and pass the parameter via java. This is not efficient but might help you to debug the issue. Thanks,