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

James Taylor commented on PHOENIX-1559:
---------------------------------------

[~gabriel.reid] - one tweak to this commit that might make it feasible for new 
users to have auto-commit be on by default: In this code:
{code}
+    public static boolean getAutoCommit(String url, Properties info) {
+        String autoCommit = findProperty(url, info, 
PhoenixRuntime.AUTO_COMMIT_ATTRIB);
+        return Boolean.valueOf(autoCommit);
+    }
{code}
instead of mapping a null autoCommit to false, look for the 
PhoenixRuntime.AUTO_COMMIT_ATTRIB in the QueryServices props, like this so that 
it'll default based on the property from the config or from connection property 
if specified.
{code}
    Boolean autoCommit = null;
    String autoCommitStr = findProperty(url, info, 
PhoenixRuntime.AUTO_COMMIT_ATTRIB);
    if (autoCommitStr != null) {
        autoCommit = Boolean.valueOf(autoCommitStr);
    }
    this.autoCommit = this.services.getProps().getBoolean(autoCommit, 
this.services.getProps().getBoolean(PhoenixRuntime.AUTO_COMMIT_ATTRIB, 
QueryServicesOptions.DEFAULT_AUTO_COMMIT));
{code}

> Allow specifying auto-commit mode in the connection URL or connection 
> properties
> --------------------------------------------------------------------------------
>
>                 Key: PHOENIX-1559
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-1559
>             Project: Phoenix
>          Issue Type: New Feature
>            Reporter: Gabriel Reid
>            Assignee: Gabriel Reid
>             Fix For: 5.0.0, 4.3
>
>         Attachments: PHOENIX-1559.patch
>
>
> As reported in PHOENIX-1543, the JDBC spec states that auto-commit should be 
> enabled on all newly-created connections, but Phoenix currently disables 
> auto-commit by default.
> Some "enterprise" JDBC tools assume that auto-commit is enabled on all new 
> connections, and don't work correctly unless it is.
> It would be useful if it was possible to explicitly turn on auto-commit by 
> supplying a setting in the connection URL or connection properties. This 
> would not only make it possible to work with tooling that assumes that all 
> JDBC drivers follow this spec, but it would also provide a kind of 
> backwards-compatibility mode once PHOENIX-1543 is implemented.



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

Reply via email to