Hi Adriano,
I hacked this multi-tenancy from Tomcat, Spring and MySql :)
I run on Wildfly 20.0.1, MySql 8 and Hibernate embedded in Wildfly
IMPORTANT: this solution is Hibernate dependent, don´t work in others providers.
1) The Hibernate Multi-tenancy need connect to one schema in start-up, then alter the persistence.xml to connect on schema. The schema assigned in the standalone.xml isn´t used.
The values "javax.persistence.xxxxx" don´t work, only "hibernate.xxxxxx"
Observe the many XXXXXX values to change to your application values (persistence-unit, password, etc.)
2) In case the change in schema (e.g. include new tables, columns), the Hibernate only make in the schema assigned in persistence.xml.
Others schema aren´t changed and must be changed manually.
2) Include multi-tenancy properties in the persistence.xml.
My application I use on database with many schemas: <property name="hibernate.multiTenancy" value="SCHEMA" />
3) Include in the web.xml the filter for multi-tenancy
<filter>
<filter-name>PageFilter</filter-name>
<filter-class>br.com.e8Sys.repository.common.TenantFilter</filter-class>
</filter>
The TenantFilter class filter class takes the tenancy from the URL, and in my applthe tenancy is the same name of the schema in database
4) Java files attacheds, adapt and compile all.
5) In the standalone.xml include the datasource parameters without any change
6) I don´t use the jboss-web.xml file
8) I research too in Hibernate fórum, but unfortunately I missed this links
Roberto Tatemoto
Sorocaba Brazil