tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Jencks <>
Subject Re: ManagedConnectionFactory.matchManagedConnections
Date Thu, 11 Feb 2010 18:50:24 GMT
Not sure I'm on the openejb-users list...


this might be easier to discuss on the geornimo users list where I'm  
subscribed :-)

The geronimo connector framework gives you a lot of options for how to  
configure pooling, since the behavior naively implied by the spec  
doesn't seem very concurrency-friendly to me.

I think you've configured a single pool for all the managed  
connections, where the assumption is that all the connections are  
identical so every managed connection will match every request.  In  
this configuration, the framework picks a single managed connection  
from the pool and calls match with a singleton set containing it to  
verify that the configuration assumption is correct.  Since this is  
evidently not the situation you are in you have two options:

1. Configure mutliple pools partitioned on the request info.

2. Use the match-all strategy which will give the mcf all the  
connections in the pool to look at.  This has concurrency implications.

I don't know how this stuff is configured in openejb.... with the aid  
of some documentation or a pointer to the code I might be able to give  
more specific advice.

david jencks

On Feb 11, 2010, at 9:32 AM, David Blevins wrote:

> On Feb 10, 2010, at 6:16 AM, Stephen Connolly wrote:
>> Hi,
>> Having some fun with
>> ManagedConnectionFactory
>> .matchManagedConnections(Set,Subject,ConnectionRequestInfo)
>> I have a custom RA...
>> my implementation looks a little something like (pseudo code)
>> for (ManagedConnectionImpl mci: connectionSet) {
>>  if (mci.getRequestInfo().equals(requestInfo)) {
>>    return mci;
>>  }
>>  return null;
>> }
>> which from my reading of section 6.5.3 of the JCA spec is the correct
>> thing to do if you implement connection pooling.
>> However, if at any point I fail to find a matching connection from  
>> the
>> supplied connectionSet and return null per the spec, I get a lovely
>> exception from
>> org
>> .apache
>> .geronimo
>> .connector
>> .outbound.SinglePoolConnectionInterceptor#internalGetConnection
>> thrown from line 105: The pooling strategy does not match the
>> MatchManagedConnections implementation. Please investigate and
>> reconfigure this pool
>> If I instead throw a javax.resource.NotSupportedException then things
>> seem to work, but that is against the spec...
> David Jencks is the one who wrote the Java EE Connector impl we  
> use.  He might have a better idea.
> -David

View raw message