tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gurkan Erdogdu <>
Subject Re: NamingContext Possible Bug
Date Fri, 24 Sep 2010 11:56:05 GMT

I think that this is not related with ResourceLink elements. When you define 
global resource link in your Context.xml, Tomcat creates ResourceLinkRef for 
this entry. Then same scenario exists, it creates object using 
ResourceLinkFactory and caches it. It is not desirable. Changing (removing 
caching statements) this does not break anything.

I will open an issue.



----- Original Message ----
From: Konstantin Kolinko <>
To: Tomcat Developers List <>
Sent: Fri, September 24, 2010 2:36:46 AM
Subject: Re: NamingContext Possible Bug

2010/9/21 Gurkan Erdogdu <>:
> Hello folks,
> In NamingContext implementation, if "lookup()" is a Reference, current
> implementation caches the result of the NamingManager # getObjectInstance via
> following statements and changes the type of the entry. In the following
> lookups, same object is returned. I would like to write ObjectFactory that
> returns new instance for each time lookup is called on its reference. But with
> the current implementation, it is not possible to write such an object factory
> because of aferomentioned sitaution. I think that entry must be stay as
> Reference instead of changing entry type.

There was some discussion previously, proposed and vetoed patch and
some issue in bugzilla. [1]

From some later code review I think that that code is used to handle
<ResourceLink> elements. That is, when you have a global resource in
server.xml and a ResourceLink in your context.xml. [2] It would be
undesirable to break that.



Best regards,
Konstantin Kolinko

To unsubscribe, e-mail:
For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message