[ 
https://issues.apache.org/jira/browse/SENTRY-1512?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15617030#comment-15617030
 ] 

Alexander Kolbasov commented on SENTRY-1512:
--------------------------------------------

[~colinma] While reviewing the port I noticed a problem with the original code. 
It only affects tests, not the core behavior.

In DelegateSentryStore.getPrivilegesByProvider() you call 

{code}
if (groups != null) {
              trimmedRoles.addAll(delegate.getRoleNamesForGroups(groups));
            }
{code}

But delegate.getRoleNamesForGroups(groups)) is executed inside its own 
transaction manager which is wrong.
This should be fixed (and there may be other cases as well). Also I think that 
we can add assert in the transaction manager which will trigger an exception 
when current transaction is active.

> Refactor the database transaction management
> --------------------------------------------
>
>                 Key: SENTRY-1512
>                 URL: https://issues.apache.org/jira/browse/SENTRY-1512
>             Project: Sentry
>          Issue Type: Improvement
>            Reporter: Colin Ma
>            Assignee: Colin Ma
>         Attachments: SENTRY-1512.001.patch
>
>
> The update for SENTRY-1422 refactor the database transaction management, this 
> also should be ported to master.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to