# Java Agent reports Non-business queries for DB

**URL:** <https://discuss.elastic.co/t/java-agent-reports-non-business-queries-for-db/162058>\
**Category:** APM\
**Created:** [December 25, 2018, 10:25am UTC](https://discuss.elastic.co/t/java-agent-reports-non-business-queries-for-db/162058 "2018-12-25T10:25:19Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![caohui](https://avatars.discourse-cdn.com/v4/letter/c/d2c977/32.png) [@caohui](https://discuss.elastic.co/u/caohui)\
**Post date:** [December 25, 2018, 10:25am UTC](https://discuss.elastic.co/t/java-agent-reports-non-business-queries-for-db/162058/1 "2018-12-25T10:25:20Z")

</div>

![1](https://us1.discourse-cdn.com/elastic/original/3X/0/1/01f88b2f40ee17f64f689bd5de3328200c2eb3d8.png) ![2](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1a48730f7be16232efce1129caa43bea813bd3f7.png)

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [December 25, 2018, 11:33am UTC](https://discuss.elastic.co/t/java-agent-reports-non-business-queries-for-db/162058/2 "2018-12-25T11:33:38Z")

</div>

Do you have a problem or question?

---

<div class="post-metadata">

**Author:** ![caohui](https://avatars.discourse-cdn.com/v4/letter/c/d2c977/32.png) [@caohui](https://discuss.elastic.co/u/caohui)\
**Post date:** [December 25, 2018, 1:47pm UTC](https://discuss.elastic.co/t/java-agent-reports-non-business-queries-for-db/162058/3 "2018-12-25T13:47:32Z")

</div>

wow, thank you for replying. The question is Why does this query appear? I hope only business logic queries.

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [December 25, 2018, 9:23pm UTC](https://discuss.elastic.co/t/java-agent-reports-non-business-queries-for-db/162058/4 "2018-12-25T21:23:38Z")

</div>

> [@caohui](#):
>
> I hope only business logic queries.

Can you clarify this please, it's not really clear what you mean.

---

<div class="post-metadata">

**Author:** ![caohui](https://avatars.discourse-cdn.com/v4/letter/c/d2c977/32.png) [@caohui](https://discuss.elastic.co/u/caohui)\
**Post date:** [December 26, 2018, 2:10am UTC](https://discuss.elastic.co/t/java-agent-reports-non-business-queries-for-db/162058/5 "2018-12-26T02:10:37Z")

</div>

Can you see the picture that I upload? The fact that I only have one sql that is 'SELECT service\_name serviceName, group\_name groupName, wave\_key waveKey, wave\_value waveValue  
FROM t\_prism\_service\_alert  
WHERE service\_name IN(?)' . But the agent report the sql in the picture, I do not know the sql in the picture where is from, because I have not this sql.

---

<div class="post-metadata">

**Author:** ![caohui](https://avatars.discourse-cdn.com/v4/letter/c/d2c977/32.png) [@caohui](https://discuss.elastic.co/u/caohui)\
**Post date:** [December 26, 2018, 3:03am UTC](https://discuss.elastic.co/t/java-agent-reports-non-business-queries-for-db/162058/6 "2018-12-26T03:03:53Z")

</div>

[DEBUG][2018-12-26T11:00:23.551+0800][org.mybatis.spring.transaction.SpringManagedTransaction:87] JDBC Connection [ProxyConnection[PooledConnection[com.mysql.jdbc.JDBC4Connection@270c1b57]]] will not be managed by Spring

[DEBUG][2018-12-26T11:00:23.555+0800][com.didi.ep.prism.mapper.api.ApiNameMapper.queryServiceMappingGroup:159] ==\> Preparing: SELECT service\_name serviceName, group\_name groupName, wave\_key waveKey, wave\_value waveValue FROM t\_prism\_service\_alert WHERE service\_name IN ( ? , ? , ? , ? , ? )

[DEBUG][2018-12-26T11:00:23.599+0800][com.didi.ep.prism.mapper.api.ApiNameMapper.queryServiceMappingGroup:159] ==\> Parameters: prism\_prism\_scheduler\_prod(String), prism\_prism\_linkchecker\_prod(String), prism\_prism\_servicestable\_prod(String), prism\_prism\_detectlive\_prod(String), prism\_prism\_service\_prod(String)

[DEBUG][2018-12-26T11:00:23.667+0800][com.didi.ep.prism.mapper.api.ApiNameMapper.queryServiceMappingGroup:159] \<== Total: 0

[DEBUG][2018-12-26T11:00:23.668+0800][org.mybatis.spring.SqlSessionUtils:191] Closing non transactional SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@78be929b]

[DEBUG][2018-12-26T11:00:23.669+0800][org.springframework.jdbc.datasource.DataSourceUtils:327] Returning JDBC Connection to DataSource

Above is the log, there is no the sql that the agent report, I have no idea how to do, please help me, thank you

---

<div class="post-metadata">

**Author:** ![caohui](https://avatars.discourse-cdn.com/v4/letter/c/d2c977/32.png) [@caohui](https://discuss.elastic.co/u/caohui)\
**Post date:** [December 26, 2018, 4:13am UTC](https://discuss.elastic.co/t/java-agent-reports-non-business-queries-for-db/162058/7 "2018-12-26T04:13:23Z")

</div>

I've found the reason. The mysql-connector-java is will to load server properties when it connects or re-connect the mysql server. Load server properties is to send the sql that is in the picture.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [January 16, 2019, 12:13am UTC](https://discuss.elastic.co/t/java-agent-reports-non-business-queries-for-db/162058/8 "2019-01-16T00:13:29Z")

</div>

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.
