title: weblogic service response is being cached
body: <p>I'm using a service that get users, groups and users by group from weblogic. I got this code from internet, but sincerly i don't understand it very well.
  Now, the services that return the groups is working fine (no caching), but when i try to load users or users by group only works fine the first request. If i restart my grails server always work the first time. </p>
  
  <p>This method get the groups(works fine)</p>
  
  <pre><code>def  getListOfGroups() {
          def connectorFactory = connect(serviceAccount, servicePassword)
  
          def connection = connectorFactory.getMBeanServerConnection()
  
          Object defaultAuthenticator = getWeblogicAuthenticator(connection, authenticator)
  
          def allGroups = []
          def objectArray = new Object[2]
          def stringArray = new String[2]
  
  
  
          objectArray[0] = "*"
          objectArray[1] = Integer.valueOf(9999)
  
          stringArray[0] = "java.lang.String"
          stringArray[1] = "java.lang.Integer"
  
  
          String cursor = (String) connection.invoke(defaultAuthenticator, "listGroups", objectArray, stringArray);
  
  
          def cursorArray = new Object[1]
          cursorArray[0] = cursor
          def stringCursorArray = new String[1]
          stringCursorArray[0] = "java.lang.String"
  
          boolean haveCurrent =
                  ((Boolean) connection.invoke(defaultAuthenticator,
                          "haveCurrent",
                          cursorArray,
                          stringCursorArray)).booleanValue();
  
          while (haveCurrent) {
              String currentName =
                      (String) connection.invoke(defaultAuthenticator,
                              "getCurrentName",
                              cursorArray,
                              stringCursorArray);
  
              allGroups.add(currentName);
  
              connection.invoke(defaultAuthenticator,
                      "advance",
                      cursorArray,
                      stringCursorArray);
  
              haveCurrent =
                      ((Boolean) connection.invoke(defaultAuthenticator,
                              "haveCurrent",
                              cursorArray,
                              stringCursorArray)).booleanValue();
  
          }
  
          ArrayList&lt;HashMap&lt;String,String&gt;&gt; arrayGrupos = new ArrayList&lt;&gt;()
  
          allGroups.each {
              HashMap&lt;String,String&gt; mapItem = new  HashMap&lt;String,String&gt;()
              mapItem.put("value",it)
              arrayGrupos.add(mapItem)
          }
  
  
          return allGroups;
      }
  </code></pre>
  
  <p>And this is the method that get the users(is caching):</p>
  
  <pre><code>def getUsers() {
  
          if (!users) {
  
              def connectorFactory = connect(serviceAccount, servicePassword)
  
              def connection = connectorFactory.getMBeanServerConnection()
  
              Object defaultAuthenticator = getWeblogicAuthenticator(connection, authenticator)
  
              def allUsers = []
  
              def objectArray = new Object[3]
              def stringArray = new String[3]
  
              objectArray[0] = papyrusCaseGroup
              objectArray[1] = "*"
              objectArray[2] = Integer.valueOf(9999)
  
              stringArray[0] = "java.lang.String"
              stringArray[1] = "java.lang.String"
              stringArray[2] = "java.lang.Integer"
  
                  String cursor = (String) connection.invoke(defaultAuthenticator, "listGroupMembers", objectArray, stringArray);
  
              def cursorArray = new Object[1]
              cursorArray[0] = cursor
              def stringCursorArray = new String[1]
              stringCursorArray[0] = "java.lang.String"
  
              boolean haveCurrent =
                      ((Boolean) connection.invoke(defaultAuthenticator,
                              "haveCurrent",
                              cursorArray,
                              stringCursorArray)).booleanValue();
  
              while (haveCurrent) {
                  String currentName =
                          (String) connection.invoke(defaultAuthenticator,
                                  "getCurrentName",
                                  cursorArray,
                                  stringCursorArray);
  
                  allUsers.add(currentName);
                  connection.invoke(defaultAuthenticator,
                          "advance",
                          cursorArray,
                          stringCursorArray);
  
                  haveCurrent =
                          ((Boolean) connection.invoke(defaultAuthenticator,
                                  "haveCurrent",
                                  cursorArray,
                                  stringCursorArray)).booleanValue();
  
              }
  
              ArrayList&lt;HashMap&lt;String,String&gt;&gt; arrayUsers = new ArrayList&lt;&gt;()
  
              allUsers.each {
                  HashMap&lt;String,String&gt; mapItem = new  HashMap&lt;String,String&gt;()
                  mapItem.put("value",it)
                  arrayUsers.add(mapItem)
              }
  
              users = arrayUsers
              return users
          }
          else
              return users
          //return allUsers;
      }
  </code></pre>
  
  <p>So, what should i do to avoid this service response be cached?
  Thanks in advance!!!</p>