ranger-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ab...@apache.org
Subject [2/2] 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 Thu, 27 Sep 2018 01:53:01 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/dddcf015
Tree: http://git-wip-us.apache.org/repos/asf/ranger/tree/dddcf015
Diff: http://git-wip-us.apache.org/repos/asf/ranger/diff/dddcf015

Branch: refs/heads/ranger-0.7
Commit: dddcf0155f63c35a347755c41e7063ccef93d308
Parents: 320169a
Author: Abhay Kulkarni <akulkarni@hortonworks.com>
Authored: Tue Aug 14 10:49:34 2018 -0700
Committer: Abhay Kulkarni <akulkarni@hortonworks.com>
Committed: Wed Sep 26 18:38:30 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/dddcf015/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 e867cf4..7d1e15b 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
@@ -126,6 +126,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/dddcf015/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 26d8d37..27856ae 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
@@ -261,7 +261,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