@Test public void testForkable() throws Exception { Command command = helpGetCommand("SELECT intkey FROM bqt1.smalla", EXAMPLE_BQT); AtomicRequestMessage arm = createNewAtomicRequestMessage(1, 1); TransactionContext tc = new TransactionContext(); tc.setTransactionType(Scope.REQUEST); tc.setIsolationLevel(Connection.TRANSACTION_READ_COMMITTED); arm.setTransactionContext(tc); arm.setCommand(command); final FakeConnector c = new FakeConnector() { public boolean supportsMultipleOpenExecutions() { return false; } }; ConnectorManager cm = new ConnectorManager("FakeConnector","FakeConnector") { public ExecutionFactory getExecutionFactory() { return c; } public Object getConnectionFactory(){ return c; } }; cm.start(); ConnectorWorkItem cwi = new ConnectorWorkItem(arm, cm); assertTrue(cwi.isForkable()); arm.getCommandContext().setReadOnly(false); cwi = new ConnectorWorkItem(arm, cm); assertFalse(cwi.isForkable()); }
@Override public boolean isForkable() { return this.connector.isForkable() && (!this.requestMsg.isTransactional() || this.connector.getTransactionSupport() == TransactionSupport.NONE || (this.requestMsg.getCommandContext().isReadOnly() && this.requestMsg.getTransactionContext().getTransactionType() == org.teiid.dqp.service.TransactionContext.Scope.REQUEST)); }
ConnectorWorkItem implements ConnectorWork { @Override public boolean isForkable() { return this.connector.isForkable() && (!this.requestMsg.isTransactional() || this.connector.getTransactionSupport() == TransactionSupport.NONE || (this.requestMsg.getCommandContext().isReadOnly() && this.requestMsg.getTransactionContext().getTransactionType() == org.teiid.dqp.service.TransactionContext.Scope.REQUEST)); } }
ConnectorWorkItem implements ConnectorWork { @Override public boolean isForkable() { return this.connector.isForkable() && (!this.requestMsg.isTransactional() || this.connector.getTransactionSupport() == TransactionSupport.NONE || (this.requestMsg.getCommandContext().isReadOnly() && this.requestMsg.getTransactionContext().getTransactionType() == org.teiid.dqp.service.TransactionContext.Scope.REQUEST)); } ConnectorWorkItem(AtomicRequestMessage message, ConnectorManager manager); }
ConnectorWorkItem implements ConnectorWork { @Override public boolean isForkable() { return this.connector.isForkable() && (!this.requestMsg.isTransactional() || this.connector.getTransactionSupport() == TransactionSupport.NONE || (this.requestMsg.getCommandContext().isReadOnly() && this.requestMsg.getTransactionContext().getTransactionType() == org.teiid.dqp.service.TransactionContext.Scope.REQUEST)); } ConnectorWorkItem(AtomicRequestMessage message, ConnectorManager manager); static void initLanguageBridgeFactory(LanguageBridgeFactory factory,
            CommandContext context, SourceCapabilities capabilities); @Override AtomicRequestID getId(); @Override void cancel(boolean abnormal); synchronized AtomicResultsMessage more(); synchronized void close(); synchronized void execute(); static AtomicResultsMessage createResultsMessage(List<?>[] batch); @Override String toString(); @Override boolean isDataAvailable(); @Override CacheDirective getCacheDirective(); @Override boolean isForkable(); @Override boolean isThreadBound(); @Override int hashCode(); @Override boolean equals(Object obj); void logCommand(Object... command); void setTracingSpan(Span span); Span getTracingSpan(); }
ConnectorWorkItem implements ConnectorWork { @Override public boolean isForkable() { return this.connector.isForkable() && (!this.requestMsg.isTransactional() || this.connector.getTransactionSupport() == TransactionSupport.NONE || (this.requestMsg.getCommandContext().isReadOnly() && this.requestMsg.getTransactionContext().getTransactionType() == org.teiid.dqp.service.TransactionContext.Scope.REQUEST)); } ConnectorWorkItem(AtomicRequestMessage message, ConnectorManager manager); static void initLanguageBridgeFactory(LanguageBridgeFactory factory,
            CommandContext context, SourceCapabilities capabilities); @Override AtomicRequestID getId(); @Override void cancel(boolean abnormal); synchronized AtomicResultsMessage more(); synchronized void close(); synchronized void execute(); static AtomicResultsMessage createResultsMessage(List<?>[] batch); @Override String toString(); @Override boolean isDataAvailable(); @Override CacheDirective getCacheDirective(); @Override boolean isForkable(); @Override boolean isThreadBound(); @Override int hashCode(); @Override boolean equals(Object obj); void logCommand(Object... command); void setTracingSpan(Span span); Span getTracingSpan();  }