AtomicResultsMessage exceptionOccurred(TranslatorException exception) throws TeiidComponentException, TeiidProcessingException { if(workItem.requestMsg.supportsPartialResults()) { AtomicResultsMessage emptyResults = new AtomicResultsMessage(new List[0]); emptyResults.setWarnings(Arrays.asList((Exception)exception)); emptyResults.setFinalRow(this.rowsProcessed); return emptyResults; } fullyCloseSource(); if (exception.getCause() instanceof TeiidComponentException) { throw (TeiidComponentException)exception.getCause(); } if (exception.getCause() instanceof TeiidProcessingException) { throw (TeiidProcessingException)exception.getCause(); } throw new TeiidProcessingException(QueryPlugin.Event.TEIID30504, exception, this.getConnectorName() + ": " + exception.getMessage()); //$NON-NLS-1$ }
AtomicResultsMessage exceptionOccurred(TranslatorException exception) throws TeiidComponentException, TeiidProcessingException { if(workItem.requestMsg.supportsPartialResults()) { AtomicResultsMessage emptyResults = new AtomicResultsMessage(new List[0]); emptyResults.setWarnings(Arrays.asList((Exception)exception)); emptyResults.setFinalRow(this.rowsProcessed); return emptyResults; } fullyCloseSource(); if (exception.getCause() instanceof TeiidComponentException) { throw (TeiidComponentException)exception.getCause(); } if (exception.getCause() instanceof TeiidProcessingException) { throw (TeiidProcessingException)exception.getCause(); } throw new TeiidProcessingException(QueryPlugin.Event.TEIID30504, exception, this.getConnectorName() + ": " + exception.getMessage()); //$NON-NLS-1$ }
AtomicResultsMessage exceptionOccurred(TranslatorException exception) throws TeiidComponentException, TeiidProcessingException { if(workItem.requestMsg.supportsPartialResults()) { AtomicResultsMessage emptyResults = new AtomicResultsMessage(new List[0]); emptyResults.setWarnings(Arrays.asList((Exception)exception)); emptyResults.setFinalRow(this.rowsProcessed); return emptyResults; } fullyCloseSource(); if (exception.getCause() instanceof TeiidComponentException) { throw (TeiidComponentException)exception.getCause(); } if (exception.getCause() instanceof TeiidProcessingException) { throw (TeiidProcessingException)exception.getCause(); } throw new TeiidProcessingException(QueryPlugin.Event.TEIID30504, exception, this.getConnectorName() + ": " + exception.getMessage()); //$NON-NLS-1$ }
@Test public void testProcedureBatching() throws Exception { ProcedureExecution exec = new FakeProcedureExecution(2, 1); // this has two result set columns and 1 out parameter int total_columns = 3; StoredProcedure command = (StoredProcedure)helpGetCommand("{call pm2.spTest8(?)}", EXAMPLE_BQT); //$NON-NLS-1$ command.getInputParameters().get(0).setExpression(new Constant(1)); Call proc = new LanguageBridgeFactory(EXAMPLE_BQT).translate(command); ProcedureBatchHandler pbh = new ProcedureBatchHandler(proc, exec); assertEquals(total_columns, pbh.padRow(Arrays.asList(null, null)).size()); List params = pbh.getParameterRow(); assertEquals(total_columns, params.size()); // check the parameter value assertEquals(Integer.valueOf(0), params.get(2)); try { pbh.padRow(Arrays.asList(1)); fail("Expected exception from resultset mismatch"); //$NON-NLS-1$ } catch (TranslatorException err) { assertEquals( "TEIID30479 Could not process stored procedure results for EXEC spTest8(1). Expected 2 result set columns, but was 1. Please update your models to allow for stored procedure results batching.", err.getMessage()); //$NON-NLS-1$ } }
addColumn(column, t, mf, metadata); } catch (TranslatorException e) { log(report, model, e.getMessage());
addColumn(column, t, mf, metadata); } catch (TranslatorException e) { log(report, model, e.getMessage());
addColumn(Symbol.getShortName(column), column.getType(), t, mf); } catch (TranslatorException e) { log(report, model, e.getMessage());
cd = work.getCacheDirective(); } catch (TranslatorException e) { throw new TeiidProcessingException(QueryPlugin.Event.TEIID30504, e, aqr.getConnectorName() + ": " + e.getMessage()); //$NON-NLS-1$
cd = work.getCacheDirective(); } catch (TranslatorException e) { throw new TeiidProcessingException(QueryPlugin.Event.TEIID30504, e, aqr.getConnectorName() + ": " + e.getMessage()); //$NON-NLS-1$
cd = work.getCacheDirective(); } catch (TranslatorException e) { throw new TeiidProcessingException(QueryPlugin.Event.TEIID30504, e, aqr.getConnectorName() + ": " + e.getMessage()); //$NON-NLS-1$