[ 
https://issues.apache.org/jira/browse/IGNITE-10506?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16707097#comment-16707097
 ] 

Stanislav Lukyanov commented on IGNITE-10506:
---------------------------------------------

Let's have the following docs:
- In the Javadoc: 
-- QueryCursor::close is fine as it is
-- IgniteCache::query should mention that the returned QueryCursor may need to 
be closed
-- Query's class-level Javadoc should mention that the QueryCursor obtained 
from IgniteCache.query(Query) may need to be closed, and that each subclass of 
Query defines its own behavior for closing the cursor and resource management
-- All Query subclasses (SqlQuery, SqlFieldsQuery, ContinuousQuery, ScanQuery, 
TextQuery, anything else?) should describe the behavior of closing their cursor
- On the readme.io: 
-- Query API page (https://apacheignite.readme.io/docs/cache-queries) should 
describe that cursors need to be closed and how to do that using 
try-with-resources
{code}
try (QueryCursor<?> cursor = cache.query(query)) {
    // ...
}
{code}
+ it should have a reference to the Javadoc
--- SQL Java API page (https://apacheignite-sql.readme.io/docs/java-sql-api) 
should mentioned that the cursors need to be closed and refer the Query API page

> Emphasize the need to close the query cursors in docs
> -----------------------------------------------------
>
>                 Key: IGNITE-10506
>                 URL: https://issues.apache.org/jira/browse/IGNITE-10506
>             Project: Ignite
>          Issue Type: Bug
>          Components: documentation
>            Reporter: Stanislav Lukyanov
>            Priority: Major
>
> Currently the need to close query cursors is mentioned only in two places:
> - Queries docs on readme.io: 
> https://apacheignite.readme.io/docs/cache-queries#section-querycursor
> - QueryCursor::close javadoc 
> https://ignite.apache.org/releases/latest/javadoc/org/apache/ignite/cache/query/QueryCursor.html#close--
> A failure to close a cursor may lead to severe resource leaks. It seems 
> reasonable to better emphasize and explain how to approach cursors closing. 
> Most importantly, we need to have a mention of that in the Java API secton of 
> SQL readme.io docs (https://apacheignite-sql.readme.io/docs/java-sql-api).



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to