I get a NullPointerException from EcoreUtil.getAdapter() while using SDO in a multi-threaded application. Whats the problem?
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.