Announcement Announcement Module
Collapse
No announcement yet.
Spring-Ibatis select Query failing throwing Error getting Connection from Transaction Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Spring-Ibatis select Query failing throwing Error getting Connection from Transaction

    Hi,

    I am using Spring and ibatis as DB mapping layer . i am facing one problem consistantly . my application is running in cluster environment . In Ibatis DAO in one of the method i am using querryForList(id,object) . This is working fine . this is used in a web application . the problem i am facing , my Ibatis select query is working fine when the request is executing in one of the server always . we have two different servers, it is configured with BigIP . but when my request is reaching other server, my Ibatis select query is always failing throwing below exception :

    Caused by: com.tgt.ecl.exception.TgtDataAccessException: com.ibatis.common.jdbc.exception.NestedSQLExceptio n: Error getting Connection from Transaction. Cause: com.ibatis.sqlmap.engine.transaction.TransactionEx ception: JtaTransaction could not start transaction. Cause:
    at com.tgt.ecl.dao.ibatis.TgtIbatisTemplateImpl.query ForList(TgtIbatisTemplateImpl.java:192)
    at com.myself.pt.dao.xxxDAO.getItemDetails(MyMediaDAO .java:51)
    ... 34 more
    Caused by: com.ibatis.common.jdbc.exception.NestedSQLExceptio n: Error getting Connection from Transaction. Cause: com.ibatis.sqlmap.engine.transaction.TransactionEx ception: JtaTransaction could not start transaction. Cause:
    at com.ibatis.sqlmap.engine.mapping.statement.General Statement.executeQueryForList(GeneralStatement.jav a:126)
    at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelega te.queryForList(SqlMapExecutorDelegate.java:615)
    at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelega te.queryForList(SqlMapExecutorDelegate.java:589)
    at com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.qu eryForList(SqlMapSessionImpl.java:118)
    at com.ibatis.sqlmap.engine.impl.SqlMapClientImpl.que ryForList(SqlMapClientImpl.java:95)
    at com.tgt.ecl.dao.ibatis.TgtIbatisTemplateImpl.query ForList(TgtIbatisTemplateImpl.java:190)
    ... 35 more
    Caused by: com.ibatis.sqlmap.engine.transaction.TransactionEx ception: JtaTransaction could not start transaction. Cause:
    at com.ibatis.sqlmap.engine.transaction.jta.JtaTransa ction.init(JtaTransaction.java:64)
    at com.ibatis.sqlmap.engine.transaction.jta.JtaTransa ction.getConnection(JtaTransaction.java:131)
    at com.ibatis.sqlmap.engine.mapping.statement.General Statement.executeQueryForList(GeneralStatement.jav a:123)
    ... 40 more
    Caused by: java.lang.NullPointerException
    at com.ibm.ejs.container.EJSContainer.processTxContex tChange(EJSContainer.java:2202)
    at com.ibm.ejs.container.UserTransactionWrapper.begin (UserTransactionWrapper.java:206)
    at com.ibatis.sqlmap.engine.transaction.jta.JtaTransa ction.init(JtaTransaction.java:61)
    ... 42 more



    Initially i thought it might be due to BigIp issue, i mean may be BigIP is not configured properly . but later on when i deployed the same code again with same existing BigiP configuration, what i find this time ibatis select query is working fine in both the servers .

    but i find after some days, the same issue comes back again .

    I IBATIS ,Spring configuration i am using JTA Transaction with Transaction Scope as "Prototype" .
    In DAO i am not using any implicit Transaction in Java Code like " startBatch() and executeBatch() methods.

    wanted to know, does any body have any ANS to my problem ? after reading though some articles on net i am thinking to add exlicit Transactions in Java code by adding above 2 methods , not sure it will able to fix the issue or not .

    Please reply me , if some body has an ans to my problems
Working...
X