My Table Refresh Problem

Hi,
I am currently having problems with vaadin refreshing and drawing a table with the way i have created my classes.
My situation is that i have a table that is populated when the program is first run, then i have a progress indicatior sitting on the page that will poll the server every 10 seconds. The server in a background thread will get a new model and populate a new container then set the tables data source to look at this new container. however when the server is messing around with this container the vaadin component attempts to redraw the container and then i get this error:
at com.vaadin.ui.Table.refreshRenderedCells(Table.java:1543)
at com.vaadin.ui.Table.getVisibleCells(Table.java:2663)
at com.vaadin.ui.Table.paintContent(Table.java:2274)
at com.vaadin.ui.AbstractComponent.paint(AbstractComponent.java:754)
at com.vaadin.terminal.gwt.server.AbstractCommunicationManager.paintAfterVariableChanges(AbstractCommunicationManager.java:807)
at com.vaadin.terminal.gwt.server.AbstractCommunicationManager.doHandleUidlRequest(AbstractCommunicationManager.java:621)
at com.vaadin.terminal.gwt.server.CommunicationManager.handleUidlRequest(CommunicationManager.java:266)
at com.vaadin.terminal.gwt.server.AbstractApplicationServlet.service(AbstractApplicationServlet.java:476)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at com.ultra_as.ib.web.common.view.filters.LoggingContextFilter.doFilter(LoggingContextFilter.java:106)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at com.ultra_as.ib.web.common.view.filters.EncodingFilter.doFilter(EncodingFilter.java:106)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:182)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:524)
at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:562)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
at java.lang.Thread.run(Thread.java:595)
[/code]

now i have tried to fix this problem by syncronising table and container in my thread and in buy overriding the paintContent method. Also tried surrounding the overridden method in a try catch loop but i am still getting the error. I dont know much about how the refresh method works or is called so i am hoping that there is a fix.
Thanks
Damian Fox

How are you doing the synchronization?

Normally, all the UI access you do in a background thread (including access to the container) should be synchronized to the Application instance, and you should not need to touch painting code etc. as requests from the UI are automatically synchronized to that instance.

Well i have tried using the keyword syncronised on table and on the container before i have carried out any changes to the container. ok so what i should do instead on doing syncronised(table) should be syncronised(Application)?

Yes, you need the application instance that has the container and synchronize on that instance. You’ll probably need to give the instance to the background thread, for instance where you give the container instance to the thread. If you are refreshing multiple containers of different applications from a single thread, you could e.g. have a (weak) map from Application to Container.

A Container does not have a reference to an application and attempts to get the application indirectly at synchronization time should also be synchronized to the application instance, which would lead to a “chicken and egg” problem.

No i only have one thread updating one container. I have made the changes that you suggested il let you know how it goes.
Thanks for your time.