fix REAUTH bug when session expire exception was throwned
authordrizea <danielrizea27@gmail.com>
Mon, 23 Jul 2012 07:16:54 +0000 (10:16 +0300)
committerdrizea <danielrizea27@gmail.com>
Mon, 23 Jul 2012 07:16:54 +0000 (10:16 +0300)
Open-ILS/src/Android/src/org/evergreen/android/accountAccess/AccountAccess.java
Open-ILS/src/Android/src/org/evergreen/android/accountAccess/checkout/ItemsCheckOutListView.java
Open-ILS/src/Android/src/org/evergreen/android/globals/Utils.java

index a9f27ba..7fbf4f9 100644 (file)
@@ -640,7 +640,9 @@ public class AccountAccess {
                //fields of interest : expire_time
                List<OSRFObject> listHoldsAhr = null;
 
-               listHoldsAhr = (List<OSRFObject>) Utils.doRequest(conn, SERVICE_CIRC, METHOD_FETCH_HOLDS, authToken, cm, new Object[]{authToken,userID});
+               Object resp =  Utils.doRequest(conn, SERVICE_CIRC, METHOD_FETCH_HOLDS, authToken, cm, new Object[]{authToken,userID});
+               
+               listHoldsAhr = (List<OSRFObject>) resp;
                
                for(int i=0;i<listHoldsAhr.size();i++){
                        //create hold item
@@ -655,7 +657,6 @@ public class AccountAccess {
                }
                return holds;
        }
-       
        /* hold target type :
         *  M - metarecord
         *  T - record
index 778f989..1acd68a 100644 (file)
@@ -71,6 +71,9 @@ public class ItemsCheckOutListView extends Activity{
                                }catch (SessionNotFoundException e) {
                                        //TODO other way?
                                        try{
+                                               
+                                               Log.d(TAG, "REAUTH " + "in process" );
+                                               
                                                if(accountAccess.authenticate())
                                                        circRecords = accountAccess.getItemsCheckedOut();
                                        }catch(Exception eauth){
index 751e4c3..3e514f8 100644 (file)
@@ -255,18 +255,21 @@ public class Utils {
                        System.out.println("Sync Response: " + resp);
                        Object response = (Object) resp;
                        
-                               try{
-                                       String textcode = ((Map<String,String>)response).get("textcode");
-                                       if(textcode != null){
-                                               if(textcode.equals("NO_SESSION")){
-                                                       System.out.println("REQUIRE NEW SESSION");
-                                                       throw new SessionNotFoundException();
-                                               }
-                                               
-                                       }
-                               }catch(Exception e){
-                                       System.err.println("Exception in retreive" + e.getMessage());
+                       String textcode = null;
+                       try{
+                               textcode = ((Map<String,String>)response).get("textcode");
+                       }catch(Exception e){
+                               System.err.println("Exception in retreive" + e.getMessage());
+                       }
+                               
+                       if(textcode != null){
+                               if(textcode.equals("NO_SESSION")){
+                                       //System.out.println("REQUIRE NEW SESSION");
+                                               throw new SessionNotFoundException();
+                       }
+                                       
                                }
+                               
                                return response;
                        
                }