-
Bug
-
Resolution: Unresolved
-
Major
-
None
-
None
-
None
I am using teiid version 15.0.0. But sometimes what happen is, when i run the program exception is raised.
{{org.teiid.jdbc.TeiidSQLException: TEIID30538 java.lang.IllegalStateException: WFTXN0007: A transaction is already associated with the current thread
at org.teiid.jdbc.TeiidSQLException.create(TeiidSQLException.java:131)
at org.teiid.jdbc.TeiidSQLException.create(TeiidSQLException.java:67)
at org.teiid.jdbc.StatementImpl.postReceiveResults(StatementImpl.java:786)
at org.teiid.jdbc.StatementImpl.access$100(StatementImpl.java:62)
at org.teiid.jdbc.StatementImpl$2.onCompletion(StatementImpl.java:584)
at org.teiid.client.util.ResultsFuture.done(ResultsFuture.java:131)
at org.teiid.client.util.ResultsFuture.access$200(ResultsFuture.java:36)
at org.teiid.client.util.ResultsFuture$1.receiveResults(ResultsFuture.java:75)
at org.teiid.net.socket.SocketServerInstanceImpl.receivedMessage(SocketServerInstanceImpl.java:281)
at org.teiid.net.socket.SocketServerInstanceImpl.read(SocketServerInstanceImpl.java:333)
at org.teiid.net.socket.SocketServerInstanceImpl$RemoteInvocationHandler$1.get(SocketServerInstanceImpl.java:423)
at org.teiid.jdbc.StatementImpl.executeSql(StatementImpl.java:593)
at org.teiid.jdbc.PreparedStatementImpl.executeUpdate(PreparedStatementImpl.java:319)
at com.lgc.dsis.data.well.jdbc.DataAccessJDBC.insertInATable(DataAccessJDBC.java:185)
at com.lgc.dsis.data.well.jdbc.DataAccessJDBC.runCRUD(DataAccessJDBC.java:517)
at com.lgc.dsis.data.well.jdbc.DataAccessJDBC.main(DataAccessJDBC.java:593)
Caused by: org.teiid.client.xa.XATransactionException: TEIID30538 java.lang.IllegalStateException: WFTXN0007: A transaction is already associated with the current thread
at org.teiid.dqp.internal.process.TransactionServerImpl.resume(TransactionServerImpl.java:434)
at jdk.internal.reflect.GeneratedMethodAccessor173.invoke(Unknown Source)
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:566)
at org.teiid.logging.LogManager$LoggingProxy.invoke(LogManager.java:119)
at com.sun.proxy.$Proxy40.resume(Unknown Source)
at org.teiid.dqp.internal.process.RequestWorkItem.resume(RequestWorkItem.java:451)
at org.teiid.dqp.internal.process.RequestWorkItem.process(RequestWorkItem.java:357)
at org.teiid.dqp.internal.process.AbstractWorkItem.run(AbstractWorkItem.java:43)
at org.teiid.dqp.internal.process.RequestWorkItem.run(RequestWorkItem.java:284)
at org.teiid.dqp.internal.process.DQPWorkContext.runInContext(DQPWorkContext.java:283)
at org.teiid.dqp.internal.process.ThreadReuseExecutor$RunnableWrapper.run(ThreadReuseExecutor.java:124)
at org.teiid.dqp.internal.process.ThreadReuseExecutor$2.run(ThreadReuseExecutor.java:212)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.lang.Thread.run(Thread.java:834)
Caused by: java.lang.IllegalStateException: WFTXN0007: A transaction is already associated with the current thread
at org.wildfly.transaction.client.ContextTransactionManager.resume(ContextTransactionManager.java:155)
at org.wildfly.transaction.client.ContextTransactionManager.resume(ContextTransactionManager.java:150)
at org.teiid.dqp.internal.process.TransactionServerImpl.resume(TransactionServerImpl.java:432)
... 15 more}}
But this does not occur each time i run the program, this is randomly happening with me.
Code through which this issue is happening is as follows:
public static void main(String[] args) {
int counter = 10;
for(int index = 0; index < counter; index++)
private void runCRUD() {
Connection conn = null;
try
{ conn = initConnection(); setProjectQuery(conn); Long start = Instant.now().getEpochSecond(); insertTableA(conn); insertTableB(conn); insertTableC(conn); insertTableD(conn); Long end = Instant.now().getEpochSecond(); System.out.println("Total time in seconds: "+(end-start)); }catch (Exception e)
{ e.printStackTrace(); }finally
{ closeConnection(conn); }}
}
Any suggestion/recommendation to fix this, i tried with teiid version 9.0.1 and with version 15.0.0 as well.
Thanks