You are not logged in.
Pages: 1
Our SynDB classes feature now FireDAC / AnyDAC access, with full speed!
See http://synopse.info/fossil/info/f0763f38de
FireDAC is an unique set of Universal Data Access Components for developing cross platform database applications on Delphi. This was in fact a third-party component set, bought by Embarcadero to DA-SOFT Technologies (formerly known as AnyDAC), and included with several editions of Delphi XE3 and up. This is the new official platform for high-speed database development in Delphi, in favor to the now deprecated DBExpress.
Our integration within SynDB.pas units and the mORMot persistence layer has been tuned. For instance, you can have direct access to high-speed FireDAC Array DML feature, via the ORM batch process, via so-called array binding.
See the SAD pdf for benchmarking and information.
Stay tuned!
Offline
I think there's a compatitility problem with FireDAC_7.0.1.3119 and mORMot.
________________________________________________________________
I realized that after I installed FireDAC_7.0.1.3119 with /IDE:D7 switch in Delphi 7, and after it was introduced Firedac support for mORMot, I'm getting AV on project testsql3 see post http://synopse.info/forum/viewtopic.php?id=1310
If remove the package FD, everything works fine!
Offline
I installed FireDAC_8.0.1.3279 with Delphi 7.
Performance tests work just fine, at high speed, with USEFIREDAY conditional.
No AV on testsql3 with Delphi 7 + FireDAC.
So I guess there is something wrong either with the FireDAC 7.0.1, either with your environment.
Please provide additional information, and do step debugging to find out the problem.
Do you use our enhanced RTL for Delphi 7?
Offline
So I guess there is something wrong either with the FireDAC 7.0.1, either with your environment.
I'm awfully sorry about this, the problem is neither FireDAC nor mORMot. I don't know why but, I've discovered that
if my environment PATH is setting to path=e:\Delphi7\Projects\Bpl --> it occurs AV
IF PATH = E:\Delphi7\projects\Bpl then
TestSQL.exe fail AV
ELSE
TestSQL.exe success
Thank you.
Offline
Is it possible, to use PostgreSql as database backend for mORMot REST server using FireDac?
Offline
We did not integrate PostgreSQL SQl dialect yet, since we did not use it yet in our projects.
But it is perfectly feasible to add support for it, with very little changes.
Then you can use FireDAC, Zeos/ZDBC or our direct ODBC layer to access it.
If you have some knowledge of this DB, and are willing to do some testing, we can help you and integrate its support in the trunk.
Offline
Hi ab,
As you know PostgreSQL is open source enterprise MVCC database, and I think it will be great addition to mORMot.
Yes, I will be glad if can be in any help coding/testing/donating. Simple guide(code examples) through such process will be needed.
Have several years experience using PostgreSQL on production.
Thanks.
Offline
You are right: PostgreSQL does make sense for us.
I've added dPostgreSQL kind of database in TSQLDBDefinition enumerate, including associated SQL requests to retrieve metadata.
See http://synopse.info/fossil/info/e13a2baa9b
We better need the database to be created in UTF8.
I forced the client to use UTF8 charset, in all cases.
It should work with FireDAC, Zeos/ZDBC, UniDAC and ODBC.
I did not tested on production yet: your feedback is needed!
Zeos/ZDBC and ODBC are certainly worth testing. ZDBC will make it fully open-source, and ready for FPC/Linux server side.
Offline
Thanks a lot
Just starting to migrate a real-life server-side application using mORMot with FireDAC/PostgreSQL, as SQLite is becoming a bottleneck even in test environment.
This should be some kind of test.
Will let you know when problems faced.
About UTF8 initialization of new databases, it make sense, since it is highly recommended by postgresql community.
UTF8 client connection should be suitable for most of the cases.
Thanks again.
Offline
Haven't dig a lot, but seems there is an issue using utf8 with FireDAC.
Trying to run PerfTest it does not insert properly Name value.
This cannot be changed, as that may break backward compatibility.
If you need to assign a "real" Unicode string, then use AsWideString.
Check here: http://www.da-soft.com/forums/anydac-ge … icode.html
Offline
Delphi XE4, FireDAC 8.0.3.
Just changed some TADParam assignments in SynDBFireDAC.pas (in case of UNICODE defined)
P.AsString => P.AsWideString
P.AsStrings => P.AsWideStrings;
In case of .AsString assignment, FireDAC at some point issue VarAsType(<UTF8 encoded value>, varString) which seem converts the string in default code page, AFAIK.
After the changes UTF8 insertions seem correct, but other assert occur at PerfTest ValueCheck, but this may be due to postgresql specific field type/content handling.
I do not think this change is right, but just a quick fix in order to go forward.
Last edited by chapa (2013-07-04 18:50:25)
Offline
BCD handling is also not well (in case of currency represented as numeric(19,4) and value of 1)
json for the retrieved row contains: '"amount":01', which on behalf breaks TSQLRecord.FillFrom at Value := GetJSONField(P,P,@wasString) returning nil.
Offline
Could you try http://synopse.info/fossil/info/e91c6108b6
And/or change again line 240 of SynDBFireDac.pas from:
dFirebird, dMySQL: begin
into
dFirebird, dMySQL, dPostgreSQL: begin
In fact, setting ForceUseWideString := true will force to use AsWideString(s) instead of AsString(s).
Offline
same problem:
Executing PerfTest.exe tuned for PostgresSQL gives:
'FireDAC PostgreSQL read failure: Value.FirstName=ValueFirstName[ i ] "Name 2"<>"Namé 2"'
In fact, same error with FireDAC's SQLite3:
'FireDAC SQlite3 read failure: Value.FirstName=ValueFirstName[ i ] "Name 2"<>"Namé 2"'
Offline
"ForceUseWideString := true" is taken into force only if UNICODE is not defined, as far as I see.
Offline
"ForceUseWideString := true" is taken into force only if UNICODE is not defined, as far as I see.
Yes, it does not make sense to use it with Delphi 2009+, since string = UnicodeString in this case.
In fact, same error with FireDAC's SQLite3
In fact, I do not have any error with SQLite3 and FireDAC.
The following test works very well in my case:
Test(TSQLDBFireDACConnectionProperties,FIREDAC_PROVIDER[dSQLite],'','','',' SQlite3',true,smFull);
So I guess there is something not good in your case.
Which version of Delphi are you using?
Are you using a particular charset in your system?
Offline
Delphi XE4, FireDAC 8.0.3.
Building Win32
Offline
Windows system locale set to "Bulgarian (Bulgaria)"
Exactly
Test(TSQLDBFireDACConnectionProperties,FIREDAC_PROVIDER[dSQLite],'','','',' SQlite3',true,smFull);
is what breaks
Offline
Needed changes to run PerfTests at my environment are:
SynDBFireDAC:
498: P.AsWideStrings[i] := UTF8ToString(tmp);
515: P.AsWideString := UTF8ToString(VData);
P.S. It is working in PostgreSQL, but not in FireDAC's SQLite3 (maybe some firedac sqlite driver settings needed?). Same Name value error with sqlite3.
Last edited by chapa (2013-07-05 11:29:14)
Offline
In FireDAC, sounds like if TADWideString=UnicodeString for Delphi 2009+ and TADWideString=WideString before.
So AsWideString(s) does not refers to WideString, but UnicodeString in Delphi 2009+
Pretty confusing, isn't it?
Please try http://synopse.info/fossil/info/0b13b05e2f
Offline
Yes, you are absolutely right
So far I confirm it works with PostgreSQL, but SQLite3 breaks again at utf8-encoded Name values.
More changes should be good to be done so far:
1. Add uADPhysPG in conditional uses in PerfTest
2. Override SQLAddIndex at TSQLDBFireDACConnectionProperties in order to add "IF NOT EXISTS". Annoying things are unnecessary exceptions.
Thanks you, ab.
Offline
Now TSQLDBFireDACConnectionProperties.GetFields() will identify indexed fields (and will therefore avoid to execute CREATE INDEX if it is already existing).
See http://synopse.info/fossil/info/edf68f6b07
Offline
Thanks ab
Offline
Pages: 1