Announcement Announcement Module
Collapse
No announcement yet.
Secondary DB connection in Spring Batch Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Secondary DB connection in Spring Batch

    Hi,

    I am invoking the spring batch using CommandLineJobRunner.main.When there is problem in the DB connection,program is exiting normally with out entering into the catch block.

    When I am checking the logs I can see the below error
    RA-12505, TNS:listener does not currently know of SID given in connect descriptor
    The Connection descriptor used by the client was:
    171.150.5.85:49125:I
    )
    org.springframework.transaction.CannotCreateTransa ctionException: Could not open JDBC Connection for transaction; nested exception is org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (Listener refused the connection with the following error:
    ORA-12505, TNS:listener does not currently know of SID given in connect descriptor
    The Connection descriptor used by the client was:
    171.150.5.85:49125:I
    )
    at org.springframework.jdbc.datasource.DataSourceTran sactionManager.doBegin(DataSourceTransactionManage r.java:238)
    at org.springframework.transaction.support.AbstractPl atformTransactionManager.getTransaction(AbstractPl atformTransactionManager.java:374)
    at org.springframework.transaction.interceptor.Transa ctionAspectSupport.createTransactionIfNecessary(Tr ansactionAspectSupport.java:263)
    at org.springframework.transaction.interceptor.Transa ctionInterceptor.invoke(TransactionInterceptor.jav a:101)
    at org.springframework.aop.framework.ReflectiveMethod Invocation.proceed(ReflectiveMethodInvocation.java :171)
    at org.springframework.aop.framework.JdkDynamicAopPro xy.invoke(JdkDynamicAopProxy.java:204)
    at $Proxy1.getLastJobExecution(Unknown Source)
    at org.springframework.batch.core.launch.support.Simp leJobLauncher.run(SimpleJobLauncher.java:94)
    at org.springframework.batch.core.launch.support.Comm andLineJobRunner.start(CommandLineJobRunner.java:3 49)
    at org.springframework.batch.core.launch.support.Comm andLineJobRunner.main(CommandLineJobRunner.java:57 4)
    at com.boa.icdp.batch.utility.BatchCmdLauncher.proces sFile(BatchCmdLauncher.java:433)
    at com.boa.icdp.batch.utility.BatchCmdLauncher.proces sAllFiles(BatchCmdLauncher.java:286)
    at com.boa.icdp.batch.utility.BatchCmdLauncher.main(B atchCmdLauncher.java:67)

    My requirement is when there is a DB connection failure I want to connect using another URL.

    Please suggest how to trace this exception,so that I can configure a new connection
Working...
X