You are not logged in.
Pages: 1
Hi guys,
I've decided to blog my experiences and bits of knowledge I pick up as 'n explore the mORMot landscape here https://tamingthemormot.wordpress.com/ . Hopefully it will help someone else too. Comments welcome!
Willo
Offline
Wow!
This is just great!
Some users were asking for such tricks.
Thanks a lot!
Continue sharing such good information!
Perhaps we may publish some source code.
A dedicated folder in our "third party" sample official source code tree is ready for you, if you wish!
Offline
I wish you have done this before I started using mORMot
Delphi XE4 Pro on Windows 7 64bit.
Lazarus trunk built with fpcupdelux on Windows with cross-compile for Linux 64bit.
Offline
Thanks guys!
Many thanks to you. I can see that my approaches to use the framework are right, or go in the same direction! :-D *feeling happy*
Offline
I'm still exploring, so I reserve the right to retract anything I've published! I'm sure it won't get to that, but I AM sure I will want to revisit some of my earlier examples later, as I gain experience, to make adjustments.
Offline
Nice !
Offline
Offline
Hi
I'm planning to use mormot for a little service using a legacy database, I was following your post Connecting to legacy databases and publishing a RESTful interface to it but I cannot make it run succesfully, at the start server I have something along this lines :
emptyModel := TSQLModel.Create([], ROOTSERVER);
DbConnection := TSQLDBUniDACConnectionProperties.Create(
TSQLDBUniDACConnectionProperties.URI(dFirebird,Server), Database, Username, Password);
StockServer := TSQLRestServerFullMemory.Create(emptyModel);
StockServer.ServiceDefine( TLegacyStockQuery.Create( DbConnection ), [ILegacyStockQuery]); <------ Error
Last line above throws the following error at runtime : TInterfaceFactory.GUID2TypeInfo({360A4C3A-E07A-4A9E-B0AB-FBBDABABAD4D}): Interface not registered - use TInterfaceFactory.RegisterInterfaces()
I'm testing on D2007, Windows 7, mORMot 1.18.3182 FTS3, I searched for downloadable code of the demo with no luck,
I have other projects using SQLite and TSQLRestServerDB never stumbled with this error.
Can you shed some light on this ?
Thank you
Offline
This blog article is not complete, in fact.
use TInterfaceFactory.RegisterInterfaces seems pretty clear: you need to call this first to register your interface.
As simple search in the documentation would have given to you the needed information:
https://synopse.info/files/html/Synopse … l#TITL_141
Offline
Great I'll take a look at the subject you pointed out, I went to the the documentation before posting but is huge, remember what is simple for you is not so for others :-) I really appreciate the time and effort you take to help people like me.
Offline
Here I am again, TInterfaceFactory.RegisterInterfaces solved the issue, then I faced the following error :
DescribeParams is not a valid option name for InterBase UniProvider
So I modified SynDBUnidac.pas and commented out the line :
// fSpecificOptions.Values['Interbase.DescribeParams'] := 'true';
The code now runs and I can consume the service from a client application, I don't know what would be the implications of such change, I followed a link to devart site on SynDBUnidac.pas but seems it is not there anymore.
Then I have more questions about the constructor of TSQLDBUniDACConnectionProperties, it has the code:
fSpecificOptions.Values['CharSet'] := 'UTF8';
fSpecificOptions.Values['UseUnicode'] := 'true';
fSpecificOptions.Values['CharLength'] := '2';
The legacy database codepage is WIN1252, for querying and showing data I'm doing the conversion of strings where is needed in order to show them right, and ATM my need is only to show info, but in the future I may store data back to the database, so I can change UTF8 to WIN1252 and comment the remaining lines but then on mORMot codebase updates I will lose those changes, Is there a way to configure that database options from code ?
Also on traditional client/server code I'm used to write code like this :
Transaction := TUniTransaction.Create(nil);
Try
Transaction.IsolationLevel := ilReadCommitted;
Transaction.DefaultConnection := DBConn;
Transaction.StartTransaction;
.
.
.
Transaction.Commit;
Finally
Transaction.Free;
End;
As I understand I don't need to manually create the transactions but I couldn't find a way to set the default Isolation level of the autocreated transactions, Is that even possible ?
And to finish this post, I'm not sure what is needed in order to safely manage transactions ( unit of work ), I think the answer is something like what is mentioned on https://synopse.info/files/html/Synopse … #TITLE_615 but since I'm not using the ORM I would like to hear what can you recommend for this use case.
That's all folks
Offline
Pages: 1