Project

General

Profile

Revision 6466

Lock the system metadata entry in hzSystemMetadata when calling registerSystemMetadata().

View differences:

src/edu/ucsb/nceas/metacat/dataone/CNodeService.java
529 529
        logMetacat.debug("Starting to insert SystemMetadata...");
530 530
        sysmeta.setDateSysMetadataModified(new Date());
531 531
        try {
532
          HazelcastService.getInstance().getSystemMetadataMap().lock(sysmeta.getIdentifier());
532 533
        	HazelcastService.getInstance().getSystemMetadataMap().put(sysmeta.getIdentifier(), sysmeta);
534
          HazelcastService.getInstance().getSystemMetadataMap().unlock(sysmeta.getIdentifier());
535
          
533 536
        } catch (Exception e) {
534 537
            throw new ServiceFailure("4862", "Error inserting system metadata: " + e.getClass() + ": " + e.getMessage());
538
        } finally {
539
          HazelcastService.getInstance().getSystemMetadataMap().unlock(sysmeta.getIdentifier());
540

  
535 541
        }
536 542
        
537 543
        logMetacat.debug("Returning from registerSystemMetadata");

Also available in: Unified diff