openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "C N Davies" <...@cndavies.com>
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. 


Chris





-----Original Message-----
From: gilbertoca [mailto:gilbertoca@gmail.com] 
Sent: Saturday, 15 May 2010 12:48 AM
To: users@openjpa.apache.org
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,

Gilberto

-- 
View this message in context:
http://openjpa.208410.n2.nabble.com/InvalidStateException-tp210537p5051257.h
tml
Sent from the OpenJPA Users mailing list archive at Nabble.com.


Mime
View raw message