Index: src/edu/ucsb/nceas/metacat/dataone/SystemMetadataFactory.java
===================================================================
--- src/edu/ucsb/nceas/metacat/dataone/SystemMetadataFactory.java	(revision 7187)
+++ src/edu/ucsb/nceas/metacat/dataone/SystemMetadataFactory.java	(revision 7188)
@@ -628,14 +628,9 @@
 			}
             
             //insert the systemmetadata object or just update it as needed
-            boolean exists = IdentifierManager.getInstance().systemMetadataExists(sm.getIdentifier().getValue());
-            if (!exists) {
-            	IdentifierManager.getInstance().insertSystemMetadata(sm);
-            	logMetacat.info("Generated SystemMetadata for " + localId);
-            } else {
-            	IdentifierManager.getInstance().updateSystemMetadata(sm);
-            	logMetacat.info("Updated SystemMetadata for " + localId);
-            }
+        	IdentifierManager.getInstance().insertOrUpdateSystemMetadata(sm);
+        	logMetacat.info("Generated or Updated SystemMetadata for " + localId);
+            
         	logMetacat.trace("METRICS:\tGENERATE_SYSTEM_METADATA:\tEND:\tLOCALID:\t" + localId);
 
         }
Index: src/edu/ucsb/nceas/metacat/dataone/hazelcast/HazelcastService.java
===================================================================
--- src/edu/ucsb/nceas/metacat/dataone/hazelcast/HazelcastService.java	(revision 7187)
+++ src/edu/ucsb/nceas/metacat/dataone/hazelcast/HazelcastService.java	(revision 7188)
@@ -442,13 +442,9 @@
 	private void saveLocally(SystemMetadata sm) {
 		logMetacat.debug("Saving entry locally: " + sm.getIdentifier().getValue());
 		try {
-			if (!IdentifierManager.getInstance().systemMetadataExists(sm.getIdentifier().getValue())) {
-				IdentifierManager.getInstance().insertSystemMetadata(sm);
-				
-			} else {
-				IdentifierManager.getInstance().updateSystemMetadata(sm);
-				
-			}
+
+			IdentifierManager.getInstance().insertOrUpdateSystemMetadata(sm);
+
 		} catch (McdbDocNotFoundException e) {
 			logMetacat.error("Could not save System Metadata to local store.", e);
 			
Index: src/edu/ucsb/nceas/metacat/dataone/hazelcast/SystemMetadataMap.java
===================================================================
--- src/edu/ucsb/nceas/metacat/dataone/hazelcast/SystemMetadataMap.java	(revision 7187)
+++ src/edu/ucsb/nceas/metacat/dataone/hazelcast/SystemMetadataMap.java	(revision 7188)
@@ -41,14 +41,7 @@
 	public void store(Identifier pid, SystemMetadata sm) {
 		try {
 			logMetacat.debug("Storing System Metadata to store: " + pid.getValue());
-			if (!IdentifierManager.getInstance().systemMetadataExists(pid.getValue())) {
-				IdentifierManager.getInstance().insertSystemMetadata(sm);
-				
-			} else {
-				IdentifierManager.getInstance().updateSystemMetadata(sm);
-				
-			}
-			
+			IdentifierManager.getInstance().insertOrUpdateSystemMetadata(sm);
 		} catch (McdbDocNotFoundException e) {
 			throw new RuntimeException(e.getMessage(), e);
 			
Index: src/edu/ucsb/nceas/metacat/IdentifierManager.java
===================================================================
--- src/edu/ucsb/nceas/metacat/IdentifierManager.java	(revision 7187)
+++ src/edu/ucsb/nceas/metacat/IdentifierManager.java	(revision 7188)
@@ -39,9 +39,6 @@
 import org.dataone.client.ObjectFormatCache;
 import org.dataone.service.exceptions.BaseException;
 import org.dataone.service.exceptions.InvalidSystemMetadata;
-import org.dataone.service.exceptions.NotFound;
-import org.dataone.service.exceptions.NotImplemented;
-import org.dataone.service.exceptions.ServiceFailure;
 import org.dataone.service.types.v1.AccessPolicy;
 import org.dataone.service.types.v1.AccessRule;
 import org.dataone.service.types.v1.Checksum;
@@ -959,14 +956,37 @@
      * @throws SQLException 
      * @throws InvalidSystemMetadata 
      */
-    public void insertSystemMetadata(SystemMetadata sysmeta) 
+    public void insertOrUpdateSystemMetadata(SystemMetadata sysmeta) 
         throws McdbDocNotFoundException, SQLException, InvalidSystemMetadata {
     	String guid = sysmeta.getIdentifier().getValue();
-    	// insert the record
-        insertSystemMetadata(guid);
-        // update with the values
-        updateSystemMetadata(sysmeta);
+    	
+    	 // Get a database connection from the pool
+        DBConnection dbConn = DBConnectionPool.getDBConnection("IdentifierManager.insertSystemMetadata");
+        int serialNumber = dbConn.getCheckOutSerialNumber();
         
+        try {
+        	// use a single transaction for it all
+        	dbConn.setAutoCommit(false);
+        	
+	    	// insert the record if needed
+        	if (!IdentifierManager.getInstance().systemMetadataExists(guid)) {
+    	        insertSystemMetadata(guid, dbConn);
+			}
+	        // update with the values
+	        updateSystemMetadata(sysmeta, dbConn);
+	        
+	        // commit if we got here with no errors
+	        dbConn.commit();
+        } catch (Exception e) {
+            e.printStackTrace();
+            logMetacat.error("Error while creating " + TYPE_SYSTEM_METADATA + " record: " + guid, e );
+            dbConn.rollback();
+        } finally {
+            // Return database connection to the pool
+            DBConnectionPool.returnDBConnection(dbConn, serialNumber);
+        }
+        
+        
     }
         
     
@@ -1029,162 +1049,119 @@
         String authoritativeMemberNode, long modifiedDate, String submitter, 
         String guid, String objectFormat, BigInteger size, boolean archived,
         boolean replicationAllowed, int numberReplicas, String obsoletes,
-        String obsoletedBy, BigInteger serialVersion) throws SQLException  {
+        String obsoletedBy, BigInteger serialVersion, DBConnection dbConn) throws SQLException  {
+  
+        // Execute the insert statement
+        String query = "update " + TYPE_SYSTEM_METADATA + 
+            " set (date_uploaded, rights_holder, checksum, checksum_algorithm, " +
+            "origin_member_node, authoritive_member_node, date_modified, " +
+            "submitter, object_format, size, archived, replication_allowed, number_replicas, " +
+            "obsoletes, obsoleted_by, serial_version) " +
+            "= (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) where guid = ?";
+        PreparedStatement stmt = dbConn.prepareStatement(query);
         
-        DBConnection dbConn = null;
-        int serialNumber = -1;
+        //data values
+        stmt.setTimestamp(1, new java.sql.Timestamp(dateUploaded));
+        stmt.setString(2, rightsHolder);
+        stmt.setString(3, checksum);
+        stmt.setString(4, checksumAlgorithm);
+        stmt.setString(5, originMemberNode);
+        stmt.setString(6, authoritativeMemberNode);
+        stmt.setTimestamp(7, new java.sql.Timestamp(modifiedDate));
+        stmt.setString(8, submitter);
+        stmt.setString(9, objectFormat);
+        stmt.setString(10, size.toString());
+        stmt.setBoolean(11, archived);
+        stmt.setBoolean(12, replicationAllowed);
+        stmt.setInt(13, numberReplicas);
+        stmt.setString(14, obsoletes);
+        stmt.setString(15, obsoletedBy);
+        stmt.setString(16, serialVersion.toString());
+
+        //where clause
+        stmt.setString(17, guid);
+        logMetacat.debug("stmt: " + stmt.toString());
+        //execute
+        int rows = stmt.executeUpdate();
+
+        stmt.close();
+               
+    }
+    
+    private void insertReplicationPolicy(String guid, String policy, List<String> memberNodes, DBConnection dbConn) throws SQLException
+    {
+           
+        // remove existing values first
+        String delete = "delete from systemMetadataReplicationPolicy " + 
+        "where guid = ? and policy = ?";
+        PreparedStatement stmt = dbConn.prepareStatement(delete);
+        //data values
+        stmt.setString(1, guid);
+        stmt.setString(2, policy);
+        //execute
+        int deletedCount = stmt.executeUpdate();
+        stmt.close();
         
-        try {
-            // Get a database connection from the pool
-            dbConn = 
-                DBConnectionPool.getDBConnection("IdentifierManager.createMapping");
-            serialNumber = dbConn.getCheckOutSerialNumber();
-
+        for (String memberNode: memberNodes) {
             // Execute the insert statement
-            String query = "update " + TYPE_SYSTEM_METADATA + 
-                " set (date_uploaded, rights_holder, checksum, checksum_algorithm, " +
-                "origin_member_node, authoritive_member_node, date_modified, " +
-                "submitter, object_format, size, archived, replication_allowed, number_replicas, " +
-                "obsoletes, obsoleted_by, serial_version) " +
-                "= (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) where guid = ?";
-            PreparedStatement stmt = dbConn.prepareStatement(query);
+            String insert = "insert into systemMetadataReplicationPolicy " + 
+                "(guid, policy, member_node) " +
+                "values (?, ?, ?)";
+            PreparedStatement insertStatement = dbConn.prepareStatement(insert);
             
             //data values
-            stmt.setTimestamp(1, new java.sql.Timestamp(dateUploaded));
-            stmt.setString(2, rightsHolder);
-            stmt.setString(3, checksum);
-            stmt.setString(4, checksumAlgorithm);
-            stmt.setString(5, originMemberNode);
-            stmt.setString(6, authoritativeMemberNode);
-            stmt.setTimestamp(7, new java.sql.Timestamp(modifiedDate));
-            stmt.setString(8, submitter);
-            stmt.setString(9, objectFormat);
-            stmt.setString(10, size.toString());
-            stmt.setBoolean(11, archived);
-            stmt.setBoolean(12, replicationAllowed);
-            stmt.setInt(13, numberReplicas);
-            stmt.setString(14, obsoletes);
-            stmt.setString(15, obsoletedBy);
-            stmt.setString(16, serialVersion.toString());
+            insertStatement.setString(1, guid);
+            insertStatement.setString(2, policy);
+            insertStatement.setString(3, memberNode);
+            
+            logMetacat.debug("systemMetadataReplicationPolicy sql: " + insertStatement.toString());
 
-            //where clause
-            stmt.setString(17, guid);
-            logMetacat.debug("stmt: " + stmt.toString());
             //execute
-            int rows = stmt.executeUpdate();
-
-            stmt.close();
-            
-        } catch (SQLException e) {
-            logMetacat.error("updateSystemMetadataFields: SQL error while updating system metadata: " 
-                    + e.getMessage());
-            throw e;
-            
-        } finally {
-            // Return database connection to the pool
-            DBConnectionPool.returnDBConnection(dbConn, serialNumber);
+            int rows = insertStatement.executeUpdate();
+            insertStatement.close();
         }
+        
     }
     
-    private void insertReplicationPolicy(String guid, String policy, List<String> memberNodes)
-    {
-        DBConnection dbConn = null;
-        int serialNumber = -1;
+    private void insertReplicationStatus(String guid, List<Replica> replicas, DBConnection dbConn) throws SQLException {
+       
+        // remove existing values first
+        String delete = "delete from systemMetadataReplicationStatus " + 
+        "where guid = ?";
+        PreparedStatement stmt = dbConn.prepareStatement(delete);
+        //data values
+        stmt.setString(1, guid);
+        //execute
+        int deletedCount = stmt.executeUpdate();
+        stmt.close();
         
-        try {
-            // Get a database connection from the pool
-            dbConn = 
-                DBConnectionPool.getDBConnection("IdentifierManager.insertReplicationPolicy");
-            serialNumber = dbConn.getCheckOutSerialNumber();
-
-            // remove existing values first
-            String delete = "delete from systemMetadataReplicationPolicy " + 
-            "where guid = ? and policy = ?";
-	        PreparedStatement stmt = dbConn.prepareStatement(delete);
-	        //data values
-	        stmt.setString(1, guid);
-	        stmt.setString(2, policy);
-	        //execute
-	        int deletedCount = stmt.executeUpdate();
-	        stmt.close();
-            
-            for (String memberNode: memberNodes) {
+        if (replicas != null) {
+            for (Replica replica: replicas) {
 	            // Execute the insert statement
-	            String insert = "insert into systemMetadataReplicationPolicy " + 
-	                "(guid, policy, member_node) " +
-	                "values (?, ?, ?)";
+	            String insert = "insert into systemMetadataReplicationStatus " + 
+	                "(guid, member_node, status, date_verified) " +
+	                "values (?, ?, ?, ?)";
 	            PreparedStatement insertStatement = dbConn.prepareStatement(insert);
 	            
 	            //data values
+	            String memberNode = replica.getReplicaMemberNode().getValue();
+	            String status = replica.getReplicationStatus().toString();
+	            java.sql.Date sqlDate = new java.sql.Date(replica.getReplicaVerified().getTime());
 	            insertStatement.setString(1, guid);
-	            insertStatement.setString(2, policy);
-	            insertStatement.setString(3, memberNode);
+	            insertStatement.setString(2, memberNode);
+	            insertStatement.setString(3, status);
+	            insertStatement.setDate(4, sqlDate);
+
+	            logMetacat.debug("systemMetadataReplicationStatus sql: " + insertStatement.toString());
 	            
-	            logMetacat.debug("systemMetadataReplicationPolicy sql: " + insertStatement.toString());
-
 	            //execute
 	            int rows = insertStatement.executeUpdate();
 	            insertStatement.close();
             }
-        } catch (SQLException e) {
-            logMetacat.error("SQL error while adding systemMetadataReplicationPolicy for: " + guid, e); 
-        } finally {
-            // Return database connection to the pool
-            DBConnectionPool.returnDBConnection(dbConn, serialNumber);
         }
+       
     }
     
-    private void insertReplicationStatus(String guid, List<Replica> replicas) {
-        DBConnection dbConn = null;
-        int serialNumber = -1;
-        
-        try {
-            // Get a database connection from the pool
-            dbConn = DBConnectionPool.getDBConnection("IdentifierManager.insertReplicas");
-            serialNumber = dbConn.getCheckOutSerialNumber();
-
-            // remove existing values first
-            String delete = "delete from systemMetadataReplicationStatus " + 
-            "where guid = ?";
-	        PreparedStatement stmt = dbConn.prepareStatement(delete);
-	        //data values
-	        stmt.setString(1, guid);
-	        //execute
-	        int deletedCount = stmt.executeUpdate();
-	        stmt.close();
-            
-	        if (replicas != null) {
-	            for (Replica replica: replicas) {
-		            // Execute the insert statement
-		            String insert = "insert into systemMetadataReplicationStatus " + 
-		                "(guid, member_node, status, date_verified) " +
-		                "values (?, ?, ?, ?)";
-		            PreparedStatement insertStatement = dbConn.prepareStatement(insert);
-		            
-		            //data values
-		            String memberNode = replica.getReplicaMemberNode().getValue();
-		            String status = replica.getReplicationStatus().toString();
-		            java.sql.Date sqlDate = new java.sql.Date(replica.getReplicaVerified().getTime());
-		            insertStatement.setString(1, guid);
-		            insertStatement.setString(2, memberNode);
-		            insertStatement.setString(3, status);
-		            insertStatement.setDate(4, sqlDate);
-	
-		            logMetacat.debug("systemMetadataReplicationStatus sql: " + insertStatement.toString());
-		            
-		            //execute
-		            int rows = insertStatement.executeUpdate();
-		            insertStatement.close();
-	            }
-	        }
-        } catch (SQLException e) {
-            logMetacat.error("SQL error while adding systemMetadataReplicationStatus for: " + guid, e); 
-        } finally {
-            // Return database connection to the pool
-            DBConnectionPool.returnDBConnection(dbConn, serialNumber);
-        }
-    }
-    
     /**
      * Insert the system metadata fields into the db
      * @param sm
@@ -1191,9 +1168,10 @@
      * @throws McdbDocNotFoundException 
      * @throws SQLException 
      * @throws InvalidSystemMetadata 
+     * @throws AccessException 
      */
-    public void updateSystemMetadata(SystemMetadata sm) 
-      throws McdbDocNotFoundException, SQLException, InvalidSystemMetadata {
+    public void updateSystemMetadata(SystemMetadata sm, DBConnection dbConn) 
+      throws McdbDocNotFoundException, SQLException, InvalidSystemMetadata, AccessException {
     	
       Boolean replicationAllowed = false;
 		  Integer numberReplicas = -1;
@@ -1223,7 +1201,8 @@
 		    numberReplicas,
 		    sm.getObsoletes() == null ? null:sm.getObsoletes().getValue(),
 		    sm.getObsoletedBy() == null ? null: sm.getObsoletedBy().getValue(),
-		    sm.getSerialVersion()
+		    sm.getSerialVersion(),
+		    dbConn
         );
         
         String guid = sm.getIdentifier().getValue();
@@ -1240,7 +1219,7 @@
 			    for (NodeReference node: replicationPolicy.getBlockedMemberNodeList()) {
 			    	nodes.add(node.getValue());
 			    }
-			    this.insertReplicationPolicy(guid, policy, nodes);
+			    this.insertReplicationPolicy(guid, policy, nodes, dbConn);
 		    }
 		    
 		    if (replicationPolicy.getPreferredMemberNodeList() != null) {
@@ -1249,21 +1228,17 @@
 			    for (NodeReference node: replicationPolicy.getPreferredMemberNodeList()) {
 			    	nodes.add(node.getValue());
 			    }
-		        this.insertReplicationPolicy(guid, policy, nodes);
+		        this.insertReplicationPolicy(guid, policy, nodes, dbConn);
 		    }
         }
         
         // save replica information
-        this.insertReplicationStatus(guid, sm.getReplicaList());
+        this.insertReplicationStatus(guid, sm.getReplicaList(), dbConn);
         
         // save access policy
         AccessPolicy accessPolicy = sm.getAccessPolicy();
         if (accessPolicy != null) {
-        	try {
-				this.insertAccessPolicy(guid, accessPolicy);
-			} catch (AccessException e) {
-				throw new McdbDocNotFoundException(e);
-			}
+			this.insertAccessPolicy(guid, accessPolicy);
         }
     }
     
@@ -1718,33 +1693,21 @@
     /**
      * create the systemmetadata record
      * @param guid
+     * @param dbConn 
+     * @throws SQLException 
      */
-    private void insertSystemMetadata(String guid)
+    private void insertSystemMetadata(String guid, DBConnection dbConn) throws SQLException
     {        
-        
-        int serialNumber = -1;
-        DBConnection dbConn = null;
-        try {
 
-            // Get a database connection from the pool
-            dbConn = DBConnectionPool.getDBConnection("IdentifierManager.insertSystemMetadata");
-            serialNumber = dbConn.getCheckOutSerialNumber();
+        // Execute the insert statement
+        String query = "insert into " + TYPE_SYSTEM_METADATA + " (guid) values (?)";
+        PreparedStatement stmt = dbConn.prepareStatement(query);
+        stmt.setString(1, guid);
+        logMetacat.debug("system metadata query: " + stmt.toString());
+        int rows = stmt.executeUpdate();
 
-            // Execute the insert statement
-            String query = "insert into " + TYPE_SYSTEM_METADATA + " (guid) values (?)";
-            PreparedStatement stmt = dbConn.prepareStatement(query);
-            stmt.setString(1, guid);
-            logMetacat.debug("system metadata query: " + stmt.toString());
-            int rows = stmt.executeUpdate();
-
-            stmt.close();
-        } catch (Exception e) {
-            e.printStackTrace();
-            logMetacat.error("Error while creating " + TYPE_SYSTEM_METADATA + " record: " + guid, e );
-        } finally {
-            // Return database connection to the pool
-            DBConnectionPool.returnDBConnection(dbConn, serialNumber);
-        }
+        stmt.close();
+        
     }
     
     public void deleteSystemMetadata(String guid)
