Page 3 of 3 FirstFirst 123
Results 21 to 26 of 26

Thread: Could not open JDBC Connection for transaction java.sql.SQLException: ORA-00923:

  1. #21

    Default

    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

  2. #22
    Join Date
    Dec 2005
    Location
    Lyon, France
    Posts
    311

    Default

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

  3. #23

    Default

    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 at 02:32 AM.

  4. #24
    Join Date
    Dec 2005
    Location
    Lyon, France
    Posts
    311

    Default

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

  5. #25

    Default

    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?

  6. #26
    Join Date
    Dec 2005
    Location
    Lyon, France
    Posts
    311

    Default

    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •