[CDBI] Deleted objects hanging around causing trouble?

Phil Mitchell seasprocket at gmail.com
Tue Aug 30 01:16:45 BST 2005


When I do a delete followed by a create on the same table, CDBI dies
because it tries to reuse the object that's just been deleted. That's
bc it doesn't clear the object out of the Live_Objects cache even
after it blesses it into Has::Been::Deleted, and the DB (SQLite) is
recycling autoincrement id's, so the object key gets reused.

Is there a good reason for this behavior? Would it be a bad idea to
modify CDBI::_init to change:

	unless (defined($obj = $Live_Objects{$obj_key}))

to:          	
 	unless ( defined($obj = $Live_Objects{$obj_key})
                 && !$obj->isa('Class::DBI::Has::Been::Deleted') )


 
-- 
==========================
2People Blog: http://2-people.blogspot.com/
2People site: http://www.2people.org




More information about the ClassDBI mailing list