Session handling fix in buildRelationship. addDependentElements required between commonElementsFactory.createElement() and commonRelationship.createElement(). Each of these must be contained within their own session within the buildRelationship function. Changed log statements to String.format for readability. Removed session handling within OpaqueExpression.createElement().