Hibernate将外来查询发送到数据库 [英] Hibernate sending alien queries to database

查看:43
本文介绍了Hibernate将外来查询发送到数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个由hibernate支持的Web应用程序.最近几天,我开始密切监视mysql,发现hibernate会将未知查询发送到数据库,而这些查询实际上并不是从应用程序的任何部分发送的.

I have a web application backed by hibernate. For last few days, I have started closely monitoring mysql and found that hibernate is sending unknown queries to the database which infact are not being sent from any part of app.

查询看起来像

|/* mysql-connector-java-5.1.6(修订:$ {svn.Revision})*/在变量名='l |

| /* mysql-connector-java-5.1.6 ( Revision: ${svn.Revision} ) */SHOW VARIABLES WHERE Variable_name ='l |

推荐答案

这与Hibernate或池化机制无关.建立连接后,此操作由驱动程序本身执行.驱动程序执行此操作以自行配置.参见 com.mysql.jdbc.ConnectionImpl.loadServerVariables()

This is not related to Hibernate or to the pooling mechanism. This is performed by the driver itself once a connection is made. The driver does that to configure itself. See the code in com.mysql.jdbc.ConnectionImpl.loadServerVariables()

这篇关于Hibernate将外来查询发送到数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆