[CDBI] Re: uniqueness of objects in memory??

Edward J. Sabol sabol at alderaan.gsfc.nasa.gov
Mon Oct 24 20:47:58 BST 2005

Perrin wrote:
> Here are some possible reasons:
> 1. You are using an older Class::DBI that doesn't support this feature
> but looking at docs for a later version.
> 2. Your Perl doesn't support weak references.  I think the docs explain
> how to check this.
> 3. Your primary key for this class is defined incorrectly, so these
> objects do not appear the same to Class::DBI.
> 4. Something in the particular sequence of actions you're doing has
> uncovered a bug.  In that case, simmering it down to a small test case,
> would make it easier for people to help you with it.

I'll add the following possibilties to Perrin's list:

5. You're forgetting to call the update() method after you change the value
   via its mutator.

6. You're correctly calling update(), but you're using Oracle or PostgreSQL
   (both of which default to AutoCommit off) or have set AutoCommit to be off
   in some other fashion, and you're forgetting to call dbi_commit().

7. You're correctly calling update() and dbi_commit(), but you overrode the
   db_Main() method and forgot to call __PACKAGE__->_remember_handle('Main')
   so that dbi_commit() will actually work.

More information about the ClassDBI mailing list