org.springframework.transaction.CannotCreateTransactionException

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.

  • Getting Caused by: {quote} org.springframework.transaction.CannotCreateTransactionException: Could not open JDBC Connection for transaction; nested exception is java.sql.SQLException: S QLSTATE=XJ045,SEVERITY=-1: (Server=localhost[1529],Thread[DRDAConnThread_24,5,gemfirexd.daemons]) Invalid or (currently) unsupported isolation level, '8', passed to Conn ection.setTransactionIsolation(). The currently supported values are java.sql.Connection.TRANSACTION_NONE, java.sql.Connection.TRANSACTION_READ_UNCOMMITTED, java.sql.Con nection.TRANSACTION_READ_COMMITTED and java.sql.Connection.TRANSACTION_REPEATABLE_READ. at org.springframework.jdbc.datasource.DataSourceTransactionManager.doBegin(DataSourceTransactionManager.java:242) at org.springframework.transaction.support.AbstractPlatformTransactionManager.getTransaction(AbstractPlatformTransactionManager.java:373) at org.springframework.transaction.interceptor.TransactionAspectSupport.createTransactionIfNecessary(TransactionAspectSupport.java:420) at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:257) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:95) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:207) at com.sun.proxy.$Proxy95.getLastJobExecution(Unknown Source) at org.springframework.batch.core.launch.support.SimpleJobLauncher.run(SimpleJobLauncher.java:98) {quote} when launching a simple batch job with GemXD configured as the database {quote} job create --name myjob --definition "filejdbc --resources=file:///home/mpollack/csv/*.csv --driverClassName=com.pivotal.gemfirexd.jdbc.ClientDriver --names=id,name,test --tableName=APP.mytable" job deploy --name myjob job launch --name myjob {quote} {quote} spring: datasource: url: jdbc:gemfirexd://localhost:1527/ username: admin password: admin driverClassName: com.pivotal.gemfirexd.jdbc.ClientDriver {quote}
    via by Mark Pollack,
  • Getting Caused by: {quote} org.springframework.transaction.CannotCreateTransactionException: Could not open JDBC Connection for transaction; nested exception is java.sql.SQLException: S QLSTATE=XJ045,SEVERITY=-1: (Server=localhost[1529],Thread[DRDAConnThread_24,5,gemfirexd.daemons]) Invalid or (currently) unsupported isolation level, '8', passed to Conn ection.setTransactionIsolation(). The currently supported values are java.sql.Connection.TRANSACTION_NONE, java.sql.Connection.TRANSACTION_READ_UNCOMMITTED, java.sql.Con nection.TRANSACTION_READ_COMMITTED and java.sql.Connection.TRANSACTION_REPEATABLE_READ. at org.springframework.jdbc.datasource.DataSourceTransactionManager.doBegin(DataSourceTransactionManager.java:242) at org.springframework.transaction.support.AbstractPlatformTransactionManager.getTransaction(AbstractPlatformTransactionManager.java:373) at org.springframework.transaction.interceptor.TransactionAspectSupport.createTransactionIfNecessary(TransactionAspectSupport.java:420) at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:257) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:95) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:207) at com.sun.proxy.$Proxy95.getLastJobExecution(Unknown Source) at org.springframework.batch.core.launch.support.SimpleJobLauncher.run(SimpleJobLauncher.java:98) {quote} when launching a simple batch job with GemXD configured as the database {quote} job create --name myjob --definition "filejdbc --resources=file:///home/mpollack/csv/*.csv --driverClassName=com.pivotal.gemfirexd.jdbc.ClientDriver --names=id,name,test --tableName=APP.mytable" job deploy --name myjob job launch --name myjob {quote} {quote} spring: datasource: url: jdbc:gemfirexd://localhost:1527/ username: admin password: admin driverClassName: com.pivotal.gemfirexd.jdbc.ClientDriver {quote}
    via by Mark Pollack,
  • Connecting to mysql database | Activiti Forums
    via by Unknown author,
  • I have a custom Datasource implementation that not throw any exception when there is no DB connection. I am using this Datasource implementation with JdbcTemplate.java utility and when there is no connection JdbcTemplate throwing a NullPointerExeption. see the stack trace: {code} java.lang.NullPointerException at org.springframework.jdbc.core.JdbcTemplate$SimplePreparedStatementCreator.createPreparedStatement(JdbcTemplate.java:1375) at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:580) at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:636) at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:665) at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:685) at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:693) {code} I think DataSourceUtils.getConnection() method should check the connection if it is null and then throw CannotGetJdbcConnectionException exception. So that appplication should check a meaningfull exception to take an action in this case. Similarly to above case when a transactional operation exist following exception is occured. In this case also CannotGetJdbcConnectionException should be occured ; {code} org.springframework.transaction.CannotCreateTransactionException: Could not open JDBC Connection for transaction; nested exception is java.lang.IllegalArgumentException: Connection must not be null at org.springframework.jdbc.datasource.DataSourceTransactionManager.doBegin(DataSourceTransactionManager.java:240) at org.springframework.transaction.support.AbstractPlatformTransactionManager.getTransaction(AbstractPlatformTransactionManager.java:371) at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:127) {code} Thanks
    via by ismail altuntas,
    • org.springframework.transaction.CannotCreateTransactionException: Could not open JDBC Connection for transaction; nested exception is java.sql.SQLException: Invalid Oracle URL specified at org.springframework.jdbc.datasource.DataSourceTransactionManager.doBegin(DataSourceTransactionManager.java:242) at org.springframework.transaction.support.AbstractPlatformTransactionManager.getTransaction(AbstractPlatformTransactionManager.java:373) at org.activiti.spring.SpringTransactionContext.rollback(SpringTransactionContext.java:60) at org.activiti.engine.impl.interceptor.CommandContext.close(CommandContext.java:173) at org.activiti.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:66) at org.activiti.spring.SpringTransactionInterceptor$1.doInTransaction(SpringTransactionInterceptor.java:47) at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:133) at org.activiti.spring.SpringTransactionInterceptor.execute(SpringTransactionInterceptor.java:45) at org.activiti.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:31) at org.activiti.engine.impl.cfg.CommandExecutorImpl.execute(CommandExecutorImpl.java:40)

    Users with the same issue

    kkandda
    3 times, last one,
    Unknown visitor1 times, last one,