Hello
 
I am trying to implement a userfederation-provider based on a jpa-connection. My approach was:
 
According to an additional datasource-defintion for  the federated DB in the standalone.xml
 
                <datasource jta="true" jndi-name="java:jboss/datasources/CCPDS" pool-name="CCPDS" enabled="true" use-ccm="true">
                    <connection-url>jdbc:oracle:thin:@servername:1521:schemaname</connection-url>
..
 
, I tried to register this datasource as an additional connectionJpa-entry in keycloak-server.json as follows:
 
..
    "connectionsJpa": {
        "default": {
            "dataSource": "java:jboss/datasources/CCPKCDS",
            "databaseSchema": "update"
        },
        "FED-DB": {
            "dataSource": "java:jboss/datasources/CCPDS"
        }
    },
..
 
According to these configuration I hoped to be able to establish the appropriate entity manager by coding:
 
        // Get the appropriate entity manager from the KeycloakSession
        EntityManager em = session.getProvider(JpaConnectionProvider.class, "FED-DB").getEntityManager();
 
This did not work, indeed there is still only one (default) JpaConnectionProvider available in the session (JpaConnectionProviderList size is 1):
 
        Set<JpaConnectionProvider> JpaConnectionProviderList = session.getAllProviders(JpaConnectionProvider.class);
 
My question is: isn’t it in principle possible to register a second jpaConnector additionally to the default one or is there something missing or wrong in my approach?
 
Thanks for any help in advance.
 
Best regards, Eduard Matuszak
 
Dr. Eduard Matuszak
 
Worldline, an atos company
T  +49 (211)399 398 63
M +49 (163)166 23 67
F +49(211) 399 22 430
eduard.matuszak@atos.net
Max-Stromeyer-Straße 116
78467 Konstanz
Germany
de.worldline.com
worldline.jobs.de
facebook.com/WorldlineKarriere
 
 
Worldline GmbH
Geschäftsführer: Wolf Kunisch
Aufsichtsratsvorsitzender: Christophe Duquenne
Sitz der Gesellschaft: Frankfurt/Main
Handelsregister: Frankfurt/Main HRB 40 417

* * * * * * * * L E G A L D I S C L A I M E R * * * * * * * *
This e-mail and the documents attached are confidential and intended solely for the addressee; it may also be privileged. If you receive this e-mail by error, please notify the sender immediately and destroy it. As its integrity cannot be secured on the internet, the Atos group liability cannot be triggered for the message content. Although the sender endeavors to maintain a computer virus-free network, the sender does not warrant that this transmission is virus-free and shall not be liable for any damages resulting from any virus transmitted.
* * * * * * * * L E G A L D I S C L A I M E R * * * * * * * *