Hey,
i've got a problem where i don't find a proper solution.
I got two XData/Sphinx/Echo Servers. One is installed onto our Webserver, the other on a local Machine.
The two applications are similiar except for the Databases they're accessing and that the Application on the local machine will pull and push changes to the webserver.
When i trigger the Replication Process manually, everything works fine.
But when i use the TSparkleTimer approach from the EchoDemo i have the problem that the Application on the local Machine shuts down, without any error Messages. It runs for hours properly but at one point it simply shut down.
procedure TServerContainer.StartEchoServer;
var
EchoModule: TEchoServerModule;
Pool: IDBConnectionPool;
NodeManager: IEchoNodeManager;
Conn: IDBConnection;
begin
if Assigned(SparkleEchoServer) then
Exit;
SparkleEchoServer := THttpSysServer.Create;
// Echo Server
Pool := AureliusConnection.GetPoolInterface;
EchoModule := TEchoServerModule.Create(
Setting.WebAdresse.AsUnicodeString+':'+IntToStr(Setting.WebPort)+'/tms/echo', Pool);
SparkleEchoServer.AddModule(EchoModule);
Echo := TEcho.Create(Pool);
// Create regular tables and fields of the application
Conn := Echo.Pool.GetConnection;
// TDatabaseManager.Update(Conn);
// Create tables and fields for TMS Echo usage
TDatabaseManager.Update(Conn, TEcho.Explorer);
Conn := nil; // Free reference
// Get the NodeManager instance
NodeManager := Echo.GetNodeManager;
// If SelfNode is already defined, no need to define it again
if NodeManager.SelfNode = nil then
begin
// SelfNode is not defined, so let's create a Node instance with the name
// specified by the DBName property ("client1", "client2", "server" in the case
// of our demo application. It can be any string value, it just needs
// to be unique among all other databases being replicated.
NodeManager.CreateNode(Setting.NodeName.AsUnicodeString);
// Now define this newly created node as the SelfNode
NodeManager.DefineSelfNode(Setting.NodeName.AsUnicodeString);
Echo.GetRemoteNode(Setting.WebAdresse.AsUnicodeString+':'+IntToStr(Setting.WebPort)+'/tms/echo').RegisterNode;
end;
Timer := TSparkleTimer.Create(
procedure(Echo: TObject)
begin
if (Setting.Mode.AsUnicodeString='Lokaler Server') then
begin
TEcho(Echo).GetRemoteNode(Setting.WebAdresse.AsUnicodeString+':'+IntToStr(Setting.WebPort)+'/tms/echo').Push;
TEcho(Echo).GetRemoteNode(Setting.WebAdresse.AsUnicodeString+':'+IntToStr(Setting.WebPort)+'/tms/echo').Pull;
end;
TEcho(Echo).BatchLoad;
TEcho(Echo).Route;
end,
Echo, 5000, TTimerType.Periodic);
SparkleEchoServer.Start;
end;
Now i got two Questions:
- Shall i make the Timing of the Timer bigger?
- Is there a simple way to receive Error Logs from the Echo Shutdown?
Kind regards,