<div dir="ltr"><div>hi marek,</div><div><br></div><div>i was trying to play around with &quot;driverDialect&quot; property but it does not work.</div><div><br></div><div>Anyway, i&#39;ve just modified this file and it&#39;s working now. This error only happened during the first time startup of keycloak.</div><div><br></div><a class="" href="https://bitbucket.org/keycloakizeno/singhealth/commits/395cfe9aee30bee96ec25cba35435c029cb551e3#chg-model/jpa/src/main/java/org/keycloak/models/jpa/session/JpaUserSessionPersisterProvider.java" style="color:rgb(53,114,176);text-decoration:none;margin-left:5px;font-family:Arial,sans-serif;font-size:14px;line-height:18.2px">model/jpa/src/main/java/org/keycloak/models/jpa/session/JpaUserSessionPersisterProvider.java</a><div><br></div><div><div class="" style="margin:0px;padding:0px;font-family:Arial,sans-serif;font-size:14px;line-height:20px"><pre class="" style="margin-top:0px;margin-bottom:0px;padding:0px 0px 0px 98px;font-family:Consolas,Menlo,&#39;Liberation Mono&#39;,Courier,monospace;font-size:12px;line-height:18px;height:18px;background-color:rgb(221,255,221)"><font color="#ff0000">+        </font></pre></div><div class="" style="margin:0px;padding:0px;font-family:Arial,sans-serif;font-size:14px;line-height:20px"><div class="" id="Lmodel/jpa/src/main/java/org/keycloak/models/jpa/session/JpaUserSessionPersisterProvider.javaT180" style="margin:0px;padding:0px;height:18px;border-right-width:1px;border-right-style:solid;border-right-color:rgb(204,204,204);background-color:rgb(245,245,245)"><a href="https://bitbucket.org/keycloakizeno/singhealth/commits/395cfe9aee30bee96ec25cba35435c029cb551e3#add-comment" class="" title="Add a comment to this line" style="text-decoration:none;float:left;width:16px;height:18px;padding:0px 5px"></a><a class="" href="https://bitbucket.org/keycloakizeno/singhealth/commits/395cfe9aee30bee96ec25cba35435c029cb551e3#Lmodel/jpa/src/main/java/org/keycloak/models/jpa/session/JpaUserSessionPersisterProvider.javaT180" style="text-decoration:none;font-family:Consolas,Menlo,&#39;Liberation Mono&#39;,Courier,monospace;font-size:12px;height:18px;line-height:18px;margin-top:0px;float:right;width:70px"></a></div><pre class="" style="margin-top:0px;margin-bottom:0px;padding:0px 0px 0px 98px;font-family:Consolas,Menlo,&#39;Liberation Mono&#39;,Courier,monospace;font-size:12px;line-height:18px;height:18px;background-color:rgb(221,255,221)"><font color="#ff0000">+        if(userSessionIds!=null &amp;&amp; userSessionIds.size()==0)</font></pre></div><div class="" style="margin:0px;padding:0px;font-family:Arial,sans-serif;font-size:14px;line-height:20px"><div class="" id="Lmodel/jpa/src/main/java/org/keycloak/models/jpa/session/JpaUserSessionPersisterProvider.javaT181" style="margin:0px;padding:0px;height:18px;border-right-width:1px;border-right-style:solid;border-right-color:rgb(204,204,204);background-color:rgb(245,245,245)"><a href="https://bitbucket.org/keycloakizeno/singhealth/commits/395cfe9aee30bee96ec25cba35435c029cb551e3#add-comment" class="" title="Add a comment to this line" style="text-decoration:none;float:left;width:16px;height:18px;padding:0px 5px"></a><a class="" href="https://bitbucket.org/keycloakizeno/singhealth/commits/395cfe9aee30bee96ec25cba35435c029cb551e3#Lmodel/jpa/src/main/java/org/keycloak/models/jpa/session/JpaUserSessionPersisterProvider.javaT181" style="text-decoration:none;font-family:Consolas,Menlo,&#39;Liberation Mono&#39;,Courier,monospace;font-size:12px;height:18px;line-height:18px;margin-top:0px;float:right;width:70px"></a></div><pre class="" style="margin-top:0px;margin-bottom:0px;padding:0px 0px 0px 98px;font-family:Consolas,Menlo,&#39;Liberation Mono&#39;,Courier,monospace;font-size:12px;line-height:18px;height:18px;background-color:rgb(221,255,221)"><font color="#ff0000">+                userSessionIds.add(&quot;&quot;);</font></pre></div><div class="" style="margin:0px;padding:0px;font-family:Arial,sans-serif;font-size:14px;line-height:20px"><div class="" id="Lmodel/jpa/src/main/java/org/keycloak/models/jpa/session/JpaUserSessionPersisterProvider.javaF179T182" style="margin:0px;padding:0px;height:18px;border-right-width:1px;border-right-style:solid;border-right-color:rgb(204,204,204);background-color:rgb(245,245,245)"><a href="https://bitbucket.org/keycloakizeno/singhealth/commits/395cfe9aee30bee96ec25cba35435c029cb551e3#add-comment" class="" title="Add a comment to this line" style="text-decoration:none;float:left;width:16px;height:18px;padding:0px 5px"></a><a class="" href="https://bitbucket.org/keycloakizeno/singhealth/commits/395cfe9aee30bee96ec25cba35435c029cb551e3#Lmodel/jpa/src/main/java/org/keycloak/models/jpa/session/JpaUserSessionPersisterProvider.javaF179T182" style="color:rgb(51,51,51);text-decoration:none;font-family:Consolas,Menlo,&#39;Liberation Mono&#39;,Courier,monospace;font-size:12px;height:18px;line-height:18px;margin-top:0px;float:right;width:70px"></a></div><pre class="" style="color:rgb(51,51,51);margin-top:0px;margin-bottom:0px;padding:0px 0px 0px 98px;font-family:Consolas,Menlo,&#39;Liberation Mono&#39;,Courier,monospace;font-size:12px;line-height:18px;height:18px"> </pre></div><div class="" style="margin:0px;padding:0px;color:rgb(51,51,51);font-family:Arial,sans-serif;font-size:14px;line-height:20px"><div class="" id="Lmodel/jpa/src/main/java/org/keycloak/models/jpa/session/JpaUserSessionPersisterProvider.javaF180T183" style="margin:0px;padding:0px;height:18px;border-right-width:1px;border-right-style:solid;border-right-color:rgb(204,204,204);background-color:rgb(245,245,245)"><a href="https://bitbucket.org/keycloakizeno/singhealth/commits/395cfe9aee30bee96ec25cba35435c029cb551e3#add-comment" class="" title="Add a comment to this line" style="color:rgb(112,112,112);text-decoration:none;float:left;width:16px;height:18px;padding:0px 5px"></a><a class="" href="https://bitbucket.org/keycloakizeno/singhealth/commits/395cfe9aee30bee96ec25cba35435c029cb551e3#Lmodel/jpa/src/main/java/org/keycloak/models/jpa/session/JpaUserSessionPersisterProvider.javaF180T183" style="color:rgb(51,51,51);text-decoration:none;font-family:Consolas,Menlo,&#39;Liberation Mono&#39;,Courier,monospace;font-size:12px;height:18px;line-height:18px;margin-top:0px;float:right;width:70px"></a></div><pre class="" style="margin-top:0px;margin-bottom:0px;padding:0px 0px 0px 98px;font-family:Consolas,Menlo,&#39;Liberation Mono&#39;,Courier,monospace;font-size:12px;line-height:18px;height:18px">         TypedQuery&lt;PersistentClientSessionEntity&gt; query2 = em.createNamedQuery(&quot;findClientSessionsByUserSessions&quot;, PersistentClientSessionEntity.class);</pre></div><div class="" style="margin:0px;padding:0px;color:rgb(51,51,51);font-family:Arial,sans-serif;font-size:14px;line-height:20px"><div class="" id="Lmodel/jpa/src/main/java/org/keycloak/models/jpa/session/JpaUserSessionPersisterProvider.javaF181T184" style="margin:0px;padding:0px;height:18px;border-right-width:1px;border-right-style:solid;border-right-color:rgb(204,204,204);background-color:rgb(245,245,245)"><a href="https://bitbucket.org/keycloakizeno/singhealth/commits/395cfe9aee30bee96ec25cba35435c029cb551e3#add-comment" class="" title="Add a comment to this line" style="color:rgb(112,112,112);text-decoration:none;float:left;width:16px;height:18px;padding:0px 5px"></a><a class="" href="https://bitbucket.org/keycloakizeno/singhealth/commits/395cfe9aee30bee96ec25cba35435c029cb551e3#Lmodel/jpa/src/main/java/org/keycloak/models/jpa/session/JpaUserSessionPersisterProvider.javaF181T184" style="color:rgb(51,51,51);text-decoration:none;font-family:Consolas,Menlo,&#39;Liberation Mono&#39;,Courier,monospace;font-size:12px;height:18px;line-height:18px;margin-top:0px;float:right;width:70px"></a></div><pre class="" style="margin-top:0px;margin-bottom:0px;padding:0px 0px 0px 98px;font-family:Consolas,Menlo,&#39;Liberation Mono&#39;,Courier,monospace;font-size:12px;line-height:18px;height:18px">         query2.setParameter(&quot;userSessionIds&quot;, userSessionIds);</pre></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Nov 4, 2015 at 3:30 PM, Marek Posolda <span dir="ltr">&lt;<a href="mailto:mposolda@redhat.com" target="_blank">mposolda@redhat.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
  
    
  
  <div text="#000000" bgcolor="#FFFFFF">
    <div>I didn&#39;t see the error, but we are not
      using InnoDB dialect during testing. Will it work if you remove
      &quot;driverDialect&quot; property?<br>
      <br>
      Marek<div><div class="h5"><br>
      <br>
      On 04/11/15 05:24, Chen Keong Yap wrote:<br>
    </div></div></div>
    <blockquote type="cite"><div><div class="h5">
      <div dir="ltr">
        <div>Hi Guys,</div>
        <div><br>
        </div>
        <div>Have you encountered this error before using mysql to store
          keycloak data?</div>
        <div><br>
        </div>
        <div><br>
        </div>
        <div>- JDK 1.8</div>
        <div><br>
        </div>
        <div>- mysql-connector-java-5.1.25.jar</div>
        <div><br>
        </div>
        <div>- MYSQL  5.6.23-log</div>
        <div><br>
        </div>
        <div>- Keycloak.json</div>
        <div><br>
        </div>
        <div>
          <div>&quot;connectionsJpa&quot;: {</div>
          <div>        &quot;default&quot;: {</div>
          <div>            &quot;dataSource&quot;:
            &quot;java:jboss/datasources/KeycloakDS&quot;,</div>
          <div>            &quot;databaseSchema&quot;: &quot;update&quot;,</div>
          <div>            &quot;driverDialect&quot; :
            &quot;org.hibernate.dialect.MySQL5InnoDBDialect&quot;</div>
          <div>        }</div>
          <div>    },</div>
        </div>
        <div><br>
        </div>
        - logs<br clear="all">
        <div>
          <div><br>
          </div>
        </div>
        <div>
          <div>04:23:26,251 WARN
             [org.hibernate.engine.jdbc.spi.SqlExceptionHelper]
            (ServerService Thread Pool -- 56) SQL Error: 1064, SQLState:
            42000</div>
          <div>04:23:26,251 ERROR
            [org.hibernate.engine.jdbc.spi.SqlExceptionHelper]
            (ServerService Thread Pool -- 56) 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 &#39;)) order by
            persistent0_.USER_SESSION_ID&#39; at line 1</div>
          <div>04:23:26,267 ERROR
            [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/auth]]
            (ServerService Thread Pool -- 56) JBWEB000289: Servlet
            Keycloak REST Interface threw load() exception:
            com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException:
            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 &#39;)) order by
            persistent0_.USER_SESSION_ID&#39; at line 1</div>
          <div>        at
            sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
            Method) [rt.jar:1.8.0_65]</div>
          <div>        at
            sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
            [rt.jar:1.8.0_65]</div>
          <div>        at
            sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
            [rt.jar:1.8.0_65]</div>
          <div>        at
            java.lang.reflect.Constructor.newInstance(Constructor.java:422)
            [rt.jar:1.8.0_65]</div>
          <div>        at
            com.mysql.jdbc.Util.handleNewInstance(Util.java:411)</div>
          <div>        at com.mysql.jdbc.Util.getInstance(Util.java:386)</div>
          <div>        at
            com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1054)</div>
          <div>        at
            com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4187)</div>
          <div>        at
            com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4119)</div>
          <div>        at
            com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2570)</div>
          <div>        at
            com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2731)</div>
          <div>        at
            com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2815)</div>
          <div>        at
com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:2155)</div>
          <div>        at
com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:2322)</div>
          <div>        at
org.jboss.jca.adapters.jdbc.CachedPreparedStatement.executeQuery(CachedPreparedStatement.java:107)</div>
          <div>        at
org.jboss.jca.adapters.jdbc.WrappedPreparedStatement.executeQuery(WrappedPreparedStatement.java:462)</div>
          <div>        at
            org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.extract(ResultSetReturnImpl.java:79)
[hibernate-core-4.2.18.Final-redhat-2.jar:4.2.18.Final-redhat-2]</div>
          <div>        at
            org.hibernate.loader.Loader.getResultSet(Loader.java:2062)
            [hibernate-core-4.2.18.Final-redhat-2.jar:4.2.18.Final-redhat-2]</div>
          <div>        at
            org.hibernate.loader.Loader.executeQueryStatement(Loader.java:1859)
[hibernate-core-4.2.18.Final-redhat-2.jar:4.2.18.Final-redhat-2]</div>
          <div>        at
            org.hibernate.loader.Loader.executeQueryStatement(Loader.java:1838)
[hibernate-core-4.2.18.Final-redhat-2.jar:4.2.18.Final-redhat-2]</div>
          <div>        at
            org.hibernate.loader.Loader.doQuery(Loader.java:906)
            [hibernate-core-4.2.18.Final-redhat-2.jar:4.2.18.Final-redhat-2]</div>
          <div>        at
            org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:348)
[hibernate-core-4.2.18.Final-redhat-2.jar:4.2.18.Final-redhat-2]</div>
          <div>        at
            org.hibernate.loader.Loader.doList(Loader.java:2550)
            [hibernate-core-4.2.18.Final-redhat-2.jar:4.2.18.Final-redhat-2]</div>
          <div>        at
            org.hibernate.loader.Loader.doList(Loader.java:2536)
            [hibernate-core-4.2.18.Final-redhat-2.jar:4.2.18.Final-redhat-2]</div>
          <div>        at
            org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2366)
[hibernate-core-4.2.18.Final-redhat-2.jar:4.2.18.Final-redhat-2]</div>
          <div>        at
            org.hibernate.loader.Loader.list(Loader.java:2361)
            [hibernate-core-4.2.18.Final-redhat-2.jar:4.2.18.Final-redhat-2]</div>
          <div>        at
            org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:495)
[hibernate-core-4.2.18.Final-redhat-2.jar:4.2.18.Final-redhat-2]</div>
          <div>        at
            org.hibernate.hql.internal.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:357)
[hibernate-core-4.2.18.Final-redhat-2.jar:4.2.18.Final-redhat-2]</div>
          <div>        at
            org.hibernate.engine.query.spi.HQLQueryPlan.performList(HQLQueryPlan.java:198)
[hibernate-core-4.2.18.Final-redhat-2.jar:4.2.18.Final-redhat-2]</div>
          <div>        at
            org.hibernate.internal.SessionImpl.list(SessionImpl.java:1230)
[hibernate-core-4.2.18.Final-redhat-2.jar:4.2.18.Final-redhat-2]</div>
          <div>        at
            org.hibernate.internal.QueryImpl.list(QueryImpl.java:101)
            [hibernate-core-4.2.18.Final-redhat-2.jar:4.2.18.Final-redhat-2]</div>
          <div>        at
            org.hibernate.ejb.QueryImpl.getResultList(QueryImpl.java:268)
[hibernate-entitymanager-4.2.18.Final-redhat-2.jar:4.2.18.Final-redhat-2]</div>
        </div>
        <div><br>
        </div>
      </div>
      <br>
      <fieldset></fieldset>
      <br>
      </div></div><pre>_______________________________________________
keycloak-user mailing list
<a href="mailto:keycloak-user@lists.jboss.org" target="_blank">keycloak-user@lists.jboss.org</a>
<a href="https://lists.jboss.org/mailman/listinfo/keycloak-user" target="_blank">https://lists.jboss.org/mailman/listinfo/keycloak-user</a></pre>
    </blockquote>
    <br>
  </div>

</blockquote></div><br><br clear="all"><div><br></div> <br><div class="gmail_signature"><div dir="ltr"><table border="0" cellspacing="0" cellpadding="0" width="620"><tbody>
<tr>
<td style="padding:0px 0px 20px;font-family:Arial,Helvetica,sans-serif;color:rgb(130,130,130);font-size:10px"></td></tr></tbody></table></div></div>
</div></div></div>