Bug 1199218

Summary: (6.4.z) Enable properties/environment variables in datasource subsystem in EAP 6.4
Product: [JBoss] JBoss Enterprise Application Platform 6 Reporter: Marek Goldmann <mgoldman>
Component: JCAAssignee: Vaclav Tunka <vtunka>
Status: CLOSED WONTFIX QA Contact: Martin Simka <msimka>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 6.4.0CC: cdewolf, fnasser, jdoyle, kkhan, myarboro, pgier, rsvoboda, tom.jenkinson, vtunka
Target Milestone: ---   
Target Release: EAP 6.4.1   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-04-13 13:53:16 UTC Type: Feature Request
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Marek Goldmann 2015-03-05 16:37:01 UTC
Description of problem:

Today while preparing the EAP 6.4 images for OpenShift I came across a problem with using properties in datasource subsystem. It seems that it's not possible to set them, because expressions-allowed is set to false. It seems that this was already fixed in WildFly (https://issues.jboss.org/browse/WFLY-2160) and seems to be a pretty simple fix (https://github.com/wildfly/wildfly/pull/6976/files). I would love to have it in EAP 6.4 which would let me enable/disable selected datasources at boot time via env variables.

Here is the backgrund.

We'll have one EAP Docker image in OpenShift. This will include many datasources and drivers. These datasources will be definied even when the user did not choose any database to connect to. The reason behind it is that it's simple to achieve. If the user selects a database, the appropriate datasource should be enabled and configured with username/password. Here you can find an example:

  https://gist.github.com/goldmann/a3eb2192aefbd2bfc1b1

This includes only MySQL, but there will be also PostgreSQL and MognoDB. As you can see if we set OPENSHIFT_MYSQL_ENABLED variable to true (and the other OPENSHIFT_MYSQL_* variables) - we should have a working datasource.

Using environment variables is an easy way to customize the behavior of Docker containers and we are going to use it very often. Unfortunately this time we hit a blocker.

Comment 2 tom.jenkinson 2015-03-10 14:59:30 UTC
The upstream PR has had various comments on it recently retrospectively identifying that the the merged fix is actually incomplete - hence the risk part of this.

Its also worth adding a note here that various workarounds for not having an enable operation native to the server should be achievable. I haven't tried either of them but I could imagine the following being possible options:
1. Use sed to edit the configuration .xml files
2. Use a jboss-cli script to add/remove the datasources

Comment 3 Jesper Pedersen 2015-03-11 01:49:27 UTC
This can't go into a 6.4.z release, since it is requires management model updates.

The shown datasource configuration doesn't follow the best practice setup, as specified by the EAP admin guide.

Comment 10 Vaclav Tunka 2015-04-13 13:53:16 UTC
This is now tracked in:
https://issues.jboss.org/browse/EAP7-330

Closing.

Comment 11 JBoss JIRA Server 2015-08-06 13:08:51 UTC
Stefano Maestri <smaestri> updated the status of jira WFLY-2160 to Resolved