My Table Refresh Problem

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(
at com.vaadin.ui.Table.getVisibleCells(
at com.vaadin.ui.Table.paintContent(
at com.vaadin.ui.AbstractComponent.paint(
at com.vaadin.terminal.gwt.server.AbstractCommunicationManager.paintAfterVariableChanges(
at com.vaadin.terminal.gwt.server.AbstractCommunicationManager.doHandleUidlRequest(
at com.vaadin.terminal.gwt.server.CommunicationManager.handleUidlRequest(
at com.vaadin.terminal.gwt.server.AbstractApplicationServlet.service(
at javax.servlet.http.HttpServlet.service(
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
at org.apache.catalina.core.ApplicationFilterChain.doFilter(
at com.ultra_as.ib.web.common.view.filters.LoggingContextFilter.doFilter(
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
at org.apache.catalina.core.ApplicationFilterChain.doFilter(
at com.ultra_as.ib.web.common.view.filters.EncodingFilter.doFilter(
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
at org.apache.catalina.core.ApplicationFilterChain.doFilter(
at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
at org.apache.catalina.core.ApplicationFilterChain.doFilter(
at org.apache.catalina.core.StandardWrapperValve.invoke(
at org.apache.catalina.core.StandardContextValve.invoke(
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(
at org.apache.catalina.core.StandardHostValve.invoke(
at org.apache.catalina.valves.ErrorReportValve.invoke(
at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(
at org.apache.catalina.valves.AccessLogValve.invoke(
at org.apache.catalina.core.StandardEngineValve.invoke(
at org.apache.catalina.connector.CoyoteAdapter.service(
at org.apache.coyote.http11.Http11Processor.process(
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(

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.
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.