【问题标题】:Clearing profile data for cached Rose::DB connections in mod_perl清除 mod_perl 中缓存的 Rose::DB 连接的配置文件数据
【发布时间】:2014-01-03 15:14:06
【问题描述】:

我有一个使用 Rose::DB(postgresql 驱动程序)的 mod_perl 应用程序。 DB 连接在请求之间是持久的(使用 DBI->connect_cached)并且工作正常。

我正在收集数据库配置文件数据(并将其打印到开发环境中的输出),但我想在每次请求后清除配置文件数据,使用此行:

# $db is a Rose::DB object
$db->dbh->{Profile}->{Data} = undef;

DBI::Profile 文档中所述。但我仍然可以在新请求中看到以前的分析结果。

环境是 Debian Squeeze、Perl 5.10.1、Apache 2.2.16、DBI 1.612 和 DBI::Profile 2.014123。

我在这里遗漏了什么,在 mod_perl for DBI::Profile 下有什么特别需要注意的吗?

提前感谢您的任何建议/提示。

【问题讨论】:

    标签: perl dbi mod-perl rose-db dbi-profile


    【解决方案1】:

    我设法通过使用此行来清除配置文件结果:

    $db->dbh->{Profile} = 0;
    

    但是我不确定为什么将 Data hash ref 设置为 undef(如问题中所用)或调用 $db->dbh->{Profile}->empty() 不起作用。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2011-01-23
      • 1970-01-01
      • 1970-01-01
      • 2018-04-03
      • 1970-01-01
      • 1970-01-01
      • 2017-05-22
      相关资源
      最近更新 更多