Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Next challenges

Recent achievements

  • Global
  • Personal


  • Give kudos
  • Received
  • Given


  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Retry Connection to database

Is there a setting in the dbconfig.xml or other place to tell JIRA to re-try the connection to the database ever x seconds/minutes?  Our DB is controlled by a different group with their own schedule for maintenance.  We're not always notified so we don't know when to bounce the Tomcat instance.  Users end up with the famous "JIRA failed to establish a connection to your database".,..  I don't recall having this in JIRA 6.  OH and I'm currently on JIRA 7.13.  Planning on going to 8.x eventually.

1 answer

1 accepted

0 votes
Answer accepted

This should work out of the box. There is a connection Pool which detects failing connections and re-create them.

Here is our Config (Postgres):

<validation-query>select 1</validation-query>

Thank you for the response.  Sorry it has taken me so long to get back to this posting.  I had implemented these and it's still happening.  JIRA is coming up when the DB is down or the DB is being bounced when JIRA is up.  I don't know the exact timing as it happens when I'm off shift.  The error JIRA is showing users is.

Can you provide the settings.xml and the Stracktrace?

How looks your DB Setup? Do you have some kind of HA-Setup there?


<?xml version="1.0" encoding="UTF-8"?>


<validation-query>select 1 from dual</validation-query>


Don't know the exact type of HA we have.  Fail over with replication yes. But in this case no failover is required or happening. 


2020-04-18 21:27:01,962 Caesium-1-1 ERROR ServiceRunner [NoModule] There was an error getting a DBCP datasource.
java.lang.RuntimeException: Unable to obtain a connection from the underlying connection pool
at org.ofbiz.core.entity.jdbc.interceptors.connection.ConnectionTracker.trackConnection(
at org.ofbiz.core.entity.transaction.DBCPConnectionFactory.trackConnection(
at org.ofbiz.core.entity.transaction.DBCPConnectionFactory.getConnection(
at org.ofbiz.core.entity.ConnectionFactory.tryGenericConnectionSources(
at org.ofbiz.core.entity.transaction.JNDIFactory.getConnection(
at org.ofbiz.core.entity.TransactionFactory.getConnection(
at org.ofbiz.core.entity.ConnectionFactory.getConnection(
at org.ofbiz.core.entity.jdbc.SQLProcessor.getConnection(
at org.ofbiz.core.entity.jdbc.SQLProcessor.prepareStatement(
at org.ofbiz.core.entity.GenericDAO.createEntityListIterator(
at org.ofbiz.core.entity.GenericDAO.selectListIteratorByCondition(
at org.ofbiz.core.entity.GenericHelperDAO.findListIteratorByCondition(
at org.ofbiz.core.entity.GenericDelegator.findListIteratorByCondition(
at com.atlassian.jira.ofbiz.DefaultOfBizDelegator.findListIteratorByCondition(
at com.atlassian.jira.ofbiz.WrappingOfBizDelegator.findListIteratorByCondition(
at com.atlassian.jira.entity.SelectQueryImpl$ExecutionContextImpl.forEach(
at com.atlassian.jira.entity.SelectQueryImpl$ExecutionContextImpl.asList(
at com.atlassian.jira.scheduler.OfBizRunDetailsDao.getUnsuccessfulIdsForJob(
at com.atlassian.jira.scheduler.OfBizRunDetailsDao.addRunDetails(
at com.atlassian.scheduler.core.AbstractSchedulerService.addRunDetails(
at com.atlassian.scheduler.core.JobLauncher.launch(
at com.atlassian.scheduler.caesium.impl.CaesiumSchedulerService.launchJob(
at com.atlassian.scheduler.caesium.impl.CaesiumSchedulerService.executeLocalJob(
at com.atlassian.scheduler.caesium.impl.CaesiumSchedulerService.executeQueuedJob(
at com.atlassian.scheduler.caesium.impl.CaesiumSchedulerService$1.consume(
at com.atlassian.scheduler.caesium.impl.CaesiumSchedulerService$1.consume(
at com.atlassian.scheduler.caesium.impl.SchedulerQueueWorker.executeJob(
at com.atlassian.scheduler.caesium.impl.SchedulerQueueWorker.executeNextJob(
Caused by: java.sql.SQLRecoverableException: IO Error: The Network Adapter could not establish the connection
at oracle.jdbc.driver.T4CConnection.logon(
at oracle.jdbc.driver.PhysicalConnection.connect(
at oracle.jdbc.driver.T4CDriverExtension.getConnection(
at oracle.jdbc.driver.OracleDriver.connect(
at org.apache.commons.dbcp2.DriverConnectionFactory.createConnection(
at org.apache.commons.pool2.impl.GenericObjectPool.create(
at org.apache.commons.pool2.impl.GenericObjectPool.borrowObject(
at org.apache.commons.pool2.impl.GenericObjectPool.borrowObject(
at org.apache.commons.dbcp2.PoolingDataSource.getConnection(
at org.apache.commons.dbcp2.BasicDataSource.getConnection(
at org.ofbiz.core.entity.transaction.DBCPConnectionFactory$
at org.ofbiz.core.entity.transaction.DBCPConnectionFactory$
at org.ofbiz.core.entity.jdbc.interceptors.connection.ConnectionTracker.trackConnection(
... 29 more

Caused by: The Network Adapter could not establish the connection
at oracle.jdbc.driver.T4CConnection.connect(
... 42 more
Caused by: Connection refused, socket connect lapse 0 ms. / 49125 30000 1 true
... 47 more
Caused by: Connection refused
... 49 more
2020-04-18 21:27:01,965 Caesium-1-1 ERROR ServiceRunner [c.a.s.caesium.impl.SchedulerQueueWorker] Unhandled exception thrown by job QueuedJob[jobId=CaesiumSchedulerService.RecoveryJob,deadline=1587259621954]




JIRA/server get's bounced....


2020-04-18 21:41:26,051 JIRA-Bootstrap INFO [c.a.j.config.database.SystemDatabaseConfigurationLoader] Reading database configuration from /apps/jirahome/dbconfig.xml
2020-04-18 21:41:26,445 JIRA-Bootstrap ERROR [c.a.config.bootstrap.DefaultAtlassianBootstrapManager] Could not successfully test your database:
java.sql.SQLRecoverableException: IO Error: The Network Adapter could not establish the connection
at oracle.jdbc.driver.T4CConnection.logon(
at oracle.jdbc.driver.PhysicalConnection.connect(
at oracle.jdbc.driver.T4CDriverExtension.getConnection(
at oracle.jdbc.driver.OracleDriver.connect(
at java.sql.DriverManager.getConnection(
at java.sql.DriverManager.getConnection(
at com.atlassian.config.bootstrap.DefaultAtlassianBootstrapManager.getTestDatabaseConnection(
at com.atlassian.jira.config.database.JdbcDatasource.getConnection(
at com.atlassian.jira.config.database.DatabaseConfig.testConnection(
at java.util.Iterator.forEachRemaining(
at java.util.Spliterators$IteratorSpliterator.forEachRemaining(

2020-04-18 21:41:26,462 JIRA-Bootstrap ERROR [] JIRA couldn't connect to your database
2020-04-18 21:41:26,462 JIRA-Bootstrap ERROR [] JIRA failed to establish a connection to your database.
This could be because:
- Your database isn't running
- The configuration of your dbconfig.xml file is incorrect (user, password, or database URL etc.)
- There is a network issue between JIRA and your database (e.g. firewall, database doesn't allow remote access etc.)

There are several other solutions you can try, review our documentation and see what works for you.

2020-04-18 21:41:26,465 JIRA-Bootstrap INFO [c.a.jira.startup.JiraStartupLogger] Running JIRA startup checks.
2020-04-18 21:41:26,465 JIRA-Bootstrap FATAL [c.a.jira.startup.JiraStartupLogger] Startup check failed. JIRA will be locked.


Then we reboot it again after DB is up and it works.  If JIRA can't self recover than I guess our script will use to start JIRA will need to be enhanced to check the status of the DB and not come up until the DB is able to connect.

Hi Michael,


sorry, didn't notice your new answer.

This is a Oracle Database and i had the same issues with failing connection in case of Downtimes/Failover (Oracle RAC)

Yeah - restarting the service will fix this but we had to configure ONS (Oracle Notification Service) and FCF (Fast Connection Failover) to the Service (Java) to fix this...

Maybe you can try it out but this will need some time...

The main problem isn't from a failover but a un-aligned maintenance schedule.  We're too big to always have every group perform maintenance at the same time and align which comes first.  I've sense developed a simple python script to attempt connection and retry every x seconds until the connection is a success.  Then it will exit and the remainder of the start up can happen successfully.

Suggest an answer

Log in or Sign up to answer

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you