Out Of Sync Error when long request in production

Hi Vaadiners,

I am developing a portlet to manage the s3 files. When i try to copy or move large folders(1GB to 5GB) in the s3 cloud,I am getting Out of sync error.
Runnig a background thread to update the UI but it is not updating the UI after each file copied.
How to get possible reasons for this error
How to get rid of from this error.

My code:

ListObjectsRequest listObjectsRequest = new ListObjectsRequest()
        .withBucketName(bucketName)
        .withPrefix(folder);
        ObjectListing objectListing = s3.listObjects(listObjectsRequest);
    for (S3ObjectSummary objectSummary : objectListing.getObjectSummaries()) {
            String fileName = objectSummary.getKey().substring(reqFolder.length());
        TransferManager transfer = new TransferManager(s3);
        CopyObjectRequest copyRequest = new CopyObjectRequest(bucketName, objectSummery.getKey(), bucketName, parentDir + fileName);
        final Copy copy = transfer.copy(copyRequest);
        final Application application = this.getMainWindow().getApplication();
        new Thread(){
            @Override
            public void run(){
                try{
                    copy.waitForCompletion();
                    synchronized(application) {
                        //adding completed file to table
                        table.addItem(new Object[]{new Label(fileName),"Queue"},objectSummary);
                    }
                }catch(Exception e){
                    
                }
            }
        }.start();
}

Liferay 6.1
Vaadin 6.8

One thing is that the browser window is only updated when it does a request, so changing its state from a background thread doesn’t have any immediate effect. The normal practice in Vaadin 6 is to use polling, although there are also some server push solutions for that in Directory. See the
Book section on ProgressIndicator
for some example about that. You can also visually hide the ProgressIndicator to have polling. Or, you can use the Refresher add-on for Vaadin 6 to have polling.

Synchronizing on the application is probably a good idea to do there. I’m not aware if there’s some issues with background threads in the S3 cloud.

Thank you Marko,
Even i use PorgressIndicator it is not pushing requests to the server. I thnk TransferManger(API from Java sdk of S3) is blocking all requests when it is going on.