On 8/15/2013 9:32 AM, Bill Burke wrote:
On 8/15/2013 9:17 AM, Stian Thorgersen wrote:
> ATM all that's needed to stop the leak is to change "new
Transaction(false)" to "new Transaction()" everywhere (for example
RealmsResource.getTokenService).
>
Can't do that as the locators are initializing session dependent objects
i.e. ResourceModel.
> We could also remove the filters all together, and make Transaction open the session
instead?
>
Transaction already opens the session. KeycloakSessionCreateFilter is
not currently enabled. KeycloakSessionCleanupFilter is only enabled as
a failsafe just in case there was a coding error.
BTW, I actually don't remember why I did it this way. I know there was
a problem with JAX-RS filters I just can't remember what it was. Maybe
it was just a late-night coding error where your brain is too tired and
hallucinates. It looks like Resteasy should run the appropriate
response filters. I'll re-investigate and provide a patch to keycloak
to remove Transaction and do everything in jax-rs filters if possible.
Ahhhh! I remember now....forward() skips jaxrs response processing and
thus response filtering. Resteasy assumes that forward() sent back a
response to the client. I'll provide a resteasy release with Undertow
integration and fix the ExceptionMapper forwarding problem. BTW, we
could use Undertow right now, but there's a lot of initialization you'd
have to do that would be better services by integration provided by
Resteasy.
--
Bill Burke
JBoss, a division of Red Hat
http://bill.burkecentral.com