Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » RCP and concurrency(RCP and concurrency)
RCP and concurrency [message #654106] Mon, 14 February 2011 03:43 Go to next message
Gregor Anders is currently offline Gregor Anders
Messages: 2
Registered: February 2011
Junior Member
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
Re: RCP and concurrency [message #654132 is a reply to message #654106] Mon, 14 February 2011 04:58 Go to previous message
Tom Eugelink is currently offline Tom Eugelink
Messages: 807
Registered: July 2009
Senior Member
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
Previous Topic:Eager OneToOne relationship not using JOIN
Next Topic:FetchGroup and column alias
Goto Forum:
  


Current Time: Fri Aug 22 13:51:09 EDT 2014

Powered by FUDForum. Page generated in 0.01590 seconds