Fundamentally the limitation is that the callback has to be a string, and you can't represent a db object as a string (well, you can, but you can't then use that to locate the db object again, so that's not terribly helpful). It's not obvious how you are indicating to the user what the menu items are and how that relates to the db object underneath, but one solution would be to do this when you build the simple menu:
foreach(mapcar obj items
sprintf(itemText "%L" obj)
sprintf(nil "TEST(\"%L\")" obj) ; generate callback
then in your callback function, you can do:
... do whatever you want here
Whatever you do, however, don't hang onto the contents of the global table for too long - because the database ids might get invalid or recycled (e.g. if objects are deleted, or the containing cellView is purged). For the duration of a popup menu though, it's probably fine though.