cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

unable to modify protected object

smitakasinath
Super Contributor

Hi,

 

We are trying to modify some objects as part of a batch script via java, some of which are  protected after the validation workflow has completed on them,

Calling the unlock() method fails on these objects. Can somebody please help?

 

Code snippet

 

public void secureUnlock(){

                                    System.out.println("Check lock status: "+m.getProp(Site.MA_GenericLocalName) +" status= " +lock.status());       

                                    if(lock.active()){

                                                System.out.println("Unlocking: "+m.getProp(Site.MA_GenericLocalName));

                                                lock.unlock();

                                                shouldBeLocked = true;

                                    }         

                        }

1 Reply

jhorber
MEGA
MEGA

Hello smitakasinath 

 

It is important to understand if this lock is a concurrency lock or an immutability lock

  • Concurrency lock (to avoid concurrent update) cannot be unlocked witth RDBMS storage (the Method Unlock could be used with GBMS storage)
  • Immutability lock can eventually be unlocked using specific code. It is important to set object back in the locked state after update

See KB http://community.mega.com/t5/custom/page/page-id/mega-kb-solution?sid=501D00000012bxuIAA

  • To understand of the object is locked by an Immutability lock 
  • To see how to unlock it

 

 

Jerome