Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

I get a NullPointerException from EcoreUtil.getAdapter() while using SDO in a multi-threaded application. Whats the problem?

0
Posted

I get a NullPointerException from EcoreUtil.getAdapter() while using SDO in a multi-threaded application. Whats the problem?

0

This is a known limitation in EMF’s implementation of SDO, which makes SDO model elements adapters on the corresponding Ecore model elements, so as to be easily retrievable. The attachment of the adapters is not thread-safe. So, when SDOUtil.adaptType() or SDOUtil.adaptProperty() is called to obtain a Type or Property for a given EClass or EStructuralFeature, it can run into trouble trying to get an adapter from the non-thread-safe adapter list. This problem has not been fixed and probably won’t be. However, there is a workaround: you can pre-initialize the SDO metadata before the multi-threaded access begins.

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123