Description of problem:
Using the keyboard (Alt+J/K), it is possible to move quickly between text flows. Each movement triggers a TM search, but the server (or the event bus) has trouble keeping up with the searches and their results.
Version-Release number of selected component (if applicable):
Very easy, especially on slower connections.
Steps to Reproduce:
1. Press Alt+K many times in a row to move down 20 rows or so
2. Watch the TM area
Even after navigation has stopped, the TM panel keeps updating to show TM results for different rows of the table for some time. In some cases, it stops before showing the last TM result.
If it can't keep up, the TM should jump straight to the last results.
We should avoid having the client generate so many TM requests when navigating quickly, but the server should also be able to skip over obsolete TM requests, and jump straight to the last one.
Modified the client so that it waits for TM results before submitting any more TM requests.
While working on this bug, I found that the query in TextFlowDAO.getIdsByTargetState was not taking into account obsolete HProject/Iterations. Fixing this bug made the query even slower, so I had to do some performance tuning on the server as well.
I enabled Hibernate's second-level cache for entities, and the query cache, also implemented a time-based cache for TextFlowFilter for use with Hibernate Search.
VERIFIED in Zanata version 1.5.0-alpha-3-SNAPSHOT (20120227-1458)