1

I am using wildfly-8.2.0.Final.

There are several databases that i have to connect to. However, some of them are only used for certain functionalities on the web application and they are not needed to be online all the time. So when the wildfly starts, some of the datasources may not be online. However, disconnection to any datasource causes wildfly to not deploy .war deployment and i cannot find any way to solve this problem. Is there a way?

UPDATE: I have a single table on a remote database server. The user will be able to query the table via my web application. The thing is, I have almost no control over the mentioned database. When the web application starts, it could be offline. However, this would cause my web application to fail to start. What I want is being able to run queries on a remote database if it is online. If it is offline, the web page could fail or the query can be canceled. But the only thing that I don’t want is that my web application to be limited by a remote database that I may have no control over.

My previous solution was a workaround. I would run queries on the remote database via a local database which has a foreign table to the remote one. However, the local one reads all data on the remote table before applying any constraints on postgresql 9.5. As the remote table has a large number of rows and I am using lazy loading, it takes so long for a single query and defeats the whole purpose of the lazy loading.

I found a similar question, but there is no answer.

On wildfly, you can set the datasource so that it tries to reconnect periodically when it disconnects. In my case, the deployment should be successful initially for this to be helpful.

Ærsel
  • 11
  • 4

1 Answers1

0

The deployment will failed if it references those datasources. Also you could define but disable those datasources.

ehsavoie
  • 3,126
  • 1
  • 16
  • 14
  • Thank you for your answer. My current solution is also disabling the datasources which also means that I can never use those datasources. So, it is kind of an undesirable solution. I have update the question by adding additional information, can you take a look at it? – Ærsel Mar 18 '19 at 10:37
  • Maybe you should just get the datasource from JNDI manually instead of using CDI or JPA. – ehsavoie Mar 18 '19 at 16:37