I'm playing around with using Cache::MemoryCache to store some database
'objects'.  However, when I stuff an object into the cache, and the cache
goes out of scope, I get these messages:

SV = RV(0x8f11e0) at 0x8f41cc
  REFCNT = 1
  FLAGS = (ROK)
  RV = 0x8f41d8
        (in cleanup) dbih_getcom handle DBI::st=HASH(0x8f41d8) is not a DBI
handle (has no magic) during global destruction.
SV = RV(0x4ad820) at 0xffbee9c8
  REFCNT = 1
  FLAGS = (ROK,READONLY)
  RV = 0x8f41d8
SV = RV(0x8f1060) at 0x8f19c0
  REFCNT = 1
  FLAGS = (ROK)
  RV = 0x8f19cc
        (in cleanup) dbih_getcom handle DBI::st=HASH(0x8f19cc) is not a DBI
handle (has no magic) during global destruction.
SV = RV(0x8f1034) at 0xffbee9c8
  REFCNT = 1
  FLAGS = (ROK,READONLY)
  RV = 0x8f19cc
SV = RV(0x8dd5e0) at 0x8ddf50
  REFCNT = 1
  FLAGS = (ROK)
  RV = 0x8ddf5c
        (in cleanup) dbih_getcom handle DBI::db=HASH(0x8ddf5c) is not a DBI
handle (has no magic) during global destruction.
SV = RV(0x8f11f4) at 0xffbee9c8
  REFCNT = 1
  FLAGS = (ROK,READONLY)
  RV = 0x8ddf5c
SV = RV(0x8dd5c8) at 0x8ddfbc
  REFCNT = 1
  FLAGS = (ROK)
  RV = 0x8ddfc8
        (in cleanup) dbih_getcom handle DBI::dr=HASH(0x8ddfc8) is not a DBI
handle (has no magic) during global destruction.
SV = RV(0x8dd5d0) at 0xffbee448
  REFCNT = 1
  FLAGS = (ROK,READONLY)
  RV = 0x8ddfc8


Can someone explain to me what's going on?  I think it has something to do
with how Cache::Cache stores references.  As a simple test, I created a
reference, blessed it into a package, and inserted it into the cache.  Each
time I fetched the object from the cache, the reference was **different**.
So some sort of copying is going on behind the scenes.  I'm sure this is
causing some DBI stuff to go out of scope, and be released (but not totally
freed, since the refcounts are all 1 for the above objects.  So perhaps some
sort of corruption?)

The original objects I'm trying to store in the database contain a reference
back to their implementation, which in turns references the main database
services object, which in turn (!) contains a reference to the database:

        Interface (many) -> Implementation (1) -> Services (1) -> $dbh (1)

So, does anyone here know of any issues when using Cache::Cache with DBI?  I
doubt from the error I'm seeing above that I can safely us it in a
production environment.

Cheers!

    -klm.

Reply via email to