BTM
  1. BTM
  2. BTM-127

IgnoreRecoveryFailures Option Does Not Prevent Startup Recovery Error

    Details

    • Type: Improvement Improvement
    • Status: Open Open
    • Priority: Minor Minor
    • Resolution: Unresolved
    • Affects Version/s: 2.1.3
    • Fix Version/s: 3.0.0
    • Labels:
      None
    • Number of attachments :
      0

      Description

      We would like to support starting the associated Spring context when our database is down and have the software connect when the database is available. However, we get the exception shown below when our software is starting up.

      We tried setting IgnoreRecoveryFailures(true), however it did not seem to fix the problem. Should there or can there be a check in the RecoveryException catch shown below to only do the statements in the catch if the ignoreRecoveryFailures is false?

      From PoolingDataSource.java:
      private void buildXAPool() throws Exception {
      if (pool != null)
      return;

      if (log.isDebugEnabled())

      { log.debug("building XA pool for " + getUniqueName() + " with " + getMinPoolSize() + " connection(s)"); }

      pool = new XAPool(this, this, xaDataSource);
      boolean builtXaFactory = false;
      if (xaDataSource == null)

      { xaDataSource = (XADataSource) pool.getXAFactory(); builtXaFactory = true; }

      try

      { ResourceRegistrar.register(this); }

      catch (RecoveryException ex)

      { if (builtXaFactory) xaDataSource = null; pool = null; throw ex; }

      }

      Error Received During Spring Context Creation:
      Caused by: bitronix.tm.resource.ResourceConfigurationException: cannot create JDBC datasource named testoracle
      at bitronix.tm.resource.jdbc.PoolingDataSource.init(PoolingDataSource.java:92)
      at bitronix.tm.resource.jdbc.PoolingDataSource.getConnection(PoolingDataSource.java:250)
      at org.springframework.orm.hibernate3.LocalDataSourceConnectionProvider.getConnection(LocalDataSourceConnectionProvider.java:81)
      at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:113)
      at org.hibernate.cfg.Configuration.buildSettingsInternal(Configuration.java:2863)
      at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2859)
      at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1870)
      at org.springframework.orm.hibernate3.LocalSessionFactoryBean.newSessionFactory(LocalSessionFactoryBean.java:860)
      at org.springframework.orm.hibernate3.LocalSessionFactoryBean.buildSessionFactory(LocalSessionFactoryBean.java:779)
      at org.springframework.orm.hibernate3.AbstractSessionFactoryBean.afterPropertiesSet(AbstractSessionFactoryBean.java:211)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1477)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1417)
      ... 189 more
      Caused by: bitronix.tm.recovery.RecoveryException: cannot start recovery on a PoolingDataSource containing an XAPool of resource oracle with 0 connection(s) (0 still available)
      at bitronix.tm.resource.jdbc.PoolingDataSource.startRecovery(PoolingDataSource.java:288)
      at bitronix.tm.recovery.IncrementalRecoverer.recover(IncrementalRecoverer.java:61)
      at bitronix.tm.resource.ResourceRegistrar.register(ResourceRegistrar.java:87)
      at bitronix.tm.resource.jdbc.PoolingDataSource.buildXAPool(PoolingDataSource.java:104)
      at bitronix.tm.resource.jdbc.PoolingDataSource.init(PoolingDataSource.java:88)
      ... 200 more
      Caused by: java.lang.RuntimeException: XADataSourceWrapper.getXAConnection() - Exception: java.util.concurrent.ExecutionException: java.sql.SQLException: Listener refused the connection with the following error: ORA-12514, TNS:listener does not currently know of service requested in connect descriptor

      at XADataSourceWrapper.getXAConnection(XADataSourceWrapper.java:68)
      at bitronix.tm.resource.jdbc.PoolingDataSource.createPooledConnection(PoolingDataSource.java:341)
      at bitronix.tm.resource.common.XAPool.createPooledObject(XAPool.java:283)
      at bitronix.tm.resource.common.XAPool.grow(XAPool.java:391)
      at bitronix.tm.resource.common.XAPool.getInPool(XAPool.java:371)
      at bitronix.tm.resource.common.XAPool.getConnectionHandle(XAPool.java:123)
      at bitronix.tm.resource.jdbc.PoolingDataSource.startRecovery(PoolingDataSource.java:284)
      ... 204 more

        Activity

        There are no comments yet on this issue.

          People

          • Assignee:
            Ludovic Orban
            Reporter:
            Kevin Urciolo
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated: