I am using Echo 2 (an ajax based framework) with hibernate and I am facing a lot of issues. Let me explain it in few points :
1. My application has lots of insert / update , sometime bulk data.
2. I am using session per application pattern as I want to use Lazy loading. We have multiple tabs opens and user can
switch in between. Also we have huge collections relationship so we want to use lazy loading.
3. Session per application pattern eats up lot of memory as the first level cache keeps on growing.
4. As we are dealing with huge collections , so we are using HQL updates for those bulk update, hibernate doesn't
recognize this and hence I have to evict all objects from L1 cache after saving.
5.Keeping session open for too long is not a good idea. We have load balancing with application deployed on three
separate jvm. L1 cache doesn't updated if the same object is modified from other jvm. (I guess we can only sync L2 cache).
Please suggest me the best way to use hibernate with desktop like web application (GWT, echo 2 etc).