[keycloak-dev] Hybrid store committed
Bill Burke
bburke at redhat.com
Tue Jul 8 10:00:46 EDT 2014
On 7/8/2014 8:37 AM, Stian Thorgersen wrote:
>
>
> ----- Original Message -----
>> From: "Bill Burke" <bburke at redhat.com>
>> To: keycloak-dev at lists.jboss.org
>> Sent: Tuesday, 8 July, 2014 1:17:17 PM
>> Subject: Re: [keycloak-dev] Hybrid store committed
>>
>>
>>
>> On 7/8/2014 7:10 AM, Stian Thorgersen wrote:
>>> I've committed the hybrid store including jpa store implementations. It's
>>> enabled by default for the testsuite and the server, using jpa for realms
>>> and users, and mem for sessions.
>>>
>>> By default the JPA stores all use the same persistence-unit, but it's
>>> possible to split into multiple persistence-units and configure through
>>> keycloak-server.json if someone wants to for example store realms in one
>>> db and users in another.
>>>
>>> Remaining work includes:
>>>
>>> * Mongo stores
>>> * Updates to Keycloak session - remove model methods and add an enlist
>>> transaction feature for providers
>>> * EntityManager and Mongo connection providers - I'm going to add providers
>>> for retrieving EntityManager instances and Mongo clients. The main reason
>>> for this is so that multiple stores can share the same
>>> connection/transaction when possible
>>
>> My memory is hazy, but I think there is some automatic session
>> management that EMF is supposed to do. So I don't think you need
>> keycloak providers for EM creation. I'll have to look into it.
>
> It may share the connection, but it's not going to share the transaction. With the EM provider we can have a single transaction enlisted with the KeycloakSession. At the moment you could end up with 4 transactions (realms, users, sessions and audit) for a single request!
>
Are you sure it doesn't share the same transaction? It definitely does
for JTA.
Bill
--
Bill Burke
JBoss, a division of Red Hat
http://bill.burkecentral.com
More information about the keycloak-dev
mailing list