@Override public void addDatatype(MetadataTransactionContext ctx, Datatype datatype) throws AlgebricksException { try { metadataNode.addDatatype(ctx.getTxnId(), datatype); } catch (RemoteException e) { throw new MetadataException(ErrorCode.REMOTE_EXCEPTION_WHEN_CALLING_METADATA_NODE, e); } try { ctx.addDatatype( metadataNode.getDatatype(ctx.getTxnId(), datatype.getDataverseName(), datatype.getDatatypeName())); } catch (RemoteException e) { throw new MetadataException(ErrorCode.REMOTE_EXCEPTION_WHEN_CALLING_METADATA_NODE, e); } }