<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: RepositoryServiceSoapBindingStub.fetchMore() method in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/repositoryservicesoapbindingstub-fetchmore-method/m-p/77364#M51162</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Still digging…&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I found that the &lt;/SPAN&gt;&lt;STRONG&gt;batchSize&lt;/STRONG&gt;&lt;SPAN&gt; is actually set by &lt;/SPAN&gt;&lt;STRONG&gt;RepositoryWebService.query&lt;/STRONG&gt;&lt;SPAN&gt; by calling &lt;/SPAN&gt;&lt;STRONG&gt;Utils.getBatchSize&lt;/STRONG&gt;&lt;SPAN&gt;.&amp;nbsp; According to the JavaDoc, that method reads the fetchSize from the QueryConfiguration soap header.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Time to figure out how to send the fetchSize in the QueryConfiguration soap header.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 10 Dec 2007 22:48:46 GMT</pubDate>
    <dc:creator>gblomqui</dc:creator>
    <dc:date>2007-12-10T22:48:46Z</dc:date>
    <item>
      <title>RepositoryServiceSoapBindingStub.fetchMore() method</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/repositoryservicesoapbindingstub-fetchmore-method/m-p/77362#M51160</link>
      <description>I would like to programmatically grab results from a lucene query in chunks, and furthermore would like to be able to make sure that I can grab all search results.&amp;nbsp; That is, if there are 2950 results and I want to retrieve them in batches of 100, I want to be able to make 30 successive calls to retr</description>
      <pubDate>Wed, 07 Mar 2007 17:23:02 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/repositoryservicesoapbindingstub-fetchmore-method/m-p/77362#M51160</guid>
      <dc:creator>pitt1</dc:creator>
      <dc:date>2007-03-07T17:23:02Z</dc:date>
    </item>
    <item>
      <title>Re: RepositoryServiceSoapBindingStub.fetchMore() method</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/repositoryservicesoapbindingstub-fetchmore-method/m-p/77363#M51161</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I'm very surprised that no one has responded to this post.&amp;nbsp; I have also noticed this issue.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I attached a debugger to a locally running Alfresco server (2.0 running on JBoss) and managed to track down what I think is going on.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;RepositoryWebService.query&lt;/STRONG&gt;&lt;SPAN&gt; delegates to&amp;nbsp; &lt;/SPAN&gt;&lt;STRONG&gt;QuerySession.getNextResultsBatch&lt;/STRONG&gt;&lt;SPAN&gt; to get the first batch of results based on the given query.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The &lt;/SPAN&gt;&lt;STRONG&gt;ResultSetQuerySession.getNextResultsBatch&lt;/STRONG&gt;&lt;SPAN&gt; (the ResultSet implementation of the &lt;/SPAN&gt;&lt;STRONG&gt;QuerySession&lt;/STRONG&gt;&lt;SPAN&gt; interface) method does all the work of assembling the query result set.&amp;nbsp; After it's done building the query result set, it calls &lt;/SPAN&gt;&lt;STRONG&gt;AbstractQuerySession.updatePosition&lt;/STRONG&gt;&lt;SPAN&gt;.&amp;nbsp; The &lt;/SPAN&gt;&lt;STRONG&gt;updatePosition&lt;/STRONG&gt;&lt;SPAN&gt; method sets the &lt;/SPAN&gt;&lt;STRONG&gt;position&lt;/STRONG&gt;&lt;SPAN&gt; instance variable based on the &lt;/SPAN&gt;&lt;STRONG&gt;batchSize&lt;/STRONG&gt;&lt;SPAN&gt; instance variable.&amp;nbsp; However, the &lt;/SPAN&gt;&lt;STRONG&gt;ResultSetQuerySession.getNextResultsBatch&lt;/STRONG&gt;&lt;SPAN&gt; method never sets the &lt;/SPAN&gt;&lt;STRONG&gt;batchSize&lt;/STRONG&gt;&lt;SPAN&gt; instance variable, so &lt;/SPAN&gt;&lt;STRONG&gt;position&lt;/STRONG&gt;&lt;SPAN&gt; is set to -1.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Later, when you call &lt;/SPAN&gt;&lt;STRONG&gt;RepositoryWebService.fetchMore&lt;/STRONG&gt;&lt;SPAN&gt;, it too delegates to &lt;/SPAN&gt;&lt;STRONG&gt;QuerySession.getNextResultsBatch&lt;/STRONG&gt;&lt;SPAN&gt; to get the next batch of results based on the established query.&amp;nbsp; The &lt;/SPAN&gt;&lt;STRONG&gt;ResultSetQuerySession.getNextResultsBatch&lt;/STRONG&gt;&lt;SPAN&gt; method compares &lt;/SPAN&gt;&lt;STRONG&gt;position&lt;/STRONG&gt;&lt;SPAN&gt; to -1 and returns &lt;/SPAN&gt;&lt;STRONG&gt;null&lt;/STRONG&gt;&lt;SPAN&gt; because it believes there is no more data to read.&amp;nbsp; The &lt;/SPAN&gt;&lt;STRONG&gt;RepositoryWebService.fetchMore&lt;/STRONG&gt;&lt;SPAN&gt; method does not handle a &lt;/SPAN&gt;&lt;STRONG&gt;null&lt;/STRONG&gt;&lt;SPAN&gt; return value from &lt;/SPAN&gt;&lt;STRONG&gt;QuerySession.getNextResultsBatch&lt;/STRONG&gt;&lt;SPAN&gt;, thus you get your esoteric error.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I haven't dug into the code enough to determine how easy it is to fix this.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I also have not determined if upgrading to 2.1 fixes this problem.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I also don't know if it's simply something I'm doing wrong that's causing the &lt;/SPAN&gt;&lt;STRONG&gt;batchSize&lt;/STRONG&gt;&lt;SPAN&gt; instance variable to not be set.&amp;nbsp; I can't immediately tell that this is the problem.&amp;nbsp; But, it could easily be.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Dec 2007 22:19:21 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/repositoryservicesoapbindingstub-fetchmore-method/m-p/77363#M51161</guid>
      <dc:creator>gblomqui</dc:creator>
      <dc:date>2007-12-10T22:19:21Z</dc:date>
    </item>
    <item>
      <title>Re: RepositoryServiceSoapBindingStub.fetchMore() method</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/repositoryservicesoapbindingstub-fetchmore-method/m-p/77364#M51162</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Still digging…&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I found that the &lt;/SPAN&gt;&lt;STRONG&gt;batchSize&lt;/STRONG&gt;&lt;SPAN&gt; is actually set by &lt;/SPAN&gt;&lt;STRONG&gt;RepositoryWebService.query&lt;/STRONG&gt;&lt;SPAN&gt; by calling &lt;/SPAN&gt;&lt;STRONG&gt;Utils.getBatchSize&lt;/STRONG&gt;&lt;SPAN&gt;.&amp;nbsp; According to the JavaDoc, that method reads the fetchSize from the QueryConfiguration soap header.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Time to figure out how to send the fetchSize in the QueryConfiguration soap header.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Dec 2007 22:48:46 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/repositoryservicesoapbindingstub-fetchmore-method/m-p/77364#M51162</guid>
      <dc:creator>gblomqui</dc:creator>
      <dc:date>2007-12-10T22:48:46Z</dc:date>
    </item>
    <item>
      <title>Re: RepositoryServiceSoapBindingStub.fetchMore() method</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/repositoryservicesoapbindingstub-fetchmore-method/m-p/77365#M51163</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;There's actually a good example of how to set the "fetchSize" in the QueryHeader in one of the repository service tests.&amp;nbsp; Here's what I've got based on that test:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;String sQuery = "TYPE:\"" + Constants.TYPE_CONTENT + "\"";&lt;BR /&gt;&lt;BR /&gt;// set the batch size in the query header&lt;BR /&gt;int batchSize = 10;&lt;BR /&gt;QueryConfiguration queryCfg = new QueryConfiguration();&lt;BR /&gt;queryCfg.setFetchSize(batchSize);&lt;BR /&gt;RepositoryServiceSoapBindingStub repositoryService = WebServiceFactory.getRepositoryService();&lt;BR /&gt;repositoryService.setHeader(new RepositoryServiceLocator().getServiceName().getNamespaceURI(), "QueryHeader", queryCfg);&lt;BR /&gt;&lt;BR /&gt;//&amp;nbsp; get the first batch of results&lt;BR /&gt;QueryResult result = repositoryService.query(STORE, getQuery(sQuery), true);&lt;BR /&gt;//process the first query result&lt;BR /&gt;String querySession = result.getQuerySession();&lt;BR /&gt;while (querySession != null) {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; //&amp;nbsp; get the next batch of results&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; result = repositoryService.fetchMore(querySession);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // process subsequent query results&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; querySession = result.getQuerySession();&lt;BR /&gt;}&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Dec 2007 03:23:41 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/repositoryservicesoapbindingstub-fetchmore-method/m-p/77365#M51163</guid>
      <dc:creator>gblomqui</dc:creator>
      <dc:date>2007-12-11T03:23:41Z</dc:date>
    </item>
    <item>
      <title>Re: RepositoryServiceSoapBindingStub.fetchMore() method</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/repositoryservicesoapbindingstub-fetchmore-method/m-p/77366#M51164</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I had problems too with fetchMore. Setting the fetchSize solved the problem.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Apparrently the default batchSize of 1000 in org.alfresco.repo.webservice.Utils is not used since QueryConfigHandler.ALF_FETCH_SIZE is always present (as New Integer(0)). Resulting in a nullpointerexception in RepositoryWebService.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Can somebody verify this? So using fetchMore without setting the fetchSize results in an error. Enable this line in log4j.properties : log4j.logger.org.alfresco.repo.webservice=debug&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Apr 2008 15:37:43 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/repositoryservicesoapbindingstub-fetchmore-method/m-p/77366#M51164</guid>
      <dc:creator>kdejaeger</dc:creator>
      <dc:date>2008-04-16T15:37:43Z</dc:date>
    </item>
  </channel>
</rss>

