[
https://issues.apache.org/jira/browse/CALCITE-2702?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16713245#comment-16713245
]
Julian Hyde commented on CALCITE-2702:
--------------------------------------
[~zabetak] I think DriverManager.getConnection does create a connection. But if
you are using a connection pool on top them it probably won't call
getConnection each time.
Bottom line is, it should work. Any sub-class of AvaticaConnection that does
not support commits should just no-op on commit and rollback.
In the particular case of CalciteMetaImpl, commit() should look at its own
DatabaseMetaData to figure out whether to throw.
> Invalid commit()/rollback() behavior on JDBC connection
> -------------------------------------------------------
>
> Key: CALCITE-2702
> URL: https://issues.apache.org/jira/browse/CALCITE-2702
> Project: Calcite
> Issue Type: Bug
> Components: jdbc-adapter
> Affects Versions: 1.17.0
> Reporter: Dirk Mahler
> Assignee: Julian Hyde
> Priority: Major
>
> We're using Tibco Spotfire with a Calcite enabled JDBC driver as a pooled
> datasource. There is an issue that the Spotfire connection pool rans out of
> connections quite fast and we could track it down to the behavior of
> org.apache.calcite.avatica.AvaticaConnection#commit. This delegates to
> org.apache.calcite.jdbc.CalciteMetaImpl#commit which throws an
> UnsupportedOperationException.
> It looks like that this behavior is not correct: according to the JavaDoc of
> java.sql.DatabaseMetaData#supportsTransactions a JDBC driver should treat
> commit as a NOOP if the database (or in this case the driver) does not
> support transactions:
> {noformat}
> /**
> * Retrieves whether this database supports transactions. If not, invoking the
> * method <code>commit</code> is a noop, and the isolation level is
> * <code>TRANSACTION_NONE</code>.
> *
> * @return <code>true</code> if transactions are supported;
> * <code>false</code> otherwise
> * @exception SQLException if a database access error occurs
> */
> boolean supportsTransactions() throws SQLException;{noformat}
>
>
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)