1135 |
1135 |
int deletedCount = stmt.executeUpdate();
|
1136 |
1136 |
stmt.close();
|
1137 |
1137 |
|
1138 |
|
for (Replica replica: replicas) {
|
1139 |
|
// Execute the insert statement
|
1140 |
|
String insert = "insert into systemMetadataReplicationStatus " +
|
1141 |
|
"(guid, member_node, status, date_verified) " +
|
1142 |
|
"values (?, ?, ?, ?)";
|
1143 |
|
PreparedStatement insertStatement = dbConn.prepareStatement(insert);
|
1144 |
|
|
1145 |
|
//data values
|
1146 |
|
String memberNode = replica.getReplicaMemberNode().getValue();
|
1147 |
|
String status = replica.getReplicationStatus().toString();
|
1148 |
|
java.sql.Date sqlDate = new java.sql.Date(replica.getReplicaVerified().getTime());
|
1149 |
|
insertStatement.setString(1, guid);
|
1150 |
|
insertStatement.setString(2, memberNode);
|
1151 |
|
insertStatement.setString(3, status);
|
1152 |
|
insertStatement.setDate(4, sqlDate);
|
1153 |
|
|
1154 |
|
//execute
|
1155 |
|
int rows = insertStatement.executeUpdate();
|
1156 |
|
insertStatement.close();
|
1157 |
|
}
|
|
1138 |
if (replicas != null) {
|
|
1139 |
for (Replica replica: replicas) {
|
|
1140 |
// Execute the insert statement
|
|
1141 |
String insert = "insert into systemMetadataReplicationStatus " +
|
|
1142 |
"(guid, member_node, status, date_verified) " +
|
|
1143 |
"values (?, ?, ?, ?)";
|
|
1144 |
PreparedStatement insertStatement = dbConn.prepareStatement(insert);
|
|
1145 |
|
|
1146 |
//data values
|
|
1147 |
String memberNode = replica.getReplicaMemberNode().getValue();
|
|
1148 |
String status = replica.getReplicationStatus().toString();
|
|
1149 |
java.sql.Date sqlDate = new java.sql.Date(replica.getReplicaVerified().getTime());
|
|
1150 |
insertStatement.setString(1, guid);
|
|
1151 |
insertStatement.setString(2, memberNode);
|
|
1152 |
insertStatement.setString(3, status);
|
|
1153 |
insertStatement.setDate(4, sqlDate);
|
|
1154 |
|
|
1155 |
//execute
|
|
1156 |
int rows = insertStatement.executeUpdate();
|
|
1157 |
insertStatement.close();
|
|
1158 |
}
|
|
1159 |
}
|
1158 |
1160 |
} catch (SQLException e) {
|
1159 |
1161 |
logMetacat.error("SQL error while adding systemMetadataReplicationStatus for: " + guid, e);
|
1160 |
1162 |
} finally {
|
check for null pointers when adding system metadata/creating records during cn.create()