Functions time limit

Post here your questions about SFS2X. Here we discuss all server-side matters. For client API questions see the dedicated forums.

Moderators: Lapo, Bax

User avatar
joveem
Posts: 2
Joined: 26 Apr 2021, 08:33
Location: Rio de Janeiro - RJ - Brazil

Functions time limit

Postby joveem » 06 May 2021, 13:45

I am creating a BuddyList from a ResultSet (MySql query that returns a list of friends)

Image

Code: Select all

   @Override
   public BuddyList loadList(String ownerName) throws SFSBuddyListNotFoundException, IOException {

      CheckInited();
      BuddyList buddyList;

      // mysql query...
      
      ResultSet res = stmt.executeQuery();
      
      while (res != null && res.next()) {
      
            String buddyName = res.getString("nick");

            System.out.print("- " + res.getString("nick"));

            Buddy buddy = new SFSBuddy(buddyName);
            uddy.setParentBuddyList(buddyList);
            buddy.setBlocked(false);
            buddy.setIsTemp(false);

            buddyList.addBuddy(buddy);

            _current++;

         }
         
      } catch (SQLException e) {
         throw new SFSBuddyListNotFoundException(
               "!!! ERROR !!! BuddyStorage - loadList: " + ownerName + " - " + e);
      } catch (SFSBuddyListException e) {
         throw new SFSBuddyListNotFoundException(
               "!!! ERRO !!! BuddyStorage - loadList: " + ownerName + " - " + e);
      } finally {
         try {
            if (stmt != null)
               stmt.close();
            if (connection != null)
               connection.close();
         } catch (Exception e) {
            throw new SFSBuddyListNotFoundException(!!! ERRO !!! GrowBuddyStorage - loadList: " + ownerName + " - " + e);
         }
      }

      return buddyList;
         


Everything happens well when the list is less than 30 (approximately), but when that list has a larger number, nothing happens, the BuddyList is empty (note: even so, nicknames continue to be debugged in "System.out.print("- " + res.getString("nick"));" and no exception is captured in the "trys" ).

(The calls happen just right, all the nicknames are apparently ok)

Could it be some time limit in the execution of the function? If so, where do I change this time limit?
User avatar
Lapo
Site Admin
Posts: 21999
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Functions time limit

Postby Lapo » 06 May 2021, 16:36

Hi,
there isn't a time limit. You should probably debug a bit more and understand what is going on exactly, and what is the number of records after which the problem appears.

BuddyLists have size limits too, meaning that (based on your config) they can hold a certain number of items, but you should always at least find some buddies active. (and you can change the limit from the admin)

I don't have further help to offer for now as it's not very clear what might be happening.

Let us know.
Lapo
--
gotoAndPlay()
...addicted to flash games

Return to “SFS2X Questions”

Who is online

Users browsing this forum: No registered users and 48 guests