phoenix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kylin Soong (JIRA)" <j...@apache.org>
Subject [jira] [Created] (PHOENIX-2176) JDBC AutoCommit is true, but can not AutoCommit the UPSERT
Date Wed, 12 Aug 2015 04:23:46 GMT
Kylin Soong created PHOENIX-2176:
------------------------------------

             Summary: JDBC AutoCommit is true, but can not AutoCommit the UPSERT
                 Key: PHOENIX-2176
                 URL: https://issues.apache.org/jira/browse/PHOENIX-2176
             Project: Phoenix
          Issue Type: Bug
    Affects Versions: 4.2.1
         Environment: - Phoenix 4.2.1
- hbase-0.98.8-hadoop2
            Reporter: Kylin Soong


Create TABLE DDL as below
{code}
CREATE TABLE IF NOT EXISTS \"smalla5\"(\"ROW_ID\" INTEGER PRIMARY KEY, \"cf5\".\"city\" VARCHAR)
{code}

Execute code
{code}
...
Connection conn = ...
boolean isAutoCommit = conn.getAutoCommit();
System.out.println(isAutoCommit);
{code}
the output is 'true', this hint the AutoCommit is enabled, but the UPSERT not save to table,
for example, continue execute
{code}
execute(conn, "UPSERT INTO  \"smalla5\" VALUES(6, '66')", false);
execute(conn, "SELECT * FROM \"smalla5\"", false);
close(conn);
{code}
the query result is empty.

If set AutoCommit to false, then commit manually then the UPSERT save to Table,for example
{code}
conn.setAutoCommit(false);
execute(conn, "UPSERT INTO  \"smalla5\" VALUES(5, '5')", false);
conn.commit();
conn.setAutoCommit(isAutoCommit);
execute(conn, "SELECT * FROM \"smalla5\"", false);
close(conn);
{code}

Does this should be a bug?



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message