Revision 7392
Added by ben leinfelder over 11 years ago
IdentifierManager.java | ||
---|---|---|
382 | 382 |
|
383 | 383 |
List<NodeReference> nodes = new ArrayList<NodeReference>(); |
384 | 384 |
String sql = "select guid, policy, member_node " + |
385 |
"from systemMetadataReplicationPolicy where guid = ? and policy = ?";
|
|
385 |
"from smReplicationPolicy where guid = ? and policy = ?";
|
|
386 | 386 |
DBConnection dbConn = null; |
387 | 387 |
int serialNumber = -1; |
388 | 388 |
try { |
... | ... | |
420 | 420 |
|
421 | 421 |
List<Replica> replicas = new ArrayList<Replica>(); |
422 | 422 |
String sql = "select guid, member_node, status, date_verified " + |
423 |
"from systemMetadataReplicationStatus where guid = ?";
|
|
423 |
"from smReplicationStatus where guid = ?";
|
|
424 | 424 |
DBConnection dbConn = null; |
425 | 425 |
int serialNumber = -1; |
426 | 426 |
try { |
... | ... | |
1092 | 1092 |
{ |
1093 | 1093 |
|
1094 | 1094 |
// remove existing values first |
1095 |
String delete = "delete from systemMetadataReplicationPolicy " +
|
|
1095 |
String delete = "delete from smReplicationPolicy " +
|
|
1096 | 1096 |
"where guid = ? and policy = ?"; |
1097 | 1097 |
PreparedStatement stmt = dbConn.prepareStatement(delete); |
1098 | 1098 |
//data values |
... | ... | |
1104 | 1104 |
|
1105 | 1105 |
for (String memberNode: memberNodes) { |
1106 | 1106 |
// Execute the insert statement |
1107 |
String insert = "insert into systemMetadataReplicationPolicy " +
|
|
1107 |
String insert = "insert into smReplicationPolicy " +
|
|
1108 | 1108 |
"(guid, policy, member_node) " + |
1109 | 1109 |
"values (?, ?, ?)"; |
1110 | 1110 |
PreparedStatement insertStatement = dbConn.prepareStatement(insert); |
... | ... | |
1114 | 1114 |
insertStatement.setString(2, policy); |
1115 | 1115 |
insertStatement.setString(3, memberNode); |
1116 | 1116 |
|
1117 |
logMetacat.debug("systemMetadataReplicationPolicy sql: " + insertStatement.toString());
|
|
1117 |
logMetacat.debug("smReplicationPolicy sql: " + insertStatement.toString());
|
|
1118 | 1118 |
|
1119 | 1119 |
//execute |
1120 | 1120 |
int rows = insertStatement.executeUpdate(); |
... | ... | |
1126 | 1126 |
private void insertReplicationStatus(String guid, List<Replica> replicas, DBConnection dbConn) throws SQLException { |
1127 | 1127 |
|
1128 | 1128 |
// remove existing values first |
1129 |
String delete = "delete from systemMetadataReplicationStatus " +
|
|
1129 |
String delete = "delete from smReplicationStatus " +
|
|
1130 | 1130 |
"where guid = ?"; |
1131 | 1131 |
PreparedStatement stmt = dbConn.prepareStatement(delete); |
1132 | 1132 |
//data values |
... | ... | |
1138 | 1138 |
if (replicas != null) { |
1139 | 1139 |
for (Replica replica: replicas) { |
1140 | 1140 |
// Execute the insert statement |
1141 |
String insert = "insert into systemMetadataReplicationStatus " +
|
|
1141 |
String insert = "insert into smReplicationStatus " +
|
|
1142 | 1142 |
"(guid, member_node, status, date_verified) " + |
1143 | 1143 |
"values (?, ?, ?, ?)"; |
1144 | 1144 |
PreparedStatement insertStatement = dbConn.prepareStatement(insert); |
... | ... | |
1152 | 1152 |
insertStatement.setString(3, status); |
1153 | 1153 |
insertStatement.setDate(4, sqlDate); |
1154 | 1154 |
|
1155 |
logMetacat.debug("systemMetadataReplicationStatus sql: " + insertStatement.toString());
|
|
1155 |
logMetacat.debug("smReplicationStatus sql: " + insertStatement.toString());
|
|
1156 | 1156 |
|
1157 | 1157 |
//execute |
1158 | 1158 |
int rows = insertStatement.executeUpdate(); |
... | ... | |
1735 | 1735 |
rows = stmt.executeUpdate(); |
1736 | 1736 |
stmt.close(); |
1737 | 1737 |
|
1738 |
// remove the systemMetadataReplicationPolicy
|
|
1739 |
query = "delete from systemMetadataReplicationPolicy " +
|
|
1738 |
// remove the smReplicationPolicy
|
|
1739 |
query = "delete from smReplicationPolicy " +
|
|
1740 | 1740 |
"where guid = ?"; |
1741 | 1741 |
stmt = dbConn.prepareStatement(query); |
1742 | 1742 |
stmt.setString(1, guid); |
1743 |
logMetacat.debug("delete systemMetadataReplicationPolicy: " + stmt.toString());
|
|
1743 |
logMetacat.debug("delete smReplicationPolicy: " + stmt.toString());
|
|
1744 | 1744 |
rows = stmt.executeUpdate(); |
1745 | 1745 |
stmt.close(); |
1746 | 1746 |
|
1747 |
// remove the systemMetadataReplicationStatus
|
|
1748 |
query = "delete from systemMetadataReplicationStatus " +
|
|
1747 |
// remove the smReplicationStatus
|
|
1748 |
query = "delete from smReplicationStatus " +
|
|
1749 | 1749 |
"where guid = ?"; |
1750 | 1750 |
stmt = dbConn.prepareStatement(query); |
1751 | 1751 |
stmt.setString(1, guid); |
1752 |
logMetacat.debug("delete systemMetadataReplicationStatus: " + stmt.toString());
|
|
1752 |
logMetacat.debug("delete smReplicationStatus: " + stmt.toString());
|
|
1753 | 1753 |
rows = stmt.executeUpdate(); |
1754 | 1754 |
stmt.close(); |
1755 | 1755 |
|
Also available in: Unified diff
shorten the systemmetadata* table names for Oracle's 30 character limit. move version to 2.0.5. http://bugzilla.ecoinformatics.org/show_bug.cgi?id=5717