You are not logged in.
Pages: 1
使用接口建立服务,我设计了一个TInterfacedObjectWithCustomCreate为基类的ImplementationClass。现在,我有两个不同root的DB,aDB,bDB.分别注册了这个ImplementationClass。在ImplementationClass的方法里,我怎么分别这是运行在aDB或者是bDB?或者说,我在方法的运行期间,怎么样获取它注册的工厂类和TRESTSERVERDB
Using an interface to create a service, I designed an ImplementationClass with TInterfacedObjectWithCustomCreate as the base class. Now, I have two different root DBs, aDB and bDB. Each has registered this ImplementationClass. In the ImplementationClass method, how can I distinguish whether this is running on aDB or bDB? In other words, how do I obtain the registered factory class and TRESTSERVERDB of a method during its operation
Last edited by htits2008 (2023-03-31 01:44:06)
Offline
I define a function named fDB; And It done.
function FDB: TRestServer;
begin
fDB:=ServiceRunningContext^.Request.Server;
end;
Last edited by htits2008 (2023-03-31 02:56:27)
Offline
When I called an interface service in a long running thread on the server, an error occurred. Some objects are not initialized
Offline
ServiceRunningContext^.Factory.ORM; can do some CRUD
Offline
Pages: 1