[jira] [Updated] (IGNITE-19919) org.apache.ignite.sql.ResultSet#close should close implicit transaction if any

2023-08-11 Thread Pavel Pereslegin (Jira)


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

Pavel Pereslegin updated IGNITE-19919:
--
Fix Version/s: 3.0.0-beta2

> 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
>  Components: sql
>Reporter: Alexander Lapin
>Assignee: Maksim Zhuravkov
>Priority: Major
>  Labels: ignite-3
> Fix For: 3.0.0-beta2
>
>  Time Spent: 1h
>  Remaining Estimate: 0h
>
> 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.
>  
> Repoducerers within org.apache.ignite.internal.sql.api.ItSqlSynchronousApiTest
> {code:java}
> @Test
> public void resultSetCloseShouldFinishImplicitTransacion() throws 
> InterruptedException {
> sql("CREATE TABLE TEST(ID INT PRIMARY KEY, VAL0 INT)");
> for (int i = 0; i < ROW_COUNT; ++i) {
> sql("INSERT INTO TEST VALUES (?, ?)", i, i);
> }
> IgniteSql sql = igniteSql();
> Session ses = sql.sessionBuilder().defaultPageSize(2).build();
> ResultSet rs = ses.execute(null, "SELECT * FROM TEST");
> assertEquals(1, ((IgniteImpl) 
> CLUSTER_NODES.get(0)).txManager().pending());
> rs.close();
> assertEquals(0, ((IgniteImpl) 
> CLUSTER_NODES.get(0)).txManager().pending());
> }{code}
> and
> {code:java}
> @Test
> public void 
> resultSetCloseShouldFinishImplicitTransacionWithCursorTouchAfterClose() 
> throws InterruptedException {
> sql("CREATE TABLE TEST(ID INT PRIMARY KEY, VAL0 INT)");
> for (int i = 0; i < ROW_COUNT; ++i) {
> sql("INSERT INTO TEST VALUES (?, ?)", i, i);
> }
> IgniteSql sql = igniteSql();
> Session ses = sql.sessionBuilder().defaultPageSize(2).build();
> ResultSet rs = ses.execute(null, "SELECT * FROM TEST");
> assertEquals(1, ((IgniteImpl) 
> CLUSTER_NODES.get(0)).txManager().pending());
>     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}
> Please, pay attention, that 
> resultSetCloseShouldFinishImplicitTransacionWithCursorTouchAfterClose faisl 
> only if client is used as entry point, meaning within 
> ItSqlClientSynchronousApiTest only, but 
> resultSetCloseShouldFinishImplicitTransacion fails both for client and 
> server, meaning both for ItSqlClientSynchronousApiTest and 
> ItSqlSynchronousApiTest.



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


[jira] [Updated] (IGNITE-19919) org.apache.ignite.sql.ResultSet#close should close implicit transaction if any

2023-07-05 Thread Alexander Lapin (Jira)


 [ 
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.

 

Repoducerers within org.apache.ignite.internal.sql.api.ItSqlSynchronousApiTest
{code:java}
@Test
public void resultSetCloseShouldFinishImplicitTransacion() throws 
InterruptedException {
sql("CREATE TABLE TEST(ID INT PRIMARY KEY, VAL0 INT)");
for (int i = 0; i < ROW_COUNT; ++i) {
sql("INSERT INTO TEST VALUES (?, ?)", i, i);
}

IgniteSql sql = igniteSql();
Session ses = sql.sessionBuilder().defaultPageSize(2).build();

ResultSet rs = ses.execute(null, "SELECT * FROM TEST");
assertEquals(1, ((IgniteImpl) CLUSTER_NODES.get(0)).txManager().pending());
rs.close();
assertEquals(0, ((IgniteImpl) CLUSTER_NODES.get(0)).txManager().pending());
}{code}
and
{code:java}
@Test
public void 
resultSetCloseShouldFinishImplicitTransacionWithCursorTouchAfterClose() throws 
InterruptedException {
sql("CREATE TABLE TEST(ID INT PRIMARY KEY, VAL0 INT)");
for (int i = 0; i < ROW_COUNT; ++i) {
sql("INSERT INTO TEST VALUES (?, ?)", i, i);
}

IgniteSql sql = igniteSql();
Session ses = sql.sessionBuilder().defaultPageSize(2).build();

ResultSet rs = ses.execute(null, "SELECT * FROM TEST");
assertEquals(1, ((IgniteImpl) CLUSTER_NODES.get(0)).txManager().pending());
    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}
Please, pay attention, that 
resultSetCloseShouldFinishImplicitTransacionWithCursorTouchAfterClose faisl 
only if client is used as entry point, meaning within 
ItSqlClientSynchronousApiTest only, but 
resultSetCloseShouldFinishImplicitTransacion fails both for client and server, 
meaning both for ItSqlClientSynchronousApiTest and ItSqlSynchronousApiTest.

  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.

 

Repoducerers within org.apache.ignite.internal.sql.api.ItSqlSynchronousApiTest
{code:java}
@Test
public void resultSetCloseShouldFinishImplicitTransacion() throws 
InterruptedException {
sql("CREATE TABLE TEST(ID INT PRIMARY KEY, VAL0 INT)");
for (int i = 0; i < ROW_COUNT; ++i) {
sql("INSERT INTO TEST VALUES (?, ?)", i, i);
}

IgniteSql sql = igniteSql();
Session ses = sql.sessionBuilder().defaultPageSize(2).build();

ResultSet rs = ses.execute(null, "SELECT * FROM TEST");
assertEquals(1, ((IgniteImpl) CLUSTER_NODES.get(0)).txManager().pending());
rs.close();
assertEquals(0, ((IgniteImpl) CLUSTER_NODES.get(0)).txManager().pending());
}{code}
and
@Test
public void 
resultSetCloseShouldFinishImplicitTransacionWithCursorTouchAfterClose() throws 
InterruptedException \{
sql("CREATE TABLE TEST(ID INT PRIMARY KEY, VAL0 INT)");
for (int i = 0; i < ROW_COUNT; ++i) {
sql("INSERT INTO TEST VALUES (?, ?)", i, i);
}

IgniteSql sql = igniteSql();
Session ses = sql.sessionBuilder().defaultPageSize(2).build();

ResultSet rs = ses.execute(null, "SELECT * FROM TEST");
assertEquals(1, ((IgniteImpl)CLUSTER_NODES.get(0)).txManager().pending());
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());
}
Please, pay attention, that 
resultSetCloseShouldFinishImplicitTransacionWithCursorTouchAfterClose faisl 
only if client is used as entry point, meaning within 
ItSqlClientSynchronousApiTest only, but 
resultSetCloseShouldFinishImplicitTransacion fails both for client and server, 
meaning both for ItSqlClientSynchronousApiTest and ItSqlSynchronousApiTest.


> 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
>  Components: sql
>Reporter: 

[jira] [Updated] (IGNITE-19919) org.apache.ignite.sql.ResultSet#close should close implicit transaction if any

2023-07-05 Thread Alexander Lapin (Jira)


 [ 
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.

 

Repoducerers within org.apache.ignite.internal.sql.api.ItSqlSynchronousApiTest
{code:java}
@Test
public void resultSetCloseShouldFinishImplicitTransacion() throws 
InterruptedException {
sql("CREATE TABLE TEST(ID INT PRIMARY KEY, VAL0 INT)");
for (int i = 0; i < ROW_COUNT; ++i) {
sql("INSERT INTO TEST VALUES (?, ?)", i, i);
}

IgniteSql sql = igniteSql();
Session ses = sql.sessionBuilder().defaultPageSize(2).build();

ResultSet rs = ses.execute(null, "SELECT * FROM TEST");
assertEquals(1, ((IgniteImpl) CLUSTER_NODES.get(0)).txManager().pending());
rs.close();
assertEquals(0, ((IgniteImpl) CLUSTER_NODES.get(0)).txManager().pending());
}{code}
and
@Test
public void 
resultSetCloseShouldFinishImplicitTransacionWithCursorTouchAfterClose() throws 
InterruptedException \{
sql("CREATE TABLE TEST(ID INT PRIMARY KEY, VAL0 INT)");
for (int i = 0; i < ROW_COUNT; ++i) {
sql("INSERT INTO TEST VALUES (?, ?)", i, i);
}

IgniteSql sql = igniteSql();
Session ses = sql.sessionBuilder().defaultPageSize(2).build();

ResultSet rs = ses.execute(null, "SELECT * FROM TEST");
assertEquals(1, ((IgniteImpl)CLUSTER_NODES.get(0)).txManager().pending());
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());
}
Please, pay attention, that 
resultSetCloseShouldFinishImplicitTransacionWithCursorTouchAfterClose faisl 
only if client is used as entry point, meaning within 
ItSqlClientSynchronousApiTest only, but 
resultSetCloseShouldFinishImplicitTransacion fails both for client and server, 
meaning both for ItSqlClientSynchronousApiTest and ItSqlSynchronousApiTest.

  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.

 

Repoducer within org.apache.ignite.internal.sql.api.ItSqlSynchronousApiTest
{code:java}
@Test
public void resultSetCloseShouldFinishImplicitTransacion() throws 
InterruptedException {
sql("CREATE TABLE TEST(ID INT PRIMARY KEY, VAL0 INT)");
for (int i = 0; i < ROW_COUNT; ++i) {
sql("INSERT INTO TEST VALUES (?, ?)", i, i);
}

IgniteSql sql = igniteSql();
Session ses = sql.sessionBuilder().defaultPageSize(2).build();

ResultSet rs = ses.execute(null, "SELECT * FROM TEST");
assertEquals(1, ((IgniteImpl) CLUSTER_NODES.get(0)).txManager().pending());
rs.close();
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
>  Components: sql
>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.
>  
> Repoducerers within org.apache.ignite.internal.sql.api.ItSqlSynchronousApiTest
> {code:java}
> @Test
> public void resultSetCloseShouldFinishImplicitTransacion() throws 
> InterruptedException {
> sql("CREATE TABLE TEST(ID INT PRIMARY KEY, VAL0 INT)");
> for (int i = 0; i < ROW_COUNT; ++i) {
> sql("INSERT INTO TEST VALUES (?, ?)", i, i);
> }
> IgniteSql sql = igniteSql();
> Session ses = sql.sessionBuilder().defaultPageSize(2).build();
> ResultSet rs = ses.execute(null, "SELECT * FROM TEST");
> assertEquals(1, ((IgniteImpl) 
> CLUSTER_NODES.get(0)).txManager().pending());
> rs.close();
> assertEquals(0, ((IgniteImpl) 
> CLUSTER_NODES.get(0)).txManager().pending());
> }{code}
> and
> @Test
> public void 
> resultSetCloseShouldFinishImplicitTransacionWithCursorTouchAfterClose() 
> throws 

[jira] [Updated] (IGNITE-19919) org.apache.ignite.sql.ResultSet#close should close implicit transaction if any

2023-07-05 Thread Alexander Lapin (Jira)


 [ 
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.

 

Repoducer within org.apache.ignite.internal.sql.api.ItSqlSynchronousApiTest
{code:java}
@Test
public void resultSetCloseShouldFinishImplicitTransacion() throws 
InterruptedException {
sql("CREATE TABLE TEST(ID INT PRIMARY KEY, VAL0 INT)");
for (int i = 0; i < ROW_COUNT; ++i) {
sql("INSERT INTO TEST VALUES (?, ?)", i, i);
}

IgniteSql sql = igniteSql();
Session ses = sql.sessionBuilder().defaultPageSize(2).build();

ResultSet rs = ses.execute(null, "SELECT * FROM TEST");
assertEquals(1, ((IgniteImpl) CLUSTER_NODES.get(0)).txManager().pending());
rs.close();
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
>  Components: sql
>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.
>  
> Repoducer within org.apache.ignite.internal.sql.api.ItSqlSynchronousApiTest
> {code:java}
> @Test
> public void resultSetCloseShouldFinishImplicitTransacion() throws 
> InterruptedException {
> sql("CREATE TABLE TEST(ID INT PRIMARY KEY, VAL0 INT)");
> for (int i = 0; i < ROW_COUNT; ++i) {
> sql("INSERT INTO TEST VALUES (?, ?)", i, i);
> }
> IgniteSql sql = igniteSql();
> Session ses = sql.sessionBuilder().defaultPageSize(2).build();
> ResultSet rs = ses.execute(null, "SELECT * FROM TEST");
> assertEquals(1, ((IgniteImpl) 
> CLUSTER_NODES.get(0)).txManager().pending());
> rs.close();
> assertEquals(0, ((IgniteImpl) 
> CLUSTER_NODES.get(0)).txManager().pending());
> }{code}



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


[jira] [Updated] (IGNITE-19919) org.apache.ignite.sql.ResultSet#close should close implicit transaction if any

2023-07-05 Thread Konstantin Orlov (Jira)


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

Konstantin Orlov updated IGNITE-19919:
--
Component/s: sql

> 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
>  Components: sql
>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)


[jira] [Updated] (IGNITE-19919) org.apache.ignite.sql.ResultSet#close should close implicit transaction if any

2023-07-05 Thread Alexander Lapin (Jira)


 [ 
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)