On Dec 19, 2006, at 4:04 AM, Mohammad Nour El-Din wrote:
Hi DBlevins and All...
Regarding the OPENEJB-368, I came out with two ideas to get this
JIRA done,
one which is simple and straight forward but I doubt it is the
accurate one,
the other needs more code change and it took me a while to
investigate for
it, the two approaches are:
1. For each EJBContext.lookup method call an InitialContext
instance
is created and used for looking-up the resource bound to the
provided JNDI name (The simple solution).
I'd go with simple! :)
2. Each EJBContext is instantiated with the initial naming
context or the JNDI provider that will be provided to the
responsible
container, much like the way TransactionManager and
SecurityService are
provided to the current implementation of the different
EJBContext(s)
through the corresponding container type, and then this naming
context\provider will be used for each call to the
EJBContext.lookup method. (The more complex one).
Yea, that code used to be simpler too. I was on a rampage to remove
static references to the OpenEJB class and the static call to get the
TransactionManager turned into it being passed in on the
constructor. If it wasn't for the fact that we then had to pass the
TransactionManager along to several pieces of code that before didn't
reference it, it'd say it was a change for the better. We might just
revert to something similar to what we had before.
-David