We registred a listener which implement ExecutionCleanup and ExecutionInit. Our implementation is similar to OpenEntityManagerInViewListener, but it start and stop UnitOfWork instance from Guice library.
Next we had 2 zul scripts:
When a.zul was executed, ExecutionInit.init was called twice but ExecutionCleanup.cleanup only once for eg:
My problem is similar to OpenEntityManagerInViewListener https://github.com/zkoss/zk/blob/master/zkplus/src/org/zkoss/zkplus/jpa/OpenEntityManagerInViewListener.java#L46, where EntityManager is closed only if parent is null.