Take the 2-minute tour ×

I have a Web application running on Oracle Weblogic Server 11g. It uses a datasource defined in the application server to connect to the Oracle Database (11g too), its class is


  • If for some reason the database becomes not present and then comes backs, the application is running ok (it gets exceptions while trying to access the db but this is fine and then can again get some new connections when the db comes back)

  • However, if the database is down during weblogic server startup, the datasource is not deployed on the server and the application throws an exception because it has not any datasource available, the deployment is marked as failed and of course nothing does repair this automatically.

Is there a way to make the datasource be deployed even if the database is not present during server startup ? (such that the application becomes usable when the database is back)

share|improve this question
One alternative might be deploying the data source after server startup, either via JMX or via WebLogic startup classes (please see: docs.oracle.com/cd/E15051_01/wls/docs103/jdbc_admin/config.html). Is that an option? I agree, though, with @Funtik's answer. In general, your database server should, in most cases, be at least as reliable as your app server. –  Viccari Jun 5 '12 at 0:49
First, I totally agree that : 1. The database server should be as reliable as the app server. 2. it does make any sense to have an application needing a database to run without it. –  Denis R. Jun 5 '12 at 7:02
However, I do not see any good logical reason why the starting order of the servers should be important : In my case both machines are running on a virtualized infrastructure and when there is a maintenance phase or an incident on it, when machines restart some human intervention on the servers is needed and I find it useless. If the datasource is here, the application can do a kind of "prestart" and really initialize itself when it can get a database connection. Don't you think it makes sense ? –  Denis R. Jun 5 '12 at 7:19
updated my answer –  Funtik Jun 5 '12 at 9:00
@DenisR. Sorry if I was not clear. What you stated makes a lot of sense. What I meant is not changing the order of startup of both of your servers, but starting up you WebLogic server without deploying your data source, deploying it later on, when you are sure your DB is in a healthy state. You can do that via JMX, or even via Java code. I'm not sure, though, if that would fit your needs. –  Viccari Jun 5 '12 at 13:17

3 Answers 3

Why do you want to deploy an application without a valid datasource?

You could possibly fake the datasource (create a dummy datasource with the same JNDI name) and assuming that the application does not validate datasource schema at startup you will get a semi-functional running application (which will fail with the first DB interaction).

When the real datasource is up and running you won't be able to switch to it. You will still have to restart the application server.


According to the J2EE spec (1.5 version) resources are binded during the deployment process. I believe that it is possible to implement a custom Factory that will return dummy / active datasource. Does it worth the effort to implement? ;)

EE.5.6.2 Deployer’s Responsibilities

Bind the resource manager connection factory reference to a resource manager connection factory that exists in the operational environment. The Deployer may use, for example, the JNDI LinkRef mechanism to create a symbolic link to the actual JNDI name of the resource manager connection factory. The re- source manager connection factory type must be compatible with the type de- clared in the res-type element.

share|improve this answer

The option you are looking for is "Connection Creation Retries", check this link

"If set and if the database is unavailable when the data source is created, WebLogic Server attempts to create connections in the pool again after the number of seconds you specify, and will continue to attempt to create the connections until it succeeds. This option applies to connections created when the data source is created at server startup ..."

share|improve this answer
It indeed looks like what I am looking for. I will test it and keep you informed –  Denis R. Jun 15 '12 at 12:59
Hey @DenisR., did you end up seeing the behavior you were expecting with this setting? I am curious to know if datasources/applications can deploy and start with the database down if this is set. –  David Hergert Aug 21 '13 at 17:17

set "Initial Capacity" http://docs.oracle.com/cd/E14571_01/web.1111/e13814/jdbc_tuning.htm#i1028616 to 0: weblogic on startup will not attempt to create any connection, and will not fail if the DB is not available.

share|improve this answer

Your Answer


