# Some prepare_cached() issues

- ## A cached statement handle may still be Active

  - because some other code is still fetching from it
  - or didn't fetch all the rows (and didn't didn't call finish)
  - perhaps due to an exception

- ## Default behavior for prepare_cached()

  - if Active then warn and call finish()

- ## Rarely an issue in practice

- ## But if it is

  - Alternative behaviors are available via the $is_active parameter
    prepare_cached($sql, \%attr, $if_active)
  - See the docs for details

Previous slide | Next slide | Back to first slide | View graphic version