acquaman/acquaman — Issue #213: Database Registration
Author: davidChevrier
Created: 2012-01-16 15:28:46+00:00
State: open
Labels: Bug - Wrong Behaviour, Impact - Medium, Module - Data Management, Reason - Confusing API

In creating a new database for the SGM beamline (a database all users can access) I've found that the call to AMDbObjectSupport::s()->registerDatabase() may fail (for lack of a better term) depending on when it is executed. The failure in question actually results in a database that is malformed (the problem usually seems to be related to AMScan and its related classes and tables). To get around the problem, SGMAppController is creating and registering its own database just before the call to AMAppController::startup(). Some testing has shown that registration will:

1. FAIL if registerDatabase() is called after AMAppController::startup
2. SUCCEED if registerDatabase() is called in AMDatamanAppController::startupRegisterDatabases before or after the "user" database is registered
3. FAIL if registerDatabase() is called at the end of AMDatamanAppController::startupRegisterDatabases
4. SUCCEED if registerDatabase is called in AMDatamanAppController::startupRegisterDatabases before the call to AMDbObjectSupport::s()->registerClass() BUT ONLY IF the registration of AMFastScan is commented out

Not sure what all this means.