cancel
Showing results for 
Search instead for 
Did you mean: 

application locking

Former Member
0 Kudos

Hi,

this is the first time i'm using the applocking mechanism that is described in the man-pages:

http://help.sap.com/saphelp_nw04/helpdata/en/a3/df5b1ee1bed348b198719e50af835d/frameset.htm

I am trying to lock a table with the following snippet of code:



Context initialContext = new InitialContext();

locking = (TableLocking) initialContext.lookup(TableLocking.JNDI_NAME);
       
        
pkMap = new HashMap();
pkMap.put("CRESOURCE", new String());
pkMap.put("CCHANNEL", new Integer(0));

locking.lock(TableLocking.LIFETIME_USERSESSION,
                      connection, 
                      "MYTABLE",
                      pkMap,
                      TableLocking.MODE_EXCLUSIVE_NONCUMULATIVE);

The result (exception) i get is :

com.sap.engine.frame.core.locking.LockException: Cannot lock [2005090320475998400000<myhost>.....................9779450, %MYTABLE gHBYRw, 0, X]; it is in use by the same owner.

I'd guess in Visual Admin -> Services -> "Application Locking" i should be able to see any locks but there are none and as both applications that try to lock the table get this exception i'd assume that no locks have been created so far.

Any hints, ideas ?

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

In Visual Administrator you have to go to Services->Locking Adapter and the click refresh to see the current locks.

Maybe you already locked the tabel and didn't release it.

I tried to use locking and it worked for me. So if this didn't solve your problem please let me know.

Answers (0)