Optimize hsql transaction