I want to switch to jndi configuration:
org.quartz.dataSource.myDS.jndiURL=java:/comp/env/jdbc/sharkdb
and getting exception, whats wrong with my configuration?
Caused by: org.quartz.JobPersistenceException: Couldn't commit jdbc connection. Cannot call method 'commit' while a global transaction is running
at org.quartz.impl.jdbcjobstore.JobStoreSupport.commitConnection(JobStoreSupport.java:3674) ~[quartz-2.1.6.jar:na]
at org.quartz.impl.jdbcjobstore.JobStoreSupport.executeInNonManagedTXLock(JobStoreSupport.java:3812) ~[quartz-2.1.6.jar:na]
at org.quartz.impl.jdbcjobstore.JobStoreSupport.executeInNonManagedTXLock(JobStoreSupport.java:3773) ~[quartz-2.1.6.jar:na]
at org.quartz.impl.jdbcjobstore.JobStoreSupport.recoverJobs(JobStoreSupport.java:823) ~[quartz-2.1.6.jar:na]
at org.quartz.impl.jdbcjobstore.JobStoreSupport.schedulerStarted(JobStoreSupport.java:681) ~[quartz-2.1.6.jar:na]
... 63 common frames omitted
Caused by: com.atomikos.jdbc.AtomikosSQLException: Cannot call method 'commit' while a global transaction is running
at com.atomikos.jdbc.AtomikosSQLException.throwAtomikosSQLException(AtomikosSQLException.java:46) ~[transactions-jdbc-3.9.1.jar:na]
at com.atomikos.jdbc.AtomikosSQLException.throwAtomikosSQLException(AtomikosSQLException.java:57) ~[transactions-jdbc-3.9.1.jar:na]
at com.atomikos.jdbc.nonxa.AtomikosThreadLocalConnection.invoke(AtomikosThreadLocalConnection.java:275) ~[transactions-jdbc-3.9.1.jar:na]
at com.sun.proxy.$Proxy105.commit(Unknown Source) ~[na:na]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_60]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_60]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_60]
at java.lang.reflect.Method.invoke(Method.java:497) ~[na:1.8.0_60]
at org.quartz.impl.jdbcjobstore.AttributeRestoringConnectionInvocationHandler.invoke(AttributeRestoringConnectionInvocationHandler.java:73) ~[quartz-2.1.6.jar:na]
at com.sun.proxy.$Proxy106.commit(Unknown Source) ~[na:na]
at org.quartz.impl.jdbcjobstore.JobStoreSupport.commitConnection(JobStoreSupport.java:3672) ~[quartz-2.1.6.jar:na]
... 67 common frames omitted
Looks like when i am using org.quartz.dataSource.myDS.URL,.. etc it issues own connect to DB, but when i specify jndi, it uses same connect as shark, which is in global transcation during shark initialization. And to use this need to configure
org.quartz.impl.jdbcjobstore.JobStoreCMT ?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I have working quartz.properties with datasource configured
org.quartz.jobStore.class = org.quartz.impl.jdbcjobstore.JobStoreTX
org.quartz.jobStore.misfireThreshold = 60000
org.quartz.jobStore.dataSource = myDS
org.quartz.jobStore.selectWithLockSQL = SELECT * FROM {0}LOCKS WITH (UPDLOCK ROWLOCK) WHERE LOCK_NAME = ?
org.quartz.jobStore.useProperties = false
org.quartz.dataSource.myDS.URL=jdbc:XXXX
org.quartz.dataSource.myDS.driver=com.mysql.jdbc.Driver
org.quartz.dataSource.myDS.password=pass
org.quartz.dataSource.myDS.user=user
I want to switch to jndi configuration:
org.quartz.dataSource.myDS.jndiURL=java:/comp/env/jdbc/sharkdb
and getting exception, whats wrong with my configuration?
Caused by: org.quartz.JobPersistenceException: Couldn't commit jdbc connection. Cannot call method 'commit' while a global transaction is running
at org.quartz.impl.jdbcjobstore.JobStoreSupport.commitConnection(JobStoreSupport.java:3674) ~[quartz-2.1.6.jar:na]
at org.quartz.impl.jdbcjobstore.JobStoreSupport.executeInNonManagedTXLock(JobStoreSupport.java:3812) ~[quartz-2.1.6.jar:na]
at org.quartz.impl.jdbcjobstore.JobStoreSupport.executeInNonManagedTXLock(JobStoreSupport.java:3773) ~[quartz-2.1.6.jar:na]
at org.quartz.impl.jdbcjobstore.JobStoreSupport.recoverJobs(JobStoreSupport.java:823) ~[quartz-2.1.6.jar:na]
at org.quartz.impl.jdbcjobstore.JobStoreSupport.schedulerStarted(JobStoreSupport.java:681) ~[quartz-2.1.6.jar:na]
... 63 common frames omitted
Caused by: com.atomikos.jdbc.AtomikosSQLException: Cannot call method 'commit' while a global transaction is running
at com.atomikos.jdbc.AtomikosSQLException.throwAtomikosSQLException(AtomikosSQLException.java:46) ~[transactions-jdbc-3.9.1.jar:na]
at com.atomikos.jdbc.AtomikosSQLException.throwAtomikosSQLException(AtomikosSQLException.java:57) ~[transactions-jdbc-3.9.1.jar:na]
at com.atomikos.jdbc.nonxa.AtomikosThreadLocalConnection.invoke(AtomikosThreadLocalConnection.java:275) ~[transactions-jdbc-3.9.1.jar:na]
at com.sun.proxy.$Proxy105.commit(Unknown Source) ~[na:na]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_60]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_60]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_60]
at java.lang.reflect.Method.invoke(Method.java:497) ~[na:1.8.0_60]
at org.quartz.impl.jdbcjobstore.AttributeRestoringConnectionInvocationHandler.invoke(AttributeRestoringConnectionInvocationHandler.java:73) ~[quartz-2.1.6.jar:na]
at com.sun.proxy.$Proxy106.commit(Unknown Source) ~[na:na]
at org.quartz.impl.jdbcjobstore.JobStoreSupport.commitConnection(JobStoreSupport.java:3672) ~[quartz-2.1.6.jar:na]
... 67 common frames omitted
Last edit: Vjacheslav Borisov 2015-09-22
Looks like when i am using org.quartz.dataSource.myDS.URL,.. etc it issues own connect to DB, but when i specify jndi, it uses same connect as shark, which is in global transcation during shark initialization. And to use this need to configure
org.quartz.impl.jdbcjobstore.JobStoreCMT ?