Announcement Announcement Module
Collapse
No announcement yet.
Could not open JDBC Connection for transaction java.sql.SQLException: ORA-00923: Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • #16
    you're missing the StAX API, looks like you're running on Java 5. Upgrade to Java 6 or add the StAX API JAR to your project.

    Comment


    • #17
      Hi arno,

      I have added Stax api.jar in my project libraries. Now i am getting the following error. It is complaining sequence does not exist.
      Actaully i have mensioned some DB instance the above. Those instances are enough or do i neet do create separate instance for this..
      pls let me know...

      Code:
      ERROR - Job Terminated in error:
      org.springframework.dao.DataAccessResourceFailureException: Could not obtain sequence value; nested exception is java.sql.SQLException: ORA-02289: sequence does not exist
      
      	at org.springframework.jdbc.support.incrementer.AbstractSequenceMaxValueIncrementer.getNextKey(AbstractSequenceMaxValueIncrementer.java:78)
      	at org.springframework.jdbc.support.incrementer.AbstractDataFieldMaxValueIncrementer.nextLongValue(AbstractDataFieldMaxValueIncrementer.java:125)
      	at org.springframework.batch.core.repository.dao.JdbcJobInstanceDao.createJobInstance(JdbcJobInstanceDao.java:110)
      	at org.springframework.batch.core.repository.support.SimpleJobRepository.createJobExecution(SimpleJobRepository.java:127)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      	at java.lang.reflect.Method.invoke(Method.java:585)
      	at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
      	at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
      	at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
      	at $Proxy0.createJobExecution(Unknown Source)
      	at org.springframework.batch.core.launch.support.SimpleJobLauncher.run(SimpleJobLauncher.java:102)
      	at org.springframework.batch.core.launch.support.CommandLineJobRunner.start(CommandLineJobRunner.java:207)
      	at org.springframework.batch.core.launch.support.CommandLineJobRunner.main(CommandLineJobRunner.java:254)
      	at FileToTableMain.main(FileToTableMain.java:8)
      Caused by: java.sql.SQLException: ORA-02289: sequence does not exist
      
      	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:745)
      	at oracle.jdbc.driver.T4CStatement.doOall8(T4CStatement.java:207)
      	at oracle.jdbc.driver.T4CStatement.executeForDescribe(T4CStatement.java:801)
      	at oracle.jdbc.driver.OracleStatement.executeMaybeDescribe(OracleStatement.java:1039)
      	at oracle.jdbc.driver.T4CStatement.executeMaybeDescribe(T4CStatement.java:841)
      	at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1134)
      	at oracle.jdbc.driver.OracleStatement.executeQuery(OracleStatement.java:1274)
      	at org.apache.commons.dbcp.DelegatingStatement.executeQuery(DelegatingStatement.java:208)
      	at org.springframework.jdbc.support.incrementer.AbstractSequenceMaxValueIncrementer.getNextKey(AbstractSequenceMaxValueIncrementer.java:69)
      	... 18 more

      Comment


      • #18
        I think you didn't use the correct file to create the batch tables. There's a file for Oracle (schema-oracle10g.sql), it uses sequences and not tables to generate the IDs. Drop the tables and use the correct file.

        Comment


        • #19
          Hi arno,

          i had droped all my previous tables and i had executed the "schema-oracle10g.sql" script and now i am getting the following error.

          Code:
          ERROR - Job Terminated in error:
          org.springframework.dao.CannotSerializeTransactionException: PreparedStatementCallback; SQL [INSERT into batch_JOB_INSTANCE(JOB_INSTANCE_ID, JOB_NAME, JOB_KEY, VERSION) values (?, ?, ?, ?)]; ORA-08177: can't serialize access for this transaction
          ; nested exception is java.sql.SQLException: ORA-08177: can't serialize access for this transaction
          
          	at org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator.doTranslate(SQLErrorCodeSQLExceptionTranslator.java:252)
          	at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:72)
          	at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:607)
          	at org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:792)
          	at org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:850)
          	at org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:854)
          	at org.springframework.batch.core.repository.dao.JdbcJobInstanceDao.createJobInstance(JdbcJobInstanceDao.java:117)
          	at org.springframework.batch.core.repository.support.SimpleJobRepository.createJobExecution(SimpleJobRepository.java:127)
          	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
          	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
          	at java.lang.reflect.Method.invoke(Method.java:585)
          	at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307)
          	at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
          	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
          	at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106)
          	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
          	at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
          	at $Proxy0.createJobExecution(Unknown Source)
          	at org.springframework.batch.core.launch.support.SimpleJobLauncher.run(SimpleJobLauncher.java:102)
          	at org.springframework.batch.core.launch.support.CommandLineJobRunner.start(CommandLineJobRunner.java:207)
          	at org.springframework.batch.core.launch.support.CommandLineJobRunner.main(CommandLineJobRunner.java:254)
          	at FileToTableMain.main(FileToTableMain.java:8)
          Caused by: java.sql.SQLException: ORA-08177: can't serialize access for this 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:745)
          	at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:216)
          	at oracle.jdbc.driver.T4CPreparedStatement.executeForRows(T4CPreparedStatement.java:966)
          	at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1170)
          	at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3339)
          	at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:3423)
          	at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:102)
          	at org.springframework.jdbc.core.JdbcTemplate$2.doInPreparedStatement(JdbcTemplate.java:798)
          	at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:591)
          	... 20 more

          Comment


          • #20
            try to set the isolationLevelForCreate to ISOLATION_REPEATABLE_READ in the job repository bean.

            Comment


            • #21
              Hi arno,

              Added in jobrepository bean like the following way
              Code:
              <bean id="jobRepository" 
              class="org.springframework.batch.core.repository.support.JobRepositoryFactoryBean">
              <property name="dataSource" ref="jobRepository-dataSource" />
              <property name="transactionManager" ref="jobRepository-transactionManager"/>
              <property name="isolationLevelForCreate" value="ISOLATION_REPEATABLE_READ "/>
              <property name="databaseType" value="oracle" />
              <property name="tablePrefix" value="batch_"/>
              </bean>
              i am getting the following error.
              Code:
              ERROR - Job Terminated in error:
              org.springframework.transaction.CannotCreateTransactionException: Could not open JDBC Connection for transaction; nested exception is java.sql.SQLException: READ_COMMITTED and SERIALIZABLE are the only valid transaction levels
              	at org.springframework.jdbc.datasource.DataSourceTransactionManager.doBegin(DataSourceTransactionManager.java:238)
              	at org.springframework.transaction.support.AbstractPlatformTransactionManager.getTransaction(AbstractPlatformTransactionManager.java:374)
              	at org.springframework.transaction.interceptor.TransactionAspectSupport.createTransactionIfNecessary(TransactionAspectSupport.java:263)
              	at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:101)
              	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
              	at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
              	at $Proxy0.getLastJobExecution(Unknown Source)
              	at org.springframework.batch.core.launch.support.SimpleJobLauncher.run(SimpleJobLauncher.java:85)
              	at org.springframework.batch.core.launch.support.CommandLineJobRunner.start(CommandLineJobRunner.java:207)
              	at org.springframework.batch.core.launch.support.CommandLineJobRunner.main(CommandLineJobRunner.java:254)
              	at FileToTableMain.main(FileToTableMain.java:8)
              Caused by: java.sql.SQLException: READ_COMMITTED and SERIALIZABLE are the only valid transaction levels
              	at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
              	at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:146)
              	at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:208)
              	at oracle.jdbc.driver.PhysicalConnection.setTransactionIsolation(PhysicalConnection.java:1678)
              	at org.apache.commons.dbcp.DelegatingConnection.setTransactionIsolation(DelegatingConnection.java:340)
              	at org.apache.commons.dbcp.PoolingDataSource$PoolGuardConnectionWrapper.setTransactionIsolation(PoolingDataSource.java:332)
              	at org.springframework.jdbc.datasource.DataSourceUtils.prepareConnectionForTransaction(DataSourceUtils.java:174)
              	at org.springframework.jdbc.datasource.DataSourceTransactionManager.doBegin(DataSourceTransactionManager.java:210)
              	... 10 more

              Comment


              • #22
                The error message is self-explanatory: try other isolation levels.

                Comment


                • #23
                  my doubt am i doing correct? am i places the below statement in correct place or not.

                  Code:
                  <property name="isolationLevelForCreate" value="ISOLATION_REPEATABLE_READ "/>
                  or do i need to write like this way
                  Code:
                  <job-repository id="jobRepository"
                                  isolation-level-for-create="REPEATABLE_READ" />
                  or like this way

                  Code:
                   <property name="isolation-level-for-create" value="REPEATABLE_READ "/>
                  which one is correct in this.
                  Last edited by Rams; May 19th, 2011, 03:32 AM.

                  Comment


                  • #24
                    I think you need the ISOLATION_ prefix, but try also without it. You can also try the ISOLATION_READ_COMMITTED level.

                    Comment


                    • #25
                      Hi arno,

                      Thanks Boss its working fine.
                      For 1st time its working fine but from 2nd time onwards its throwing error like the following way..
                      Code:
                      ERROR - Job Terminated in error:
                      org.springframework.batch.core.repository.JobInstanceAlreadyCompleteException: A job instance already exists and is complete for parameters={}.  If you want to run this job again, change the parameters.
                      	at org.springframework.batch.core.repository.support.SimpleJobRepository.createJobExecution(SimpleJobRepository.java:118)
                      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                      	at java.lang.reflect.Method.invoke(Method.java:585)
                      	at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307)
                      	at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
                      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
                      	at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106)
                      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
                      	at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
                      	at $Proxy0.createJobExecution(Unknown Source)
                      	at org.springframework.batch.core.launch.support.SimpleJobLauncher.run(SimpleJobLauncher.java:98)
                      	at org.springframework.batch.core.launch.support.CommandLineJobRunner.start(CommandLineJobRunner.java:207)
                      	at org.springframework.batch.core.launch.support.CommandLineJobRunner.main(CommandLineJobRunner.java:254)
                      	at FileToTableMain.main(FileToTableMain.java:8)
                      and my main java code is like this...
                      Code:
                      public static void main(String[] args) {
                      		CommandLineJobRunner.main(new String[]{"FileToTableJob.xml", "careerProcessorJob"});
                      		}
                      do i need to add one more time = 16:24PM parameter here! Am i correct or not?

                      Comment


                      • #26
                        don't call me "boss". Yes, this is related to job parameters. You need to read the documentation about job, job instance, and job execution: http://static.springsource.org/sprin...html#domainJob

                        Comment

                        Working...
                        X