On Jul 19, 2006, at 5:43 AM, Joerg Heinicke wrote:
Joerg Heinicke <[EMAIL PROTECTED]> writes:
I think in addition you may need to specify that the resource
adapter
is unshared. I'm not sure how to do this in jencks: it ought to
be a
configuration option on the component that is using the connection
factory.
I don't use the complete Geronimo J2EE server and so neither a
deployed
resource adapter. I just set this infrastructure up with Spring
and some
Geronimo jars like connector and transaction. I don't know where
ConnectionInfo was instantiated atm, but how can I set the
unshareable
property there? Where is it normally set?
Back to code and debugging I found out that it is the
GenericConnectionManager
or its super class, the AbstractConnectionManager, which
instantiates the
ConnectionInfo. Furthermore there is a ConnectionTracker interface and
ConnectionTrackerCoordinator as implementation, which sets the
environment and
so the unshareable property. So far, so good ...
Now it gets to Jencks and so might be a bit off topic ... Jencks
allows to pass
the ConnectionTracker and if one is passed the
ConnectionTrackerInterceptor gets
applied. This works and ConnectionTrackerCoordinator.setEnvironment
() gets
called. Unfortunately at this point there is no InstanceContext
stored in its
ThreadLocal field currentInstanceContexts, which lets the
setEnvironment()
method exit without doing anything. Now I wonder how such a
InstanceContext gets
injected into the coordinator. It implements
TrackedConnectionAssociator and
with enter(InstanceContext) the InstanceContext is put into the
ThreadLocal
field. Unfortunately I don't know how to register the
ConnectionTrackerCoordinator as TrackedConnectionAssociator, so
that it gets
informed about an entered InstanceContext. I only found
TransactionContextInterceptor and TransactionContextInitializer,
but don't know
how to use them.
Any ideas? Thanks in advance,
The way it's supposed to work is that there's an interceptor in the
call chain going into the component that is using the resource
adapter that calls enter and exit with the appropriate instance
context that has the unshareable resources set on it. Examples are
the OpenEJB ConnectionTrackingInterceptor, and the jetty and tomcat
InstanceContextBeforeAfter. I don't know how to set something like
this up in spring.
I think we should seriously consider not forcing you to claim your
connections are unshared. Can you file a jira issue about this?
thanks
david jencks
Joerg