[keycloak-dev] JPA connections provider and multiple transaction support
Stian Thorgersen
stian at redhat.com
Fri Jul 11 11:50:03 EDT 2014
Added Mongo connection provider as well, and moved the MongoStore stuff there:
https://github.com/stianst/keycloak/blob/master/connections/mongo/src/main/java/org/keycloak/connections/mongo/DefaultMongoConnectionProvider.java
https://github.com/stianst/keycloak/blob/master/connections/mongo/src/main/java/org/keycloak/connections/mongo/DefaultMongoConnectionFactoryProvider.java
Now neither the MongoModelProvider:
https://github.com/stianst/keycloak/blob/master/model/mongo/src/main/java/org/keycloak/models/mongo/keycloak/adapters/MongoModelProviderFactory.java
Or the JpaModelProvider:
https://github.com/stianst/keycloak/blob/master/model/jpa/src/main/java/org/keycloak/models/jpa/JpaModelProviderFactory.java
Has to deal with connections or transactions.
----- Original Message -----
> From: "Stian Thorgersen" <stian at redhat.com>
> To: "keycloak dev" <keycloak-dev at lists.jboss.org>
> Sent: Friday, 11 July, 2014 1:29:49 PM
> Subject: [keycloak-dev] JPA connections provider and multiple transaction support
>
> To prevent creating multiple EntityManager's for a single request I've added
> a JPAConnectionProvider that is used to share an EntityManager instance
> between multiple providers.
>
> https://github.com/stianst/keycloak/blob/master/connections/jpa/src/main/java/org/keycloak/connections/jpa/DefaultJpaConnectionProviderFactory.java
> https://github.com/stianst/keycloak/blob/master/connections/jpa/src/main/java/org/keycloak/connections/jpa/DefaultJpaConnectionProvider.java
>
> In the future we could consider adding support for multiple
> persistence-units, but for now I think we should have a limitation that all
> JPA providers use the same database/persistence-unit.
>
> I've also added some very basic support to KeycloakSession so providers can
> enlist their transactions with the session:
>
> https://github.com/stianst/keycloak/blob/master/model/api/src/main/java/org/keycloak/models/KeycloakSession.java
> https://github.com/stianst/keycloak/blob/master/model/api/src/main/java/org/keycloak/models/KeycloakTransactionManager.java
>
> The idea being that a provider when used can enlist its transaction with the
> session.
>
> I've not committed any of this to master as I wanted to have everyone's
> opinion on it first.
> _______________________________________________
> keycloak-dev mailing list
> keycloak-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/keycloak-dev
>
More information about the keycloak-dev
mailing list