response time

Hi everyone, I have an application which often does heavy database operations. My problem is: suppose I have two concurrent sessions (1st and 2nd), when I do a heavy query in the 1st session, the 2nd one will not respond to even the simplest UI operation (for example, open a dropdown menu) until the query in the 1st one is finished.

Is this normal? How can I resolve this?

Thank you

It is important to distinguish between actually having two sessions - for example, the same page open on two different computers, or at least in two different browsers on the same computer - and having two windows/tabs open in the same browser and thus in the same session.

In the first case, starting a long-running DB query in one window should not block other users in other sessions. If this happens, there’s probably some locking done on a shared resource outside Vaadin.

In the second case, yes, all requests to the same session are synchronized with a lock, and running any lengthy operation while the session is locked will block other requests until the request is done and the lock released. As such, you should structure your application to avoid keeping the lock for very long. This usually means delegating long-running operations to a background thread.

Hi Johannes, makes sense. Mine was the second case. When I tested by using different browsers, it wasn’t blocked any more. Thank you very much for your quick response!