I'll try this approach.

 Thank you very much

 Ricardo

----- Original Message -----
From: Felipe Monteiro de Carvalho
Sent: 10/26/11 06:10 AM
To: Lazarus mailing list
Subject: Re: [Lazarus] Problem with access rights in Windows Mobile?

 2011/10/26 "Arí Ricardo Ody" <[email protected]>: > The application has various 
methods that allocate open a TSQLDataset that > points to the same ".db" file 
... > Maybe my programming technique must be changed... Or what? My tipical 
solution is to create 1 unit which has a class which manages a dataset. And 
dont declare this same dataset anywhere else. You then add a method which 
returns an instance of this class, but using the singleton approach it will 
return always the same object for all places which need it. You can check this 
example: 
http://openpokergrid.svn.sourceforge.net/viewvc/openpokergrid/WebServer/DB/dbplayer.pas?revision=277&view=markup
 Here I mixed the singleton approach with reference counting, because I dislike 
initialization/finalization sections. It will free the object and the dataset 
when the reference count reaches zero. In a tipical singleton approach it would 
only free in the finalization section. -- Felipe Monteiro de Carvalho -- 
_______________________________________________ Lazarus mailing list 
[email protected] 
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
--
_______________________________________________
Lazarus mailing list
[email protected]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply via email to