[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.tools.emf] Re: [EMF Transaction] Notification list will not be safely modified

Hi, Ben,

I would certainly be open to the IllegalStateException in the case of notifications without a transaction context while another transaction is in progress on another thread. This is consistent with the case where there is no transaction at all.

By any chance, is the offending notification in your scenario one that is compatible with a read-only context, such as a proxy resolution? The reason I ask is that, currently, there is no assertion that these must occur in a transaction context of any kind because we don't have a mechanism to assert transactions in the general case of reading the model content.

Please, do open a bugzilla. We can explore further the options and their feasibility, there. I expect that *something* will need to be done.

Thanks,

Christian

Ben wrote:
Hi Christian,

Your analysis is correct. The TransactionUtils.writing method is as you suggested. We put in this workaround as an expedient solution, so you may have noticed the race condition after (activeTransaction != null) and before the notification gets recorded.

Another reasonable approach would be to throw an IllegalStateException (or perhaps a ConcurrentModificationException?) when a notification comes in while a transaction is in play. This would be similar to the way that the IllegalStateException is thrown if the someone tries to open a read-write transaction while in a read-transaction. What do you think? Also, please let me know if you want me to open a bugzilla for this?

Thanks!