[ 
https://issues.apache.org/jira/browse/IGNITE-19919?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Alexander Lapin updated IGNITE-19919:
-------------------------------------
    Description: 
At the current moment, the transaction will be closed only if the cursor has 
read all the data:
{code:java}
org.apache.ignite.internal.sql.engine.AsyncSqlCursorImpl#requestNextAsync{code}
in the case of an explicit ResultSet.close() call, the transaction will not be 
closed.

 

Following part of 
org.apache.ignite.internal.sql.api.ItSqlSynchronousApiTest#errors is a 
reproducer:
{code:java}
// Cursor closed error.
{
    ResultSet rs = ses.execute(null, "SELECT * FROM TEST");
    Thread.sleep(300); // ResultSetImpl fetches next page in background, wait 
to it to complete to avoid flakiness.
    rs.close();
    assertThrowsWithCause(() -> rs.forEachRemaining(Object::hashCode), 
CursorClosedException.class);
}

assertEquals(0, ((IgniteImpl)CLUSTER_NODES.get(0)).txManager().pending()); 
{code}
 

  was:
At the current moment, the transaction will be closed only if the cursor has 
read all the data:
{code:java}
org.apache.ignite.internal.sql.engine.AsyncSqlCursorImpl#requestNextAsync{code}
in the case of an explicit ResultSet.close() call, the transaction will not be 
closed.

 

Following part of 
org.apache.ignite.internal.sql.api.ItSqlSynchronousApiTest#errors is a 
reproducer:

 
{code:java}
// Cursor closed error.
{
    ResultSet rs = ses.execute(null, "SELECT * FROM TEST");
    Thread.sleep(300); // ResultSetImpl fetches next page in background, wait 
to it to complete to avoid flakiness.
    rs.close();
    assertThrowsWithCause(() -> rs.forEachRemaining(Object::hashCode), 
CursorClosedException.class);
}

assertEquals(0, ((IgniteImpl)CLUSTER_NODES.get(0)).txManager().pending()); 
{code}
 


> org.apache.ignite.sql.ResultSet#close should close implicit transaction if any
> ------------------------------------------------------------------------------
>
>                 Key: IGNITE-19919
>                 URL: https://issues.apache.org/jira/browse/IGNITE-19919
>             Project: Ignite
>          Issue Type: Bug
>            Reporter: Alexander Lapin
>            Priority: Major
>              Labels: ignite-3
>
> At the current moment, the transaction will be closed only if the cursor has 
> read all the data:
> {code:java}
> org.apache.ignite.internal.sql.engine.AsyncSqlCursorImpl#requestNextAsync{code}
> in the case of an explicit ResultSet.close() call, the transaction will not 
> be closed.
>  
> Following part of 
> org.apache.ignite.internal.sql.api.ItSqlSynchronousApiTest#errors is a 
> reproducer:
> {code:java}
> // Cursor closed error.
> {
>     ResultSet rs = ses.execute(null, "SELECT * FROM TEST");
>     Thread.sleep(300); // ResultSetImpl fetches next page in background, wait 
> to it to complete to avoid flakiness.
>     rs.close();
>     assertThrowsWithCause(() -> rs.forEachRemaining(Object::hashCode), 
> CursorClosedException.class);
> }
> assertEquals(0, ((IgniteImpl)CLUSTER_NODES.get(0)).txManager().pending()); 
> {code}
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to