Probably silly error using FreeFormQuery and SQLContainer, but help needed

I’ve been using SQLCOntainer and FreeFormQuery without any problems, until recently.

I’m using it in five different ways in a dashboard application. All appear to work fine, until the client spotted an error in one usage area.

I’ve got a series of Surveys and I’m pulling the remarks out. These are in a remarks table in MySQL.

For some reason that I can’t fathom, it is only pulling out the first 25 entries. There are some 431 other records that meet the selection critieria.

The code for the data bind is as follows:


...
         String sqlRemarks = "SELECT section AS Section, heading as Heading, guest AS Guest, room AS 'Room No', checkedout AS 'Checked Out', remarks AS Remarks FROM remarks WHERE surveyID=" + sid + " AND date_format(datestamp, '%Y-%m-%d') >='" + from + "' AND date_format(datestamp, '%Y-%m-%d') <='" + to + "' ORDER BY guest, room, heading, section" ;

         FreeformQuery remarksQuery = new FreeformQuery(sqlRemarks, dbPool) ;
         SQLContainer remarksContainer = new SQLContainer(remarksQuery) ;
         
         remarksTable.setContainerDataSource(remarksContainer) ;         
...

I’ve got other use cases of FreeformQuery which returns more than 25 items yet in this case, it fails to do so.

Is this because here are large text items and this fills up the refresh buffer?

I’ve tried setting the Page size to zero, but that does not work either.

I’m using Vaadin 6.7.8.

Any suggestions welcome.
Regards,
Anthony

Some further information, I’ve added some validation code:


         FreeformQuery remarksQuery = new FreeformQuery(sqlRemarks, dbPool) ;
         SQLContainer remarksContainer = new SQLContainer(remarksQuery) ;
         remarksContainer.setPageLength(10) ;

         remarksTable.setContainerDataSource(remarksContainer) ;         
         
         System.out.println ( "Total Remarks returned: " + remarksQuery.getCount() + " | Table size: " + remarksTable.size()) ;

and I now get this console output:

The only thing I can think of is that I have a style name set for the table, since I need to wrap long lines in the remarks.

Something is turning lazy loading off.

Any suggestions?

Really horrible klduge / workaround:

remarksTable.setPageLength (remarksQuery.getCount()) ;

This is seriously not pretty. However, I cannot figure out what settings I’m using that are affecting this. I have other tables using FreefomQuery that have more than 25 rows which work fine.

Sigh. Any sugestions welcome.

Thanks in advance.
Anthony

What does remarksContainer.size() return?

This looks very strange in any case - it is normal that the Table only asks for data for the items that will be visible and a few more as a buffer for scrolling, but its size() should definitely return the size of the full dataset.

Try to put a breakpoint in SQLContainer.updateCount() and see what happens there. Then dig deeper based on what you see.