Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to override edit locks

Tags:

weblogic

wlst

I'm writing a WLST script to deploy some WAR's and an EAR. However, intermittently, the script will time out because it can't seem to get an edit lock (this script is part of a chain of many other scripts). I was wondering, is there a way to override or stop any current locks on the server? This is only a temporary solution, but in the interest of time, it will do for now.

Thanks.

like image 990
julian Avatar asked Apr 08 '11 23:04

julian


3 Answers

You could try setting a wait period and timeout:

startEdit([waitTimeInMillis], [timeoutInMillis], [exclusive]).  

Are other scripts erroring out, leaving the session locked? You could try adding exception handling around those. Also, if you have 'Automatically acquire lock" enabled in the Admin Console and you use the admin console sometimes it can cause problems if you are running scripts at the same time, even though you are not making "lock-requiring" changes.

Also, are you using the same user for the chained scripts?

like image 126
Jeff West Avatar answered Nov 10 '22 00:11

Jeff West


Within WLST, you can pass a number as a parameter to gain an exclusive lock. This allows the script to grab a different lock than the regular one that's used whenever an administrator locks from the console. It also prevents two instances of the same script from stepping on each other.

However, this creates complex change merge scenarios that are best avoided (by processes).

Oracle's documentation on configuration locks can be found here.

Alternatively, if you want the script to temporarily relieve any existing locks regardless of the pending changes, you may as well disable change management from the console, minimizing the inconvenience caused.

WLST also contains the cancelEdit command that you could run before you startEdit. Hope one of these options pan out!

like image 21
Musannif Zahir Avatar answered Nov 10 '22 00:11

Musannif Zahir


To take the configuration change lock from another administrator: If another administrator already has the configuration lock, the following message appears: Another user already owns the lock. You will need to either wait for the lock to be released, or take the lock.

  1. Locate the Change Center in the upper left corner of the Administration Console.
  2. Click Take Lock & Edit.
  3. Make your configuration changes.
  4. In the Change Center, click Activate Changes. Not all changes take effect immediately. Some require a restart (see Use the Change Center).
like image 1
Nagappa L M Avatar answered Nov 10 '22 01:11

Nagappa L M