[Lazarus] RE : Propose: dont try to open TDBLookup* ListSourceautomatically

Ludo Brands ludo.brands at free.fr
Mon Jul 9 10:00:45 CEST 2012

> Currently the db lookup controls tries to open the dataset linked to 
> ListSource if is closed at lookup initialization.

You probably guessed it but I'm voting for removing this feature. Opening of
datasets and establishing database connections behind the back of the
programmer is always a bad idea.  

The try open when loaded (streamed), even in the fixed version, has also the
nasty side effect of not being deterministic. A programmer can't easily
influence the loading order of components and a change in the order will
change the behavior of the program.  The fix in 22337 solves the exception
but not the unpredictable behavior. If the link dataset and connection are
loaded before the dblookup it will open the dataset, else it won't. So your
program can start up with (some) dblookups pre-loaded or not. 

We shouldn't support users counting on unpredictable behavior. 


More information about the Lazarus mailing list