Beispiel #1
0
 public void releaseRecord() throws RecordUnlockedException {
   checkIsActiveRecordLocked();
   SessionState sessionState = getSessionState();
   CollectRecord activeRecord = sessionState.getActiveRecord();
   if (activeRecord != null && activeRecord.getId() != null) {
     recordManager.releaseLock(activeRecord.getId());
   }
   sessionState.setActiveRecord(null);
 }
Beispiel #2
0
 public void checkIsActiveRecordLocked() throws RecordUnlockedException {
   SessionState sessionState = getSessionState();
   CollectRecord record = sessionState.getActiveRecord();
   if (record == null) {
     throw new RecordUnlockedException();
   } else if (record.getId() != null) {
     User user = sessionState.getUser();
     String lockId = sessionState.getSessionId();
     try {
       recordManager.checkIsLocked(record.getId(), user, lockId);
       sessionState.keepActiveRecordAlive();
     } catch (RecordUnlockedException e) {
       clearActiveRecord();
       throw e;
     }
   }
 }
Beispiel #3
0
 public CollectRecord getActiveRecord() {
   SessionState sessionState = getSessionState();
   return sessionState.getActiveRecord();
 }