i have this nice RCP app that has different views. These views refresh their content when the EntityManager connects/disconnets from the database. Now when more then one of theses views are active and the EM connects/diconnects i get a thread access exception. So i assume EM is not thread safe. What are best practises to solve this issue ? In other words: how do i use Eclipselinks EM in a multithreaded RCP application where different views might want to access the EM at the same time.
I use Eclipselink in a multiview Swing application and have adopted the approach where an EM is bound to a window. So you can have multiple instances of the same entity in memory, one for each window. Writing a change in one window to the database and then doing the same in another will result in a version conflict.
On 14-2-2011 09:43, Gregor Anders wrote:
> Hi,
>
> i have this nice RCP app that has different views. These views refresh their content when the EntityManager connects/disconnets from the database. Now when more then one of theses views are active and the EM connects/diconnects i get a thread access exception. So i assume EM is not thread safe. What are best practises to solve this issue ? In other words: how do i use Eclipselinks EM in a multithreaded RCP application where different views might want to access the EM at the same time.
> Thx in advance
> Greg