ranger-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From me...@apache.org
Subject [20/28] 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, 04 Sep 2018 12:58:30 GMT
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/6dcf1a90
Tree: http://git-wip-us.apache.org/repos/asf/ranger/tree/6dcf1a90
Diff: http://git-wip-us.apache.org/repos/asf/ranger/diff/6dcf1a90

Branch: refs/heads/ranger-1.1
Commit: 6dcf1a90c4df682d8a4c9ace07a5345760610405
Parents: e37ca0b
Author: Abhay Kulkarni <akulkarni@hortonworks.com>
Authored: Tue Aug 14 10:49:34 2018 -0700
Committer: Mehul Parikh <mehul@apache.org>
Committed: Tue Sep 4 11:42:23 2018 +0530

----------------------------------------------------------------------
 .../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/6dcf1a90/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/6dcf1a90/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