Problem with filtering a very large select object

I have a JPAContainer which loads a set of objects from my database. At the moment, that list has over 400k elements. Eventually, I will get smart about loading the data, but that isn’t the problem here. Right now, I’m attempting to put that list of objects into a select object, and let the user choose an entry.
This works remarkably well - the data loads quickly, and the user can page through easily - but with 400000 entries, that’s a lot of paging. I was hoping to be able to let the user start typing in the select box, and have the list of objects filtered down to something manageable. But as soon as I type a character, the program throws an exception, and I get a red error box on the screen which says:

Internal error

Please notify the administrator.
Take note of any unsaved data, and click here to continue.

Clicking the link does nothing - I have to reload the application at this point.

My select object is created like this:

            jc_RRD_Record = crrd.jcGetAllRrdRecord();              // loads 400k records from the database
	sel_RRD.setContainerDataSource(jc_RRD_Record);
	sel_RRD.setItemCaptionMode(Select.ITEM_CAPTION_MODE_PROPERTY);
	sel_RRD.setItemCaptionPropertyId("rrdPath");

	sel_RRD.setFilteringMode(AbstractSelect.Filtering.FILTERINGMODE_CONTAINS);   // Tried with and without this line...

	sel_RRD.setImmediate(true);
	sel_RRD.setWidth("500px");

Clearly I don’t understand how filtering is supposed to work with select objects. Can someone point me to an example or give me a hint as to how to fix this?

The tomcat log file shows the following - which actually leads to a second question - what do I need to do to NOT call indexOfId() on the large data set? I’m not calling it directly… The warning appears to be generated when I click on the selector. This is NOT related to the exception that gets thrown when I try typing into the select box.

Thanks in advance for any help you can give me

nbc

========= tomcat log =========
(JPAContainer) WARNING! Invoking indexOfId() when size > 100 is not recommended!
(JPAContainer) WARNING! Invoking indexOfId() when size > 100 is not recommended!
(JPAContainer) WARNING! Invoking indexOfId() when size > 100 is not recommended!
(JPAContainer) WARNING! Invoking indexOfId() when size > 100 is not recommended!

Jun 17, 2011 3:03:31 PM com.vaadin.Application terminalError
SEVERE: Terminal error:
java.lang.AbstractMethodError: com.vaadin.addon.jpacontainer.JPAContainer.addContainerFilter(Lcom/vaadin/data/Container$Filter;)V
at com.vaadin.ui.Select.getOptionsWithFilter(Select.java:336)
at com.vaadin.ui.Select.paintContent(Select.java:212)
at com.vaadin.ui.AbstractComponent.paint(AbstractComponent.java:755)
at com.vaadin.terminal.gwt.server.AbstractCommunicationManager.writeUidlResponce(AbstractCommunicationManager.java:952)
at com.vaadin.terminal.gwt.server.AbstractCommunicationManager.paintAfterVariableChanges(AbstractCommunicationManager.java:839)
at com.vaadin.terminal.gwt.server.AbstractCommunicationManager.doHandleUidlRequest(AbstractCommunicationManager.java:765)
at com.vaadin.terminal.gwt.server.CommunicationManager.handleUidlRequest(CommunicationManager.java:296)
at com.vaadin.terminal.gwt.server.AbstractApplicationServlet.service(AbstractApplicationServlet.java:501)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:849)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:454)
at java.lang.Thread.run(Thread.java:662)

Have you found an answer to this? This is a pretty serious problem.

Digging through the code shows this:


https://gist.github.com/cbmeeks/6e9130f799c81b3a47d9

Calling their own implementation “ugly”.

No - I never found a good solution… I have been able to break my lists down into some smaller tables that allow me to search for specific subsets fairly quickly - but managing the entire list never worked as well as I would like…

nbc