Actually, the SQL logs seem to indicate that there is something going on in multiple threads:
2018-07-24 10:26:53,499 DEBUG [org.hibernate.SQL] (http-nio-8080-exec-5) select persondb0_.id as id1_0_, persondb0_.age as age2_0_, persondb0_.first_name as first_na3_0_, persondb0_.last_name as last_nam4_0_ from person persondb0_
2018-07-24 10:27:09,966 DEBUG [org.hibernate.SQL] (hystrix-MainApiController-1) select persondb0_.id as id1_0_, persondb0_.age as age2_0_, persondb0_.first_name as first_na3_0_, persondb0_.last_name as last_nam4_0_ from person persondb0_ where persondb0_.id=?
2018-07-24 10:27:09,976 DEBUG [org.hibernate.SQL] (hystrix-MainApiController-1) select persondb0_.id as id1_0_, persondb0_.age as age2_0_, persondb0_.first_name as first_na3_0_, persondb0_.last_name as last_nam4_0_ from person persondb0_ where persondb0_.id=?
The logs mention two different thread names: http-nio-8080-exec-5
and hystrix-MainApiController-1
.
We do have plans to support context propagation for ExecutorService
(Java thread pools). But I'm not sure if that would help in your case. I'd need to know more about how your application works and how it makes use of the thread pools.
It's about the MainApiController#getPerson
transaction, right?
In the Spring logs, I can only see three SQL statements. The first transaction has one SELECT
span. Is that the first SQL statement (select persondb0_.id as id1_0_, persondb0_.age as age2_0_, persondb0_.first_name as first_na3_0_, persondb0_.last_name as last_nam4_0_ from person persondb0_
)?
Do you expect the other two SQL statements
2018-07-24 10:27:09,966 DEBUG [org.hibernate.SQL] (hystrix-MainApiController-1) select persondb0_.id as id1_0_, persondb0_.age as age2_0_, persondb0_.first_name as first_na3_0_, persondb0_.last_name as last_nam4_0_ from person persondb0_ where persondb0_.id=?
2018-07-24 10:27:09,976 DEBUG [org.hibernate.SQL] (hystrix-MainApiController-1) select persondb0_.id as id1_0_, persondb0_.age as age2_0_, persondb0_.first_name as first_na3_0_, persondb0_.last_name as last_nam4_0_ from person persondb0_ where persondb0_.id=?
to be part of the other span?
Based on the tread names and timestamps, this seems to be the case.
Note the different thread names for start and stop of the second transaction (http-nio-8080-exec-8
) and the one from the last two SQLs (hystrix-MainApiController-1
).
Any insight on how the execution in the other thread takes place would be useful.