Skip to content

Commit 3eb9cb5

Browse files
authored
add logs to wfDAO (#231)
1 parent db45bf5 commit 3eb9cb5

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

transact/src/main/java/dev/dbos/transact/database/WorkflowDAO.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ public Optional<String> getWorkflowResult(String workflowId) throws SQLException
3939
throw new IllegalStateException("Database is closed!");
4040
}
4141

42+
logger.debug("getWorkflowResult {}", workflowId);
43+
4244
String sql =
4345
"""
4446
SELECT status, output, error FROM %s.workflow_status WHERE workflow_uuid = ?;
@@ -72,7 +74,7 @@ public Optional<String> getWorkflowResult(String workflowId) throws SQLException
7274
}
7375

7476
} catch (SQLException e) {
75-
logger.error("Error getting workflow result", e);
77+
logger.error("Error getting workflow {} result", workflowId, e);
7678
throw e;
7779
}
7880
}
@@ -83,6 +85,8 @@ public WorkflowInitResult initWorkflowStatus(
8385
throw new IllegalStateException("Database is closed!");
8486
}
8587

88+
logger.debug("initWorkflowStatus workflowId {}", initStatus.workflowId());
89+
8690
try (Connection connection = dataSource.getConnection()) {
8791

8892
try {
@@ -157,6 +161,8 @@ public InsertWorkflowResult insertWorkflowStatus(
157161
throw new IllegalStateException("Database is closed!");
158162
}
159163

164+
logger.debug("insertWorkflowStatus workflowId {}", status.workflowId());
165+
160166
String insertSQL =
161167
"""
162168
INSERT INTO %s.workflow_status (
@@ -257,6 +263,8 @@ public void updateWorkflowOutcome(
257263
throw new IllegalStateException("Database is closed!");
258264
}
259265

266+
logger.debug("updateWorkflowOutcome wfid {} status {}", workflowId, status);
267+
260268
// Note that transitions from CANCELLED to SUCCESS or ERROR are forbidden
261269
var sql =
262270
"""

0 commit comments

Comments
 (0)