Re: [mdr-users] MDR and Swing
Jaroslav Drazan <[email protected]> Tue, 20 Sep 2005 13:02:53 +0200 (CEST)
| Newsgroups | gmane.comp.java.netbeans.modules.mdr.user |
|---|---|
| Message-ID | <[email protected]> |
Hi Dimitrios, the possible problem can be MDR transactions - if you start a transaction from some threadXXX, you cannot access the repository from another thread (if you do so, the another thread waits until the threadXXX does not finish the transaction). We had the similar problem - we started a transaction from the main thread and when we accessed the repository frm the AWT-thread - the application freezed. The possible solution in our case were to access the repository from just one thread or not to use MDR transaction. We have used Eclipse and swing as well and everything (after solving the problem mentioned above) works fine. Regards Jarda > Hi Martin, > > Thanks for your reply. Yes, the application freezes forever. I have > looked into it and managed to get somehow deeper into the problem. I > believe it has to do with threads and it is not limited to Swing only. > > For example when I populate a RefPackage (e.g. refPackage) in the main > method of my (Swing) program and try to access it on a button click > event - AbstractAction.perform() -, since the perform() function is run > by the dispatcher in a different thread, I get no response (the code > freezes at the statement I try to access e.g. refPackage.refAllClasses() > and the statement does not return!). However, if I populate refPackage > inside the perform() method (so that it is in the same thread with the > accessing code), everything works fine. Any ideas? > > Cheers, > Dimitrios > > Martin Matula wrote: > > > Hi Dimitrios, > > what kind of freezing do you mean? Does your application freeze forever? > > Martin > > > > Dimitrios Kolovos wrote: > > > >> I am working on a small utility that displays and MDR model in a > >> JTree. In generally I face a lot of execution "freezing" issues and I > >> often have to call SwingUtilities.invokeLater() to prevent execution > >> from freezing where MDR is involved. Does anyone else have similar > >> (bad) experience (and hopefully come up with a solution) with MDR and > >> JTree (or Swing in general)? > >> > >> Cheers, > >> Dimitrios > >> > >> P.S. I use Eclipse for Java development in case that makes a difference. > > > > > > > > > > >