Add JPA and testcase which demonstrates leak of flush/synchronization issue