• andy_c
  • NEWBIE
  • 0 Points
  • Member since 2005

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 4
    Questions
  • 6
    Replies

I have some standard query code based on best practice in the sample code. I had the batch size set very low at 50, and this code performs perfectly for queries that return small numbers of results e.g >100. However when excercised with a much larger set of data (~30000) an INVALID_QUERY_LOCATOR exception is raised after some 5-10 minutes.

I'm sure the API is built to deal with these sort of numbers and queries are being used which return these sorts of numbers of results.

The code is as follows:

    List ret = new ArrayList();
    try {
      QueryResult qr = binding.query(query);
      boolean done = qr.getSize() > 0 ? false : true;        
      while (!done) {
        for (int i=0; i          ret.add(qr.getRecords(i));
        }
        if (qr.isDone()) {
          done = true;
        } else {
          qr = binding.queryMore(qr.getQueryLocator());
        }
      }
    } catch (Exception e) {
      Application.logger.log(e);
    }

What am I doing wrong, how do I get the code to scale better? 

I would like to include some Salesforce.com merge fields e.g. {!Account_Name} in to a URL but cannot find out whether they are encoded (so spaces are catered for etc.). Can anyone help..?

Thanks
Retrieving Campaignmembers via a query and then attempting to get the contactId from the resulting Campaignmembers returns null.

I have a query that correctly returns 3 Campaignmembers but calling getContactId() against them returns null.

Is anyone succesfully using Campaignmember.getContactId()?
  • February 15, 2005
  • Like
  • 0

The following query gives me a Malformed Query exception with no further detail.

"select Email, FirstName, LastName, MailingCountry from Contact where LastModifiedDate > 2005-02-13T01:00:00 and Email != null"

I am developing on a Java 1.5 platform using Apache Axis 1.2RC2.

Anyone have any ideas what the problem may be?

  • February 14, 2005
  • Like
  • 0

I have some standard query code based on best practice in the sample code. I had the batch size set very low at 50, and this code performs perfectly for queries that return small numbers of results e.g >100. However when excercised with a much larger set of data (~30000) an INVALID_QUERY_LOCATOR exception is raised after some 5-10 minutes.

I'm sure the API is built to deal with these sort of numbers and queries are being used which return these sorts of numbers of results.

The code is as follows:

    List ret = new ArrayList();
    try {
      QueryResult qr = binding.query(query);
      boolean done = qr.getSize() > 0 ? false : true;        
      while (!done) {
        for (int i=0; i          ret.add(qr.getRecords(i));
        }
        if (qr.isDone()) {
          done = true;
        } else {
          qr = binding.queryMore(qr.getQueryLocator());
        }
      }
    } catch (Exception e) {
      Application.logger.log(e);
    }

What am I doing wrong, how do I get the code to scale better? 

I would like to include some Salesforce.com merge fields e.g. {!Account_Name} in to a URL but cannot find out whether they are encoded (so spaces are catered for etc.). Can anyone help..?

Thanks
Retrieving Campaignmembers via a query and then attempting to get the contactId from the resulting Campaignmembers returns null.

I have a query that correctly returns 3 Campaignmembers but calling getContactId() against them returns null.

Is anyone succesfully using Campaignmember.getContactId()?
  • February 15, 2005
  • Like
  • 0

The following query gives me a Malformed Query exception with no further detail.

"select Email, FirstName, LastName, MailingCountry from Contact where LastModifiedDate > 2005-02-13T01:00:00 and Email != null"

I am developing on a Java 1.5 platform using Apache Axis 1.2RC2.

Anyone have any ideas what the problem may be?

  • February 14, 2005
  • Like
  • 0