openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "C N Davies" <>
Subject RE: InvalidStateException
Date Fri, 14 May 2010 14:57:41 GMT
I keep is simple by implementing an EntityService and let it handle the
errors and such, so I can standardise error handling, persisting or merging
decisions etc.  Then I just have a private static instance of the factory so
it gets shared application wide. Also for perfomance purposes I keep a cach
of entity managers so I don't have to continually instantiate new ones
because of the performance hit of doing so. 


-----Original Message-----
From: gilbertoca [] 
Sent: Saturday, 15 May 2010 12:48 AM
Subject: RE: InvalidStateException

Thanks Chris, now I see the problem.
So my approach is not correct!
Should it be:

EntityManagerFactory --  ServletContext[by a filter or listener]
EntityManager            --  page [by request or session]

Can anyone point me the right direction on the ServletContext[by a filter or
listener] implementation example?

Thanks again,


View this message in context:
Sent from the OpenJPA Users mailing list archive at

View raw message