Uploaded image for project: 'MariaDB Connector/J'
  1. MariaDB Connector/J
  2. CONJ-347

SQL syntax error generated by setTransactionIsolation() call

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • 1.5.2
    • 1.5.3
    • Other
    • None

    Description

      Same exact code works with 1.4.6 version but with 1.5.2 it fails with:

      SQLNonTransientException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
      Query is : SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED DSRA0010E: SQL State = 42000, Error Code = 1,064
      

      Here's the full stack trace:

      Caused by: java.sql.SQLNonTransientException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
      Query is : SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED DSRA0010E: SQL State = 42000, Error Code = 1,064
      	at org.mariadb.jdbc.internal.util.ExceptionMapper.get(ExceptionMapper.java:125)
      	at org.mariadb.jdbc.internal.util.ExceptionMapper.throwException(ExceptionMapper.java:69)
      	at org.mariadb.jdbc.MariaDbConnection.setTransactionIsolation(MariaDbConnection.java:805)
      	at com.ibm.ws.rsadapter.spi.WSRdbManagedConnectionImpl.setTransactionIsolation(WSRdbManagedConnectionImpl.java:4409)
      	at com.ibm.ws.rsadapter.spi.WSRdbManagedConnectionImpl.synchronizePropertiesWithCRI(WSRdbManagedConnectionImpl.java:2383)
      	at com.ibm.ws.rsadapter.spi.WSRdbManagedConnectionImpl.<init>(WSRdbManagedConnectionImpl.java:613)
      	at com.ibm.ws.rsadapter.spi.WSManagedConnectionFactoryImpl.createManagedConnection(WSManagedConnectionFactoryImpl.java:676)
      	at com.ibm.ejs.j2c.FreePool.createManagedConnectionWithMCWrapper(FreePool.java:1766)
      	at com.ibm.ejs.j2c.FreePool.createOrWaitForConnection(FreePool.java:1489)
      	at com.ibm.ejs.j2c.PoolManager.reserve(PoolManager.java:2903)
      	at com.ibm.ejs.j2c.PoolManager.reserve(PoolManager.java:2244)
      	at com.ibm.ejs.j2c.ConnectionManager.allocateMCWrapper(ConnectionManager.java:995)
      	at com.ibm.ejs.j2c.ConnectionManager.allocateConnection(ConnectionManager.java:643)
      	at com.ibm.ws.rsadapter.jdbc.WSJdbcDataSource.getConnection(WSJdbcDataSource.java:234)
      	at com.ibm.ws.rsadapter.jdbc.WSJdbcDataSource.getConnection(WSJdbcDataSource.java:205)
      	at org.apache.openjpa.lib.jdbc.DelegatingDataSource.getConnection(DelegatingDataSource.java:110)
      	at org.apache.openjpa.lib.jdbc.DecoratingDataSource.getConnection(DecoratingDataSource.java:87)
      	at org.apache.openjpa.jdbc.sql.DBDictionaryFactory.newDBDictionary(DBDictionaryFactory.java:91)
      	... 44 more
      Caused by: org.mariadb.jdbc.internal.util.dao.QueryException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
      Query is : SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED
      	at org.mariadb.jdbc.internal.protocol.AbstractQueryProtocol.getResult(AbstractQueryProtocol.java:1103)
      	at org.mariadb.jdbc.internal.protocol.AbstractQueryProtocol.executeQuery(AbstractQueryProtocol.java:132)
      	at org.mariadb.jdbc.internal.protocol.AbstractQueryProtocol.executeQuery(AbstractQueryProtocol.java:114)
      	at org.mariadb.jdbc.internal.protocol.AbstractQueryProtocol.setTransactionIsolation(AbstractQueryProtocol.java:925)
      	at org.mariadb.jdbc.MariaDbConnection.setTransactionIsolation(MariaDbConnection.java:803)
      	... 59 more
      

      Attachments

        Issue Links

          Activity

            People

              diego dupin Diego Dupin
              jgawor Jarek Gawor
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.