Before WLS 12.2.1,
there is only one JNDI global tree of WLS domain. It is difficult to use
this one JNDI global tree to support multiple partitions. Because
partition requires a unique isolated namespace. For example, it is
possible multiple partitions use same JNDI name to bind/lookup JNDI
resource separately. And it will result in NameAlreadyBoundException. To
isolate JNDI resources in different partitions, every partition has
unique JNDI global tree since WLS 12.2.1. Then tenant can operate JNDI
resource in one partition without name conflict with one in other
partition. For Application scoped JNDI tree, it is only visible in
application internal, so it isolated naturally. So there is no change
for App scoped JNDI tree in WLS 12.2.1. Let us see how to access JNDI
resource in partition.
To access JNDI resources in partition, we need add partition
information in provider url property during creating InitialContext.
Managed server: ms1 , ms2
Virtual target: VT1 target to managed server ms1, VT2 target to cluster
Partition: Partition 1 has available target VT1, Partition2 has available target VT2.
We need add parition1 inforamtion in properties during creating InitialContext to access JNDI resources in partition1.
Partition2 runs in cluster, so we can use cluster address format in properties during creating InitialContext.
In weblogic, we can create
Foreign JNDI provider to link JNDI resources in other server. In WLS
12.2.1, we also can use Foreign JNDI provider to link to JNDI resources
in specified partition by adding partition information in
configuration. These partition information including provider url, user
and password will be used to create JNDI context. The following is an
example of Foreign JNDI provider configuration in partition1. This
provider links to partition2.
When a JNDI context is created, the context will associate with specified partition. Then all subsequent JNDI operations are done within
associated partition JNDI tree, not in current partition one. And this
associated partition will remain even if the context is used by a
different thread than was used to create the context.. If
provider url property is set in environment during creating JNDI
context, partition specified in provider url is associated. Otherwise,
JNDI context associates with current partition.
Before WLS 12.2.1,, JNDI service life cycle is same with weblogic
server. In WLS 12.2.1, every partition owns JNDI global tree by itself,
so JNDI service life cycle is same with partition. As soon as partition
startup, JNDI service of this partition is available. And during
partition shutdown, JNDI service of this partition is destroyed.