You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by am...@apache.org on 2021/09/03 12:51:53 UTC

[ignite-3] branch ignite-15212 updated: Minor.

This is an automated email from the ASF dual-hosted git repository.

amashenkov pushed a commit to branch ignite-15212
in repository https://gitbox.apache.org/repos/asf/ignite-3.git


The following commit(s) were added to refs/heads/ignite-15212 by this push:
     new 8249c24  Minor.
8249c24 is described below

commit 8249c24b21c99bc61dc3d2f0d625277ba23caa28
Author: Andrew Mashenkov <an...@gmail.com>
AuthorDate: Fri Sep 3 15:51:38 2021 +0300

    Minor.
---
 modules/sql/src/test/java/SqlTest.java | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/modules/sql/src/test/java/SqlTest.java b/modules/sql/src/test/java/SqlTest.java
index 4b1d1e1..c983ffe 100644
--- a/modules/sql/src/test/java/SqlTest.java
+++ b/modules/sql/src/test/java/SqlTest.java
@@ -64,21 +64,25 @@ public class SqlTest {
     public void testSynchronousSql() {
         igniteTx.runInTransaction(tx -> {
             SqlSession sess = queryMgr.session();
+            SqlTx sqlTx = queryMgr.session().withTransaction(tx);
+            SqlTx sqlTx = queryMgr.session().withNewTransaction();
+//            SqlSession sess = queryMgr.txSession(tx);
+//            SqlSession sess = tx.sqlSession();
 
-//            sess.setParameter("forceJoinOrder", true);
+            sess.setParameter("queryTimeout", 10_000); // Set default timeout.
 //            sess.setParameter("useIndexHint", "idx1"); TODO: Where to move query hints?
 
 
-            SqlResultSet rs = sess.executeQuery("INSERT INTO table VALUES (?, ?)", tx, 10, "str%");
+            SqlResultSet rs = sess.executeQuery("INSERT INTO table VALUES (?, ?)", 10, "str%");
 
-            SqlResultSet rs = sess.executeQuery("SELECT id, val FROM table WHERE id < {} AND val LIKE {};", tx, 10, "str%");
+            SqlResultSet rs = sqlTx.executeQuery("SELECT id, val FROM table WHERE id < {} AND val LIKE {};", 10, "str%");
 
             for (SqlRow r : rs) {
                 assertTrue(10 > r.longValue("id"));
                 assertTrue((r.stringValue("val")).startsWith("str"));
             }
 
-            tx.commit();
+            sqlTx.commit();
         });
 
         Mockito.verify(tx).commit();