You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by "dk2k (via GitHub)" <gi...@apache.org> on 2023/04/03 16:14:50 UTC

[GitHub] [camel] dk2k opened a new pull request, #9793: added try with resources for ArangoCursor

dk2k opened a new pull request, #9793:
URL: https://github.com/apache/camel/pull/9793

   Added try with resources for ArangoCursor.
   Why do I think it's needed? For a typical DB Connection, Statement we have logic: when a Connection gets closed, it closes all its Statements. 
   ArangoDatabase doen't implement Closeable/AutoCloseable. Hence it can't close implicitly its Cursors on closing.


-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel] github-actions[bot] commented on pull request #9793: added try with resources for ArangoCursor

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #9793:
URL: https://github.com/apache/camel/pull/9793#issuecomment-1494611856

   :star2: Thank you for your contribution to the Apache Camel project! :star2: 
   
   :warning: Please note that the changes on this PR may be **tested automatically**. 
   
   If necessary Apache Camel Committers may access logs and test results in the job summaries!


-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel] davsclaus merged pull request #9793: added try with resources for ArangoCursor

Posted by "davsclaus (via GitHub)" <gi...@apache.org>.
davsclaus merged PR #9793:
URL: https://github.com/apache/camel/pull/9793


-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel] davsclaus commented on pull request #9793: added try with resources for ArangoCursor

Posted by "davsclaus (via GitHub)" <gi...@apache.org>.
davsclaus commented on PR #9793:
URL: https://github.com/apache/camel/pull/9793#issuecomment-1495475727

   Maybe you just want to ignore the closing error, it may be logged as a WARN instead


-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel] github-actions[bot] commented on pull request #9793: added try with resources for ArangoCursor

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #9793:
URL: https://github.com/apache/camel/pull/9793#issuecomment-1494712636

   ### Components tested:
   
   | Total | Tested | Failed :x: | Passed :white_check_mark: | 
   | --- | --- | --- |  --- |
   | 1 | 1 | 0 | 1 |


-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel] dk2k commented on pull request #9793: added try with resources for ArangoCursor

Posted by "dk2k (via GitHub)" <gi...@apache.org>.
dk2k commented on PR #9793:
URL: https://github.com/apache/camel/pull/9793#issuecomment-1495504335

   @davsclaus fair point, changed to log message. Thanks


-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel] dk2k commented on a diff in pull request #9793: added try with resources for ArangoCursor

Posted by "dk2k (via GitHub)" <gi...@apache.org>.
dk2k commented on code in PR #9793:
URL: https://github.com/apache/camel/pull/9793#discussion_r1156823160


##########
components/camel-arangodb/src/main/java/org/apache/camel/component/arangodb/ArangoDbProducer.java:
##########
@@ -322,8 +323,11 @@ private Function<Exchange, Object> aqlQuery() {
                 resultClassType = resultClassType != null ? resultClassType : BaseDocument.class;
 
                 // perform query and return Collection
-                ArangoCursor<?> cursor = database.query(query, bindParameters, queryOptions, resultClassType);
-                return cursor == null ? null : cursor.asListRemaining();
+                try (ArangoCursor<?> cursor = database.query(query, bindParameters, queryOptions, resultClassType)) {
+                    return cursor == null ? null : cursor.asListRemaining();
+                } catch (IOException e) {
+                    throw new RuntimeCamelException("failed to close instance of ArangoCursor", e);

Review Comment:
   Fixed the capital letter



-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel] github-actions[bot] commented on pull request #9793: added try with resources for ArangoCursor

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #9793:
URL: https://github.com/apache/camel/pull/9793#issuecomment-1495601351

   ### Components tested:
   
   | Total | Tested | Failed :x: | Passed :white_check_mark: | 
   | --- | --- | --- |  --- |
   | 1 | 1 | 0 | 1 |


-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel] davsclaus commented on a diff in pull request #9793: added try with resources for ArangoCursor

Posted by "davsclaus (via GitHub)" <gi...@apache.org>.
davsclaus commented on code in PR #9793:
URL: https://github.com/apache/camel/pull/9793#discussion_r1156715374


##########
components/camel-arangodb/src/main/java/org/apache/camel/component/arangodb/ArangoDbProducer.java:
##########
@@ -322,8 +323,11 @@ private Function<Exchange, Object> aqlQuery() {
                 resultClassType = resultClassType != null ? resultClassType : BaseDocument.class;
 
                 // perform query and return Collection
-                ArangoCursor<?> cursor = database.query(query, bindParameters, queryOptions, resultClassType);
-                return cursor == null ? null : cursor.asListRemaining();
+                try (ArangoCursor<?> cursor = database.query(query, bindParameters, queryOptions, resultClassType)) {
+                    return cursor == null ? null : cursor.asListRemaining();
+                } catch (IOException e) {
+                    throw new RuntimeCamelException("failed to close instance of ArangoCursor", e);

Review Comment:
   "Failed to close ..."



-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org