Hi,
for my backend I have a server, a middleware and my vaadin application. The connection between them is implemented with RMI.
Now when my Vaadin application has to fetch some data I have implemented a Thread that calls (static) the Data Retriever function from the middleware. Now the middleware has to do some work like retrieving Data from the Server or from a different SQL Database.
But in my Vaadin application I have the problem that my Thread finishes but the UI is still blocked for some seconds because of the call of the data retriever function.
This is how my thread looks like. The output of “Thread started” and “Thread finished” is displayed after a few ms. But the UI is still blocked for 4-5 seconds (the blue loading bar on top appears). If i dont call the getMyData function the UI isn´t blocked.
Any idea how I can get the thread to retrieve my data without blocking the UI?
class MyThread extends Thread {
@Override
public void run() {
System.out.println("Thread started");
MyData myData = DataRetriever.getMyData();
System.out.println("Thread finished");
}
}