public void putAndUnlock(Object key,Object value){
  String uid=String.valueOf(key);
  Transaction tr=lockedUIDHashMap.get(uid);
  if (tr == null) {
    map.put(key,value,null,Integer.MAX_VALUE);
    return;
  }
  try {
    map.put(key,value,tr,Integer.MAX_VALUE);
    tr.commit();
  }
 catch (  Throwable t) {
    logger.warn("Failed to commit transaction and unlock the key [" + key + "], ignoring",t);
  }
 finally {
    lockedUIDHashMap.remove(uid);
  }
}

public void putAndUnlock ( Object key , Object value ) { String uid = String . valueOf ( key ) ; Transaction tr = lockedUIDHashMap . get ( uid ) ; if ( tr == null ) { map . put ( key , value , null , Integer . MAX_VALUE ) ; return ; } try { map . put ( key , value , tr , Integer . MAX_VALUE ) ; tr . commit ( ) ; } catch ( Throwable t ) { logger . warn ( "Failed to commit transaction and unlock the key [" + key + "], ignoring" , t ) ; } finally { lockedUIDHashMap . remove ( uid ) ; } }
unlocks the given key and puts the given value in a single operation .
