On Fri, Sep 25, 2015 at 11:16 AM, Darshana Gunawardana <[email protected]>
wrote:

> Hi Indunil,
>
> On Fri, Sep 25, 2015 at 10:15 AM, Indunil Upeksha Rathnayake <
> [email protected]> wrote:
>
>> Hi,
>>
>> The deadlock issue(https://wso2.org/jira/browse/MB-1326) come up in
>> oracle and mssql when clearResourceAuthorizations where permissions are
>> deleted in UM_ROLE_PERMISSIONS, UM_USER_PERMISSIONS and UM_PERMISSION
>> tables through one transaction. The fix would be using cascade delete for
>> above tables.
>>
>
> +1
>
>
>> But I think another issue(foreign key constraint violation) may come up
>> when addAuthorizationForRole, as following example scenario. Ex: Node1 may
>> be retrieve the permission entry in UM_PERMISSION table (in
>> addAuthorizationForRole()) and just after that node2 may delete the entry
>> (in clearResourceAuthorizations()) and after that when node1 trying to
>> delete & add permissions in UM_ROLE_PERMISSIONS (in
>> addAuthorizationForRole()) will return the above exception since the entry
>> in UM_PERMISSION is already deleted.
>>
> I think the fix need to be, if UM_ROLE_PERMISSIONS and UM_PERMISSION
>> tables are going to update, first have to lock both tables, until all the
>> required operations are finished. Then meanwhile another node can't delete
>> any entries.
>>
>
> Have you able to reproduce this behavior? I guess we cannot lock those
> tables from the java code in db in dependent manner. Please check with our
> db experts.
>
> In worst case we could handle IntegrityConstraintViolationException since
> its ok to avoiding addAuthorization for a permission which got deleted
> later.
>

Yes, lets not go into locking tables. As much as possible try to avoid it
or recover gracefully.

>
> Thanks,
>
>
>> Please provide your opinions regarding this.
>>
>> Thanks and Regards
>> --
>> Indunil Upeksha Rathnayake
>> Software Engineer | WSO2 Inc
>> Email    [email protected]
>>
>
>
>
> --
> Regards,
>
>
> *Darshana Gunawardana*Senior Software Engineer
> WSO2 Inc.; http://wso2.com
>
> *E-mail: [email protected] <[email protected]>*
> *Mobile: +94718566859 <%2B94718566859>*Lean . Enterprise . Middleware
>



-- 
Thanks & Regards,

*Johann Dilantha Nallathamby*
Technical Lead & Product Lead of WSO2 Identity Server
Governance Technologies Team
WSO2, Inc.
lean.enterprise.middleware

Mobile - *+94777776950*
Blog - *http://nallaa.wordpress.com <http://nallaa.wordpress.com>*
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to