[Lazarus] WebData

Michael Van Canneyt michael at freepascal.org
Fri Oct 15 15:06:12 CEST 2010



On Fri, 15 Oct 2010, Leonardo M. Ramé wrote:

> On 2010-10-15 14:24:48 +0200, Michael Van Canneyt wrote:
>>> After removing the TSqlQuery and TSQLTransaction components from my app,
>>> a new question came to my mind, in the case of complex inserts/updates
>>> that involves more than one database table, is it possible to use
>>> transactions?.
>>
>> Hm. Not if you use the TSQLDBWebDataProvider. To do that, you would
>> have to use TSQLSuery and a regular TWebDataProvider, and hook into
>> the Before/after post events of the TSQLQuery.
>>
>> But I'm certainly open for suggestions for improvements.
>>
>> Michael.
>
> Well, It's not an issue at all, I could create a stored procedure in
> charge of receiveing the params from the dataprovider, then adapt them to
> their respective tables. It's not an issue because I usually work with
> Firebird and PostgreSql, and they have stored procedures.
>
> I ask this because I'm thinking of adding a new layer of abstraction by
> letting the TFPWebProviderDataModule load a configuration from, say, an
> XML file with the list of Providers and its Select, Insert, Update, and
> Delete statements, like this:

Aha !! I have this on my todo list as well :-)

Only I wasn't going to use XML, but .INI format.
In fact the file format is irrelevant; I planned to do it in 2 levels:

TFileWebDataProvider
  +- TIniFileWebdataProvider

I was going to put it in a separate component, but make the
TFPWebProviderDataModule aware of this component. Gives more 
options.

Michael.


More information about the Lazarus mailing list