But this is not true with your code. If you after the call close the EntityManager and call remove on ThreadLocal, you have several EntityManager for the same Thread
2014-11-07 10:50 GMT+01:00 Christian Schneider <ch...@die-schneider.net>: > Hi Giuseppe, > > I think the ThreadLocal is necessary. We want to make sure that calls on > the same thread always go to the same EntityManager. > > Christian > > On 07.11.2014 10:29, Giuseppe Gerla wrote: > >> Thanks Christian >> I think I understand. So before each transactional method (not only >> persist) you create an EntityManager and then you close it. >> I'm not sure that you can simplify the JTAEntityManagerHandler class. >> I think that the only change that we can do is to simplify the pool >> management removing the ThreadLocal and the using a simple resourcepool. >> If you want I can try to prepare an example on my trunk. >> >> >> >> > -- > Christian Schneider > http://www.liquid-reality.de > > Open Source Architect > http://www.talend.com > >