You are not logged in.
My understanding is probably lacking in some areas.
I copied methods from my DataSnap program, and, rewrote them as methods using Interfaces.
I then realized that some of the methods have calls to SQL queries etc. They are against
the database ElevateDB from Elevate Software. (Aside - Apparantly there is an ODBC driver available from Elevate Software.) There is only one main database.
In Project 14 there is the TServiceCalculator with function Add. That function doesn't call
a database.
In DataSnap there is a form :-
TServerMethods1 = class(TDSServerModule)
On the form I have components for :-
Session, Database, Tables, Queries etc.
Here is an example of an existing DataSnap method converted to mORMot.
It does SQL queries within the method :-
TLogoffAdmin = class(TInterfacedObject, ILogoffAdmin)
public
function LogoffAdmin(const Company1 : String;
const Name1 : String;
const Area1 : Integer;
const MemObj : TMemObj;
var iLastAutoInc : Integer) : Boolean;
end;
What sample do you think I need to look at so that methods accessing the main database
can be successfully called?
Regards,
Peter Evans
Offline
The easiest is to use a sicShared kind of interface implementation, then create a shared DB connection within the instance.
But you would have to secure the multi-threaded access to the DB connection.
An alternative may be to use sicPerThread and one DB connection per thread.$
Please check the doc about interfaces.
See http://synopse.info/files/html/Synopse% … ml#TITL_92
and also http://synopse.info/files/html/Synopse% … ml#TITL_72
Offline
Thank you. I will look into those now.
Offline