Skip to content

Commit

Permalink
fixTest
Browse files Browse the repository at this point in the history
  • Loading branch information
Yingjian Wu committed Jun 2, 2024
1 parent c2adfdf commit 15f652a
Showing 1 changed file with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -100,22 +100,26 @@ public void createParentChildRelation(final QualifiedName parentName,
@Override
public void rename(final QualifiedName oldName, final QualifiedName newName) {
try {
retryTemplate.execute((RetryCallback<Void, RuntimeException>) context -> {
jdbcTemplate.update(connection -> {
// Retry for renaming the Parent Entity
retryTemplate.execute((RetryCallback<Integer, RuntimeException>) context -> {
return jdbcTemplate.update(connection -> {
// Rename Parent Entity
final PreparedStatement renameParentPS = connection.prepareStatement(SQL_RENAME_PARENT_ENTITY);
renameParentPS.setString(1, newName.toString());
renameParentPS.setString(2, oldName.toString());
renameParentPS.executeUpdate();
return renameParentPS;
});
});

// Retry for renaming the Child Entity
retryTemplate.execute((RetryCallback<Integer, RuntimeException>) context -> {
return jdbcTemplate.update(connection -> {
// Rename Child Entity
final PreparedStatement renameChildPS = connection.prepareStatement(SQL_RENAME_CHILD_ENTITY);
renameChildPS.setString(1, newName.toString());
renameChildPS.setString(2, oldName.toString());
renameChildPS.executeUpdate();
return null;
return renameChildPS;
});
return null;
});
} catch (RuntimeException e) {
log.error("Failed to rename entity", e);
Expand Down

0 comments on commit 15f652a

Please sign in to comment.