svn commit: r1075350 - /ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/ProtectViewWorker.java

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r1075350 - /ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/ProtectViewWorker.java

jleroux@apache.org
Author: jleroux
Date: Mon Feb 28 14:35:02 2011
New Revision: 1075350

URL: http://svn.apache.org/viewvc?rev=1075350&view=rev
Log:
I should have used cache in 1st place here. It's never too late...

Modified:
    ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/ProtectViewWorker.java

Modified: ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/ProtectViewWorker.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/ProtectViewWorker.java?rev=1075350&r1=1075349&r2=1075350&view=diff
==============================================================================
--- ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/ProtectViewWorker.java (original)
+++ ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/ProtectViewWorker.java Mon Feb 28 14:35:02 2011
@@ -65,14 +65,14 @@ public class ProtectViewWorker {
         if (userLogin != null) {
             String userLoginId = userLogin.getString("userLoginId");
             try {
-                List<GenericValue> protectedViews = delegator.findByAnd("UserLoginAndProtectedView",
+                List<GenericValue> protectedViews = delegator.findByAndCache("UserLoginAndProtectedView",
                         UtilMisc.toMap("userLoginId", userLoginId, "viewNameId", viewNameId));
                 // Any views to deal with ?
                 if (UtilValidate.isNotEmpty(protectedViews)) {
                     Long now = System.currentTimeMillis(); // we are not in a margin of some milliseconds
 
                     // Is this login/view couple already tarpitted ? (ie denied access to view for login for a period of time)
-                    List<GenericValue> tarpittedLoginViews = delegator.findByAnd("TarpittedLoginView",
+                    List<GenericValue> tarpittedLoginViews = delegator.findByAndCache("TarpittedLoginView",
                             UtilMisc.toMap("userLoginId", userLoginId, "viewNameId", viewNameId));
                     String  viewNameUserLoginId = viewNameId + userLoginId;
                     if (UtilValidate.isNotEmpty(tarpittedLoginViews)) {