]
Work on TEIID-5200 started by Steven Hawkins.
---------------------------------------------
INSERT INTO query fails in BEGIN ATOMIC block if data is obtained
from atomic procedure which catches some exception
--------------------------------------------------------------------------------------------------------------------
Key: TEIID-5200
URL:
https://issues.jboss.org/browse/TEIID-5200
Project: Teiid
Issue Type: Bug
Components: Query Engine
Affects Versions: 10.0.1
Environment: teiid-10.0.1 on WildFly Full 11.0.0.Final (WildFly Core
3.0.8.Final)
Reporter: dalex dalex
Assignee: Steven Hawkins
Priority: Blocker
Running the query:
{code:sql}
begin atomic
loop on (select s.a as a from (call procs.px1()) as s) as x
begin
insert into test_pg.batch_test (a) values (x.a);
end
end;
{code}
leads to the following error in stacktrace:
{code:noformat}
2018-01-04 16:58:34,494 WARN [org.teiid.PROCESSOR] (Worker3_QueryProcessorQueue75)
AIlKbjKNf5Ju TEIID30020 Processing exception for request AIlKbjKNf5Ju.28 'TEIID30504
test_pg: TEII
D11009 java.sql.SQLException: javax.resource.ResourceException: IJ000460: Error checking
for a transaction'. Originally TeiidProcessingException 'IJ000459: Transaction is
not active:
tx=Local transaction (delegate=TransactionImple < ac, BasicAction:
0:ffffac100003:3cbb95f1:5a4e46c6:b3 status: ActionStatus.ABORT_ONLY >, owner=Local
transaction context for provide
r JBoss JTA transaction provider)' TxConnectionManagerImpl.java:409. Enable more
detailed logging to see the entire stacktrace.
2018-01-04 16:58:39,134 WARN [org.teiid.CONNECTOR] (Worker3_QueryProcessorQueue76)
AIlKbjKNf5Ju Connector worker process failed for atomic-request=AIlKbjKNf5Ju.29.3.26:
org.teiid.tr
anslator.TranslatorException: TEIID11009 java.sql.SQLException:
javax.resource.ResourceException: IJ000460: Error checking for a transaction
at
org.teiid.translator.jdbc.JDBCExecutionFactory.getConnection(JDBCExecutionFactory.java:278)
at
org.teiid.translator.jdbc.JDBCExecutionFactory.getConnection(JDBCExecutionFactory.java:65)
at
org.teiid.translator.ExecutionFactory.getConnection(ExecutionFactory.java:201)
at
org.teiid.dqp.internal.datamgr.ConnectorWorkItem.execute(ConnectorWorkItem.java:322)
at sun.reflect.GeneratedMethodAccessor93.invoke(Unknown Source)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at
org.teiid.dqp.internal.datamgr.ConnectorManager$1.invoke(ConnectorManager.java:216)
at com.sun.proxy.$Proxy36.execute(Unknown Source)
at
org.teiid.dqp.internal.process.DataTierTupleSource.getResults(DataTierTupleSource.java:302)
at
org.teiid.dqp.internal.process.DataTierTupleSource.nextTuple(DataTierTupleSource.java:138)
at
org.teiid.query.processor.relational.AccessNode.nextBatchDirect(AccessNode.java:398)
at
org.teiid.query.processor.relational.RelationalNode.nextBatch(RelationalNode.java:277)
at
org.teiid.query.processor.relational.RelationalPlan.nextBatch(RelationalPlan.java:141)
at
org.teiid.query.processor.QueryProcessor.nextBatchDirect(QueryProcessor.java:148)
at org.teiid.query.processor.QueryProcessor.nextBatch(QueryProcessor.java:111)
at org.teiid.query.processor.BatchIterator.finalRow(BatchIterator.java:65)
at
org.teiid.common.buffer.AbstractTupleSource.getCurrentTuple(AbstractTupleSource.java:66)
at
org.teiid.query.processor.BatchIterator.getCurrentTuple(BatchIterator.java:80)
at
org.teiid.common.buffer.AbstractTupleSource.hasNext(AbstractTupleSource.java:88)
at
org.teiid.query.processor.proc.ProcedurePlan.executePlan(ProcedurePlan.java:611)
at
org.teiid.query.processor.proc.CreateCursorResultSetInstruction.process(CreateCursorResultSetInstruction.java:65)
at
org.teiid.query.processor.proc.ProcedurePlan.processProcedure(ProcedurePlan.java:388)
at
org.teiid.query.processor.proc.ProcedurePlan.nextBatchDirect(ProcedurePlan.java:297)
at
org.teiid.query.processor.proc.ProcedurePlan.nextBatch(ProcedurePlan.java:269)
at
org.teiid.query.processor.QueryProcessor.nextBatchDirect(QueryProcessor.java:148)
at org.teiid.query.processor.QueryProcessor.nextBatch(QueryProcessor.java:111)
at
org.teiid.query.processor.BatchCollector.collectTuples(BatchCollector.java:160)
at
org.teiid.query.processor.BatchCollector.collectTuples(BatchCollector.java:142)
at
org.teiid.dqp.internal.process.RequestWorkItem.processMore(RequestWorkItem.java:480)
at
org.teiid.dqp.internal.process.RequestWorkItem.process(RequestWorkItem.java:350)
at org.teiid.dqp.internal.process.AbstractWorkItem.run(AbstractWorkItem.java:47)
at org.teiid.dqp.internal.process.RequestWorkItem.run(RequestWorkItem.java:276)
at
org.teiid.dqp.internal.process.DQPWorkContext.runInContext(DQPWorkContext.java:280)
at
org.teiid.dqp.internal.process.ThreadReuseExecutor$RunnableWrapper.run(ThreadReuseExecutor.java:115)
at
org.teiid.dqp.internal.process.ThreadReuseExecutor$3.run(ThreadReuseExecutor.java:206)
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.sql.SQLException: javax.resource.ResourceException: IJ000460: Error
checking for a transaction
at
org.jboss.jca.adapters.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:146)
at
org.jboss.as.connector.subsystems.datasources.WildFlyDataSource.getConnection(WildFlyDataSource.java:64)
at
org.teiid.translator.jdbc.JDBCExecutionFactory.getConnection(JDBCExecutionFactory.java:274)
... 38 more
Caused by: javax.resource.ResourceException: IJ000460: Error checking for a transaction
at
org.jboss.jca.core.connectionmanager.tx.TxConnectionManagerImpl.getManagedConnection(TxConnectionManagerImpl.java:425)
at
org.jboss.jca.core.connectionmanager.AbstractConnectionManager.allocateConnection(AbstractConnectionManager.java:789)
at
org.jboss.jca.adapters.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:138)
... 40 more
Caused by: javax.resource.ResourceException: IJ000459: Transaction is not active:
tx=Local transaction (delegate=TransactionImple < ac, BasicAction:
0:ffffac100003:3cbb95f1:5a4e46c6:
b6 status: ActionStatus.ABORT_ONLY >, owner=Local transaction context for provider
JBoss JTA transaction provider)
at
org.jboss.jca.core.connectionmanager.tx.TxConnectionManagerImpl.getManagedConnection(TxConnectionManagerImpl.java:409)
... 42 more
2018-01-04 16:58:39,137 WARN [org.teiid.PROCESSOR] (Worker3_QueryProcessorQueue76)
AIlKbjKNf5Ju TEIID30020 Processing exception for request AIlKbjKNf5Ju.29 'TEIID30504
test_pg: TEII
D11009 java.sql.SQLException: javax.resource.ResourceException: IJ000460: Error checking
for a transaction'. Originally TeiidProcessingException 'IJ000459: Transaction is
not active:
tx=Local transaction (delegate=TransactionImple < ac, BasicAction:
0:ffffac100003:3cbb95f1:5a4e46c6:b6 status: ActionStatus.ABORT_ONLY >, owner=Local
transaction context for provide
r JBoss JTA transaction provider)' TxConnectionManagerImpl.java:409. Enable more
detailed logging to see the entire stacktrace.
{code}