[Lazarus] Propose: dont try to open TDBLookup* ListSource automatically

Luiz Americo Pereira Camara luizmed at oi.com.br
Sun Jul 8 18:02:50 CEST 2012


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

The initialization occurs after the control is loaded (streamed) or when 
a related db property is changed in the control. This behavior can leads 
to opening the dataset at unpredictable time or even twice (if the 
programmer opens the dataset after loading of the control). Also it can 
trigger events like AfterOpen in improper moments, e.g., data structures 
not initialized.

Removing this feature, that is LCL specific, can have side effects in 
projects that do not open explicitly the ListSource dataset or closes it 
when the lookup control is still in use.

Recently two bugs were reported due to this behavior (see 
http://bugs.freepascal.org/view.php?id=22387 
http://bugs.freepascal.org/view.php?id=22337 
http://lazarus.freepascal.org/index.php/topic,17355.msg96112.html )

So, removing this feature has the benefits of a cleaner code and better 
user control when to open the dataset thus avoiding potential bugs and 
decreased performance. The drawback is that it can affect programs that 
relies in that behavior although it should be easily fixable and if 
there's a good moment for such changes is now since 1.0 has already 
branched.

Luiz




More information about the Lazarus mailing list