java.sql.SQLException

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • It seems that when an exception of any sort is thrown out of a *non-transactional* DAO call, the Oracle DB connection can get left in a strange limbo state. Thus, the next *transactional* code to use the same DB connection will see the following exception: org.springframework.transaction.CannotCreateTransactionException: Could not open JDBC Connection for transaction; nested exception is java.sql.SQLException: ORA-01453: SET TRANSACTION must be first statement of transaction java.sql.SQLException: ORA-01453: SET TRANSACTION must be first statement of transaction at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112) at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:331) at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:288) at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:743) at oracle.jdbc.driver.T4CStatement.doOall8(T4CStatement.java:207) at oracle.jdbc.driver.T4CStatement.executeForRows(T4CStatement.java:946) at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1168) at oracle.jdbc.driver.OracleStatement.executeInternal(OracleStatement.java:1687) at oracle.jdbc.driver.OracleStatement.execute(OracleStatement.java:1653) at oracle.jdbc.driver.PhysicalConnection.setTransactionIsolation(PhysicalConnection.java:1600) at oracle.jdbc.OracleConnectionWrapper.setTransactionIsolation(OracleConnectionWrapper.java:162) at org.springframework.jdbc.datasource.DataSourceUtils.prepareConnectionForTransaction(DataSourceUtils.java:173) at org.springframework.jdbc.datasource.DataSourceTransactionManager.doBegin(DataSourceTransactionManager.java:192) at org.springframework.transaction.support.AbstractPlatformTransactionManager.getTransaction(AbstractPlatformTransactionManager.java:283) at org.springframework.transaction.interceptor.TransactionAspectSupport.createTransactionIfNecessary(TransactionAspectSupport.java:226) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:89) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:170) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:176) at $Proxy29.qqDemonstrateSetTransactionBugStep2(Unknown Source) at com.py.controller.SETTRANSACTIONTestController.handleRequestInternal(SETTRANSACTIONTestController.java:22) ...snipped. The issues is further debated in the Spring forums, with another user able to recreate the issue: http://forum.springframework.org/showthread.php?t=25423 Presumably on the non-transactional call, some code is calling Oracle with "SET TRANSACTION ..." to setup some transactional info, but is never resetting that transaction. Perhaps the transaction is being left as neither committed or rolled back, so when the next DAO call comes along to start a real transaction Oracle barfs. Note that it is a documented oddity of the Oracle JDBC driver that it explicitly does not reset transactional state on connections when they are returned to the pool. This means that the next user of the connection stumbles over the half-baked transaction. Presumably Spring should either not be doing anything transactional in the first place when making the non-transactional call, or it should correctly clean up after itself when the exception is thrown, leaving the DB connection in a proper state? Once a DB connection has been broken in this way, it stays broken until I restart Tomcat, hence this can totally bring a website to its knees.
    via by Sam Carr,
  • It seems that when an exception of any sort is thrown out of a *non-transactional* DAO call, the Oracle DB connection can get left in a strange limbo state. Thus, the next *transactional* code to use the same DB connection will see the following exception: org.springframework.transaction.CannotCreateTransactionException: Could not open JDBC Connection for transaction; nested exception is java.sql.SQLException: ORA-01453: SET TRANSACTION must be first statement of transaction java.sql.SQLException: ORA-01453: SET TRANSACTION must be first statement of transaction at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112) at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:331) at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:288) at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:743) at oracle.jdbc.driver.T4CStatement.doOall8(T4CStatement.java:207) at oracle.jdbc.driver.T4CStatement.executeForRows(T4CStatement.java:946) at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1168) at oracle.jdbc.driver.OracleStatement.executeInternal(OracleStatement.java:1687) at oracle.jdbc.driver.OracleStatement.execute(OracleStatement.java:1653) at oracle.jdbc.driver.PhysicalConnection.setTransactionIsolation(PhysicalConnection.java:1600) at oracle.jdbc.OracleConnectionWrapper.setTransactionIsolation(OracleConnectionWrapper.java:162) at org.springframework.jdbc.datasource.DataSourceUtils.prepareConnectionForTransaction(DataSourceUtils.java:173) at org.springframework.jdbc.datasource.DataSourceTransactionManager.doBegin(DataSourceTransactionManager.java:192) at org.springframework.transaction.support.AbstractPlatformTransactionManager.getTransaction(AbstractPlatformTransactionManager.java:283) at org.springframework.transaction.interceptor.TransactionAspectSupport.createTransactionIfNecessary(TransactionAspectSupport.java:226) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:89) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:170) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:176) at $Proxy29.qqDemonstrateSetTransactionBugStep2(Unknown Source) at com.py.controller.SETTRANSACTIONTestController.handleRequestInternal(SETTRANSACTIONTestController.java:22) ...snipped. The issues is further debated in the Spring forums, with another user able to recreate the issue: http://forum.springframework.org/showthread.php?t=25423 Presumably on the non-transactional call, some code is calling Oracle with "SET TRANSACTION ..." to setup some transactional info, but is never resetting that transaction. Perhaps the transaction is being left as neither committed or rolled back, so when the next DAO call comes along to start a real transaction Oracle barfs. Note that it is a documented oddity of the Oracle JDBC driver that it explicitly does not reset transactional state on connections when they are returned to the pool. This means that the next user of the connection stumbles over the half-baked transaction. Presumably Spring should either not be doing anything transactional in the first place when making the non-transactional call, or it should correctly clean up after itself when the exception is thrown, leaving the DB connection in a proper state? Once a DB connection has been broken in this way, it stays broken until I restart Tomcat, hence this can totally bring a website to its knees.
    via by Sam Carr,
  • Openbravo won't run.
    via openbravo by kchopein
    ,
  • amount field with decimals in hibernate
    via Stack Overflow by JNPW
    ,
  • Query bind parameter in Trees
    via by 475070,
  • SQLException : Missing defines in servlet
    via Stack Overflow by Shubham
    ,
    • java.sql.SQLException: ORA-01453: SET TRANSACTION must be first statement of transaction at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112) at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:331) at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:288) at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:743) at oracle.jdbc.driver.T4CStatement.doOall8(T4CStatement.java:207) at oracle.jdbc.driver.T4CStatement.executeForRows(T4CStatement.java:946) at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1168) at oracle.jdbc.driver.OracleStatement.executeInternal(OracleStatement.java:1687) at oracle.jdbc.driver.OracleStatement.execute(OracleStatement.java:1653) at oracle.jdbc.driver.PhysicalConnection.setTransactionIsolation(PhysicalConnection.java:1600) at oracle.jdbc.OracleConnectionWrapper.setTransactionIsolation(OracleConnectionWrapper.java:162) at org.springframework.jdbc.datasource.DataSourceUtils.prepareConnectionForTransaction(DataSourceUtils.java:173) at org.springframework.jdbc.datasource.DataSourceTransactionManager.doBegin(DataSourceTransactionManager.java:192) at org.springframework.transaction.support.AbstractPlatformTransactionManager.getTransaction(AbstractPlatformTransactionManager.java:283) at org.springframework.transaction.interceptor.TransactionAspectSupport.createTransactionIfNecessary(TransactionAspectSupport.java:226) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:89) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:170) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:176) at $Proxy29.qqDemonstrateSetTransactionBugStep2(Unknown Source) at com.py.controller.SETTRANSACTIONTestController.handleRequestInternal(SETTRANSACTIONTestController.java:22)

    Users with the same issue

    Unknown visitor
    Unknown visitor1 times, last one,
    Unknown visitor
    Unknown visitor1 times, last one,
    Unknown visitor
    Unknown visitor1 times, last one,
    Unknown visitor
    Unknown visitor1 times, last one,
    Unknown visitor
    Unknown visitor1 times, last one,
    78 more bugmates