Hi everybody,
We have SP with the code like this:
if not used('System_Parameters')
use System_Parameters
endif
where this table is part of the database. The database is included in the project (it's excluded, but it's part of the project).
Now, yesterday I changed our application AddChildren method. The original logic was to instantiate Observer Manager, then FoxAudit, then Stonefield, then Language Manager, then User Log Manager, then Shutdown timer, then Record Track Manager.
I thought, why do we need to instantiate all the managers if we may need to shutdown the application? In other words, I put the timer first. The FoxAudit, Stonefield and Language Manager I commented out, since we're not using them in our application (my colleague told me so). So, the new order of AddChildren is:
Timer, then UserLogMgr, then Observer Mgr, then Record Track Manager.
The code, that now failed, is in PostInitHook, so it happens after all the managers instantiated. But somehow the change in the instantiation order made this strange error, that the System_Parameters table is not found. Once we added database prefix in that stored procedure, it worked.
But here is a question: if we're opening tables from stored procedure, would it not assume, that tables should belong to that database? Is it possible to execute SP code without opening a database?
I'm confused. Why all of the sudden we need to specify database prefix for the table which is part of the database using that table from SP?
Thanks in advance.
If it's not broken, fix it until it is.
My Blog