Github user JamesRTaylor commented on a diff in the pull request:
https://github.com/apache/incubator-phoenix/pull/22#discussion_r10850911
--- Diff:
phoenix-pig/src/main/java/org/apache/phoenix/pig/PhoenixPigConfiguration.java
---
@@ -86,16 +87,24 @@ public void configure(String server, String tableName,
long batchSize) {
* @throws SQLException
*/
public Connection getConnection() throws SQLException {
- Properties props = new Properties();
- conn =
DriverManager.getConnection(QueryUtil.getUrl(this.conf.get(SERVER_NAME)),
props).unwrap(PhoenixConnection.class);
- conn.setAutoCommit(false);
-
- setup(conn);
-
- return conn;
+ return this.getConnection(true);
}
/**
+ * Creates a {@link Connection} with autoCommit set to false.
+ * @throws SQLException
+ */
+ public Connection getConnection(boolean doSetup) throws SQLException {
+ Properties props = new Properties();
+ conn =
DriverManager.getConnection(QueryUtil.getUrl(this.conf.get(SERVER_NAME)),
props).unwrap(PhoenixConnection.class);
--- End diff --
Do you need to unwrap the Connection to its impl here? If not, then I
wouldn't do that.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---