fjtirado commented on code in PR #3441:
URL: 
https://github.com/apache/incubator-kie-kogito-runtimes/pull/3441#discussion_r1526038707


##########
addons/common/persistence/jdbc/src/main/java/org/kie/kogito/persistence/jdbc/GenericRepository.java:
##########
@@ -140,6 +143,19 @@ Optional<Record> findByIdInternal(String processId, String 
processVersion, UUID
         return Optional.empty();
     }
 
+    @Override
+    Optional<Record> findByBusinessKey(String processId, String 
processVersion, String businessKey) {
+        try (Connection connection = dataSource.getConnection();
+                PreparedStatement statement = 
connection.prepareStatement(FIND_BY_BUSINESS_KEY)) {
+            statement.setString(1, businessKey);
+            try (ResultSet resultSet = statement.executeQuery()) {
+                return resultSet.next() ? Optional.of(from(resultSet)) : 
Optional.empty();
+            }
+        } catch (Exception e) {
+            throw uncheckedException(e, "Error finding process instance using 
business key %s", businessKey);

Review Comment:
   Well, here, I leave processId and processVersion in the interface in case in 
future we change from globally unique (per db) business key to process id 
unique business key (so we do not have to change the interface, just the 
schema), but right now, as you can see, these two parameters are unused, so I 
think logging them might be confusing



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to