[jboss-jira] [JBoss JIRA] (JBJCA-1392) Need to add checkTransaction handling for unwrap connection

Ivo Studensky (Jira) issues at jboss.org
Fri Aug 16 04:21:00 EDT 2019


     [ https://issues.jboss.org/browse/JBJCA-1392?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ivo Studensky moved JBEAP-17409 to JBJCA-1392:
----------------------------------------------

              Project: IronJacamar  (was: JBoss Enterprise Application Platform)
                  Key: JBJCA-1392  (was: JBEAP-17409)
             Workflow: classic default workflow  (was: CDW with loose statuses v1)
          Component/s: JDBC
                           (was: JCA)
    Affects Version/s:     (was: 7.2.0.GA)


> Need to add checkTransaction handling for unwrap connection
> -----------------------------------------------------------
>
>                 Key: JBJCA-1392
>                 URL: https://issues.jboss.org/browse/JBJCA-1392
>             Project: IronJacamar
>          Issue Type: Bug
>          Components: JDBC
>            Reporter: Ivo Studensky
>            Assignee: Ivo Studensky
>            Priority: Major
>              Labels: downstream_dependency
>
> _connection.setAutoCommit_  cannot affect _unwrap_ native connection. The following _mc.getAutoCommit_ result is true.
> {code}
> c = dataSource.getConnection();
> c.setAutoCommit(false);
> if (c.isWrapperFor(oracle.jdbc.OracleConnection.class)) {
>   mc = c.unwrap(oracle.jdbc.OracleConnection.class);
> }
> System.out.println("[JDBC 4 Wrapper] autoCommit : " + mc.getAutoCommit());
> {code}
> However,  the following _getUnderlyingConnection_ native connection result is false.
> {code}
> c = dataSource.getConnection();
> c.setAutoCommit(false);
> WrappedConnection wc = (WrappedConnection)c;
> oracle.jdbc.OracleConnection mc = (oracle.jdbc.OracleConnection)wc.getUnderlyingConnection();
> System.out.println("[org.jboss.ironjacamar.jdbcadapters WrappedConnection] autoCommit : " + mc.getAutoCommit());
> {code}
> The _getUnderlyingConnection_ method call _BaseWrapperManagedConnection.checkTransaction_ process, but there is no similar process in _unwrap_ method.
> {code:title=org/jboss/jca/adapters/jdbc/BaseWrapperManagedConnection.java|borderStyle=solid}
>    void checkTransaction() throws SQLException
>    {
>       synchronized (stateLock)
>       {
>          if (inManagedTransaction)
>             return;
>          // Check autocommit
>          if (jdbcAutoCommit != underlyingAutoCommit)
>          {
>             con.setAutoCommit(jdbcAutoCommit);
>             underlyingAutoCommit = jdbcAutoCommit;
>          }
>       }
> {code}



--
This message was sent by Atlassian Jira
(v7.12.1#712002)


More information about the jboss-jira mailing list