我需要调用关闭连接吗?

发布于 2024-11-16 13:05:49 字数 97 浏览 6 评论 0原文

在应用程序中,我多次使用Doctrine_Query::create()

每次使用都需要调用close连接吗?或者教义会为我做这件事吗?

In the application I use Doctrine_Query::create() many times.

Do I need to call close connection each time I use it? Or will doctrine do it for me ?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

陌生 2024-11-23 13:05:49

创建查询不会创建新连接,因此您完全不必担心。 Doctrine 连接管理器会为每个请求建立一个连接,并且您的所有查询都将通过该连接进行。

Creating a query does not make a new connection, so you don't need to worry at all. There is a single connection established each request by the Doctrine connection manager, and all your queries will go over that connection.

小嗷兮 2024-11-23 13:05:49

每个查询都共享相同的连接。无需关闭它。

您可以检查 Doctrine_Manager 以了解这是如何完成的。

Each query is sharing the same connection. There is no need to close it.

You can examine Doctrine_Manager to see how this is done.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文