Note that there are some explanatory texts on larger screens.

plurals
  1. POSimple Mysql select row inconsistencies. I can't figure out why. Is it me or mysql?
    text
    copied!<p>My Grails application makes a very simple call to find the details of the logged in user. It is basically this:</p> <pre><code>select id, username, password, firstname, lastname from Person where id=3; </code></pre> <p>Somes time get a result, and sometimes not. I've been analyzing the sql being sent, and it doesn't make sense to me. One request will find the Person, and a subsequent request will not. The logs below track the thread id, session id, and logged in user. I know it is not great asking folks to look at my sql query logs, but I hope I have managed to make it clear in the below what I am seeing.</p> <pre><code>2701 [INFO] 2012-12-03 02:19:02,136 audit [T-82] [23212190391C07976A2CC568F06A780A] [cb18b110954f4476b80c2@stratus5.com] 3. Connection.prepareStatement(select person0_.id as id4_0_, person0_.version as version4_0_, person0_.account_expired as account3_4_0_, person0_.account_locked as account4_4_0_, person0_.created_date as created5_4_0_, person0_.email_hash as email6_4_0_, person0_.enabled as enabled4_0_, person0_.first_name as first8_4_0_, person0_.last_name as last9_4_0_, person0_.`password` as password10_4_0_, person0_.password_expired as password11_4_0_, person0_.tmp_password as tmp12_4_0_, person0_.username as username4_0_ from person person0_ where person0_.id=?) 2702 [INFO] 2012-12-03 02:19:02,137 audit [T-82] [23212190391C07976A2CC568F06A780A] [cb18b110954f4476b80c2@stratus5.com] 3. PreparedStatement.setLong(1, 1160) 2749 [DEBUG] 2012-12-03 02:19:02,278 SignUpApiController [T-82] [23212190391C07976A2CC568F06A780A] [cb18b110954f4476b80c2@stratus5.com] user: com.stratus5.auth.Person : 1160 280 [INFO] 2012-12-03 02:15:32,143 audit [T-160] [23212190391C07976A2CC568F06A780A] [cb18b110954f4476b80c2@stratus5.com] 5. Connection.prepareStatement(select person0_.id as id4_0_, person0_.version as version4_0_, person0_.account_expired as account3_4_0_, person0_.account_locked as account4_4_0_, person0_.created_date as created5_4_0_, person0_.email_hash as email6_4_0_, person0_.enabled as enabled4_0_, person0_.first_name as first8_4_0_, person0_.last_name as last9_4_0_, person0_.`password` as password10_4_0_, person0_.password_expired as password11_4_0_, person0_.tmp_password as tmp12_4_0_, person0_.username as username4_0_ from person person0_ where person0_.id=?) 281 [INFO] 2012-12-03 02:15:32,143 audit [T-160] [23212190391C07976A2CC568F06A780A] [cb18b110954f4476b80c2@stratus5.com] 5. PreparedStatement.setLong(1, 1160) 313 [DEBUG] 2012-12-03 02:15:32,939 SignUpApiController [T-160] [23212190391C07976A2CC568F06A780A] [cb18b110954f4476b80c2@stratus5.com] Current user: null </code></pre> <p>Here is some code extracts incase they help:</p> <pre><code>def principalId = new Long(springSecurityService.getPrincipal().id) def p = Person.get(principalId) log.debug "Current user: $p" </code></pre> <p>I had been just using the springSecurityService.currentUser and was seeing the same errors. I changed just to deliberately calling Person.get based on the hypothesis the problem could have been in the springSecurityService, but that now looks highly unlikely.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload