Project

General

Profile

« Previous | Next » 

Revision 6780

only create guid->docid mapping during data replication if it does not already exist
http://bugzilla.ecoinformatics.org/show_bug.cgi?id=5520

View differences:

src/edu/ucsb/nceas/metacat/replication/ReplicationService.java
772 772
				InputStream inputStream = getURLStream(url);
773 773
				
774 774
				Exception writeException = null;
775
				//register data file into xml_documents table and wite data file
775
				//register data file into xml_documents table and write data file
776 776
				//into file system
777 777
				try {
778 778
					DocumentImpl.writeDataFileInReplication(inputStream,
......
798 798
		      		TypeMarshaller.unmarshalTypeFromStream(
799 799
		      				  SystemMetadata.class, 
800 800
		      				  new ByteArrayInputStream(systemMetadataXML.getBytes("UTF-8")));
801
		      	  
801 802
		      	  // need the guid-to-docid mapping
802
		      	  IdentifierManager.getInstance().createMapping(sysMeta.getIdentifier().getValue(), docid);
803
		      	  boolean mappingExists = true;
804
		      	  mappingExists = IdentifierManager.getInstance().identifierExists(sysMeta.getIdentifier().getValue());
805
		      	  if (!mappingExists) {
806
		      		  IdentifierManager.getInstance().createMapping(sysMeta.getIdentifier().getValue(), docid);
807
		      	  }
803 808
		      	  // save the system metadata
804 809
		      	  HazelcastService.getInstance().getSystemMetadataMap().put(sysMeta.getIdentifier(), sysMeta);
805 810
		        }
......
817 822
		            }
818 823
		        }
819 824

  
825
		        // throw the write exception now -- this happens when access changes on an object
820 826
				if (writeException != null) {
821 827
					throw writeException;
822 828
				}

Also available in: Unified diff