NHibernate (for .Net) has an interface called IMultiQuery which you can instantiate an implementation for using ISession.CreateMultiQuery(). A multi-query allows one to run multiple hql statements in a single batch. I can't seem to find an equivalent feature in Hibernate (for Java).
Multi-query would be perfect for the java application I'm working on right now. It has about 10 HQL select queries running inside a tight loop. Load testing shows that it's about 50% too slow (or said in another way, it takes twice as long as required). My analysis says that almost all of the time is spent on network latency between the app server and the database. I can definitely rewrite the code to avoid the tight loop, but that was the simplest design and it's already been QAed for correctness.
So, if I can somehow shoot off all 10 HQL queries in a single batch, that should give more than enough of a performance boost without resorting to more drastic and bug-prone measures. Is there any way to do that with Hibernate in Java?