23 Managing Named Concurrent Edit Sessions

In previous releases, WebLogic Server configuration edit sessions supported only one active edit session at a time. The system administrator got a global edit lock, made changes, and then activated them. Other administrators could not make changes at the same time. In this release, there are situations in which more than one administrator may need to make configuration changes. A WebLogic Server MT domain contains multiple partitions, each with its own administrator. Partition administrators must be able to make configuration changes to the partition configuration and resources deployed in the partition without affecting other partition administrators or the WebLogic Server system administrator. Therefore, WebLogic Server has enabled multiple, concurrent edit sessions that support one or more configuration edit sessions per partition plus global configuration edit sessions.

Note:

WebLogic Server Multitenant domain partitions, resource groups, resource group templates, virtual targets, and Resource Consumption Management are deprecated in WebLogic Server 12.2.1.4.0 and will be removed in the next release.

This chapter includes the following sections:

Named Concurrent Edit Sessions: Overview

With this feature, an administrator creates a named edit session, makes changes, and then activates the changes. Another administrator also creates a named edit session in parallel. If there are conflicts between the edit session from the first administrator and the changes made by a second administrator, then the second administrator receives an error when activating the changes. The second administrator can then resolve the conflicts and activate the desired changes.

For details, see Managing Named Concurrent Edit Sessions: Main Steps.

Managing Named Concurrent Edit Sessions: Main Steps

Follow these main steps for managing named concurrent edit sessions.

  1. Administrators create (and destroy) named edit sessions.

    You use the ConfigurationManagerMBean API to start an edit session, activate changes, show changes, undo changes, and so forth.

    Each edit session has its own configuration files and ConfigurationManagerMBean instance.

  2. Changed configuration files are retained in an edit-session-specific directory:
    • Global named edit session changes are retained in a subdirectory of a new edit directory at the domain level: <domain-directory>/edit/<edit-session-name>, where <edit-session-name> is a version of the edit session name specified when the edit session was created.

    • Partition-specific named edit session changes are retained in a subdirectory of the partition directory: <partition-directory>/edit/<edit-session-name>, where <edit-session-name> is a version of the edit session name specified when the edit session was created.

  3. Conflicts may occur between parallel edit sessions when changes are activated. If any conflicts occur during activation, then the activate operation fails and you must resolve the conflicts manually.

    Use the resolve method to apply any concurrently applied configuration changes to the current edit session.

    After calling the resolve method, you can then proceed with the activation of pending changes in the edit session.

    To resolve conflicts, administrators can use these informational messages:

    • Each conflict contains a description including the identification of MBeans or properties in conflict.

    • Each conflict also contains a message describing the resolution for this conflict.

    • Resolution log messages contain short descriptions of each resolution and merge step. Administrators can use the resolution log message to identify what was modified and how it was modified in the current edit session.

Managing Named Concurrent Edit Sessions: WLST Example

You can use WLST to manage configuration edit sessions.

See the following WLST script example.

connect("username", "password")
 
# Enter existing named edit session or create one and enter it.
edit("foo")
startEdit()
cmo.createServer("Server-1")
 
# Create a different edit session.
edit("bar")
startEdit()
ls("Servers") #Server-1 is not printed because it is created in an independent edit session foo
s1=cmo.createServer("Server-1") 
s1.setListenPort(5555) # Conflicting modification - the same server with a different port
 
# Go back to edit session foo and activate.
edit("foo")
activate()
 
# List edit sessions / list with details.
showEditSession() # Lists all edit sessions
showEditSession("bar") # More detailed information about edit session bar
 
# Go back to edit session bar and activate.
edit("bar")
activate() # Conflict occurs
 
# Resolve conflicts based on a standard resolution strategy.
resolve()
activate()
 
# Edit sessions can also be destroyed.
destroyEditSession("foo")
destroyEditSession("bar")

The following example shows the edit session conflict resolution in detail:

wls:/wls/edit(foo)/> showEditSession() # Lists all edit sessions
List of named edit sessions [for details use showEditSession(<name>)]:
 default
 bar
 foo
wls:/wls/edit(foo)/> showEditSession("bar") # More detailed information about edit session bar
bar
 Creator: wls
 Editor (lock owner): wls
 Resolve recommended: Yes
 Contains unactivated changes: Yes
 
wls:/wls/edit(foo)/> # Go back to edit session bar and activate.
wls:/wls/edit(foo)/> edit("bar")
You already have an edit session in progress and hence WLST will
continue with your edit session.
Other configuration changes were activated. Call resolve() to merge it into this edit tree.
wls:/wls/edit(bar)/ !> activate() # Conflict occurs.
Activating all your changes, this may take a while ...
The edit lock associated with this edit session is released after the activation is completed.
Traceback (innermost last):
  File "<console>", line 1, in ?
  File "<iostream>", line 471, in activate
  File "<iostream>", line 553, in raiseWLSTException
WLSTException: Error occurred while performing activate : Error while Activating changes. : 1 conflict:
[1]
 [wls]/Servers[Server-1] - a bean with the same qualified name has already been added to [wls].
Description of resolution operation:
 A bean added by this session overrides the one present in the current configuration.
 
wls:/wls/edit(bar)/> # Resolve conflicts based on a standard resolution strategy.
wls:/wls/edit(bar)/> resolve()
1 conflict:
[1]
 [wls]/Servers[Server-1] - a bean with the same qualified name has already been added to [wls].
Description of the resolution:
 A bean added by this session overrides the one present in the current configuration.
Patch:
No difference
wls:/wls/edit(bar)/ !> activate()
Activating all your changes, this may take a while ...
The edit lock associated with this edit session is released after the activation is completed.
Activation completed
 
wls:/wls/edit(bar)/> # Edit sessions can also be deleted.
wls:/wls/edit(bar)/> destroyEditSession("foo")
 
wls:/wls/edit(bar)/> destroyEditSession("bar")
Current edit tree is being removed; redirecting WLST cursor location to the config runtime tree.

Managing Named Concurrent Edit Sessions: Related Tasks and Links