ranger-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ab...@apache.org
Subject ranger git commit: RANGER-2165: Address JPA Cache issue when policies Create, Update and Delete are done via REST API in Apache Ranger admin
Date Tue, 14 Aug 2018 17:49:50 GMT
Repository: ranger
Updated Branches:
  refs/heads/master 466edce78 -> 6eac3dfc6


RANGER-2165: Address JPA Cache issue when policies Create, Update and Delete are done via
REST API in Apache Ranger admin


Project: http://git-wip-us.apache.org/repos/asf/ranger/repo
Commit: http://git-wip-us.apache.org/repos/asf/ranger/commit/6eac3dfc
Tree: http://git-wip-us.apache.org/repos/asf/ranger/tree/6eac3dfc
Diff: http://git-wip-us.apache.org/repos/asf/ranger/diff/6eac3dfc

Branch: refs/heads/master
Commit: 6eac3dfc6bc72ae940cf846a941721e5e75ea812
Parents: 466edce
Author: Abhay Kulkarni <akulkarni@hortonworks.com>
Authored: Tue Aug 14 10:49:34 2018 -0700
Committer: Abhay Kulkarni <akulkarni@hortonworks.com>
Committed: Tue Aug 14 10:49:34 2018 -0700

----------------------------------------------------------------------
 .../main/java/org/apache/ranger/biz/RangerPolicyRetriever.java    | 1 +
 .../src/main/java/org/apache/ranger/biz/RangerTagDBRetriever.java | 3 ++-
 2 files changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ranger/blob/6eac3dfc/security-admin/src/main/java/org/apache/ranger/biz/RangerPolicyRetriever.java
----------------------------------------------------------------------
diff --git a/security-admin/src/main/java/org/apache/ranger/biz/RangerPolicyRetriever.java
b/security-admin/src/main/java/org/apache/ranger/biz/RangerPolicyRetriever.java
index 3e291d5..efbdfdf 100644
--- a/security-admin/src/main/java/org/apache/ranger/biz/RangerPolicyRetriever.java
+++ b/security-admin/src/main/java/org/apache/ranger/biz/RangerPolicyRetriever.java
@@ -130,6 +130,7 @@ public class RangerPolicyRetriever {
 		@Override
 		public void run() {
 			try {
+				txTemplate.setReadOnly(true);
 				policies = txTemplate.execute(new TransactionCallback<List<RangerPolicy>>()
{
 					@Override
 					public List<RangerPolicy> doInTransaction(TransactionStatus status) {

http://git-wip-us.apache.org/repos/asf/ranger/blob/6eac3dfc/security-admin/src/main/java/org/apache/ranger/biz/RangerTagDBRetriever.java
----------------------------------------------------------------------
diff --git a/security-admin/src/main/java/org/apache/ranger/biz/RangerTagDBRetriever.java
b/security-admin/src/main/java/org/apache/ranger/biz/RangerTagDBRetriever.java
index 789068f..e5e9572 100644
--- a/security-admin/src/main/java/org/apache/ranger/biz/RangerTagDBRetriever.java
+++ b/security-admin/src/main/java/org/apache/ranger/biz/RangerTagDBRetriever.java
@@ -263,7 +263,8 @@ public class RangerTagDBRetriever {
 		@Override
 		public void run() {
 			try {
-				 Boolean result = txTemplate.execute(new TransactionCallback<Boolean>() {
+				txTemplate.setReadOnly(true);
+				Boolean result = txTemplate.execute(new TransactionCallback<Boolean>() {
 					@Override
 					public Boolean doInTransaction(TransactionStatus status) {
 						boolean ret = initializeTagCache(xService);


Mime
View raw message