Forums de discussion

Checking JBoss connection

thumbnail
abdelaziz marzouk, modifié il y a 9 années.

Checking JBoss connection

New Member Publications: 23 Date d'inscription: 19/09/14 Publications récentes
Hi,

I have listener which is triggered whenever a a war file is put in the deployment folder of liferay, I do a check on the deployed element and I check something in the deployment, I have a listener also when I undeploy, the undeployment does something in a db table in Liferay, when JBoss is shutting down, I lose the db connection but the undeployment listener is still working, I want to check if there is a JDBC connection or not before I execute the undeployment, is that possible?

Thanks
thumbnail
Patrick Wolf, modifié il y a 9 années.

RE: Checking JBoss connection

Regular Member Publications: 127 Date d'inscription: 15/09/10 Publications récentes
I assume you are using the JBoss/Liferay bundle, aren't you?
thumbnail
David H Nebinger, modifié il y a 9 années.

RE: Checking JBoss connection

Liferay Legend Publications: 14919 Date d'inscription: 02/09/06 Publications récentes
If you're shutting down does it really matter if the DB is there or not? Best you can hope for is intercepting the exception and discarding anyways.

I think you have to question what you're doing, however. At shutdown nothing is really getting undeployed (just like at startup the existing apps aren't being deployed). If you're treating them the same as an actual deploy/undeploy, you're going to find that you're mixing in a whole lot of invalid crap into your table.
thumbnail
abdelaziz marzouk, modifié il y a 9 années.

RE: Checking JBoss connection

New Member Publications: 23 Date d'inscription: 19/09/14 Publications récentes
The problem is that this method has two use cases:
1- When I undeploy a war file while the server is up and running , I have some logic to execute
2- When I am shutting down it is also executed but I want to catch the exception and never show in the log files

I am using JBoss server, and I need to know for the second case, if I can ask Liferay API are you shutting down, then I could catch the exception, but the first case, I would leave it because I need to know if my business logic was correctly executed.

Thanks
thumbnail
Patrick Wolf, modifié il y a 9 années.

RE: Checking JBoss connection

Regular Member Publications: 127 Date d'inscription: 15/09/10 Publications récentes
thumbnail
abdelaziz marzouk, modifié il y a 9 années.

RE: Checking JBoss connection

New Member Publications: 23 Date d'inscription: 19/09/14 Publications récentes
I prefere to check liferay API first
thumbnail
David H Nebinger, modifié il y a 9 années.

RE: Checking JBoss connection (Réponse)

Liferay Legend Publications: 14919 Date d'inscription: 02/09/06 Publications récentes
Liferay typically does not know that the server is shutting down. Liferay has a shutdown button in the control panel but I don't think anyone uses it like ever.
thumbnail
abdelaziz marzouk, modifié il y a 9 années.

RE: Checking JBoss connection

New Member Publications: 23 Date d'inscription: 19/09/14 Publications récentes
Thanks