Hi Antonio,
The program below works perfectly. The connection to the database occurs normally:
What happen when you try to use the MySQL connection in an Apache Module, but without XData? Maybe it's something related to Apache module permissions and MySQL connection?
"What happen when you try to use the MySQL connection in an Apache Module, but without XData? "
Hm, you are not using the exactly same connection component in the "pure-Apache" tests. I believe in XData tests you are using the connection in a data module?
Well, your dpr code is creating FireDacMySQLConnection module, but that is being called after you use it. The initialization code in WebModuleUnit1 is being called before the module is created.
initialization
// Add here
Application.CreateForm(TFireDacMySqlConnection, FireDacMySqlConnection);
Server := TWebBrokerServer.create;
Server.Dispatcher.AddModule(TXDataServerModule.Create('http://ubuntu/tron',
TFireDacMySqlConnection.CreateConnection));
procedure InitXData;
begin
Server := TWebBrokerServer.create;
Server.Dispatcher.AddModule(TXDataServerModule.Create('http://ubuntu/tron',
TFireDacMySqlConnection.CreateConnection));
end;
Application.CreateForm(TFireDacMySqlConnection, FireDacMySqlConnection);
InitXData;
Application.Run;
end.
initialization
Application.CreateForm(TFireDacMySqlConnection, FireDacMySqlConnection);
end.
Unfortunately none of the options worked, and the error is the same.
Can you please send us your full project through e-mail, with any of the applied suggestions?
Hi Wagner, I sent the email with the source code attached.
Thank you Antonio. We have answered you with the fixed project. Basically instead of using
Hi Wagner.
Was this error fixed with in this last post?
I'm having the same error and haven't fixed it yet.
Tks
Hi Marcos, it might not be the same issue, I suggest you create a new topic with details about your error.
But often the problem the problem with Apache is that you need to create the data module with the connection before using it. So if you have code in initialization
section that tries to get a connection or a connection pool, make sure the data module is already created at that point. Better to create it explicitly from code.
You can take a look here as well: Apache won't start with XData server application
296/5000
Wagner, the error was in a test module that was in error.
I created XData/Aurelius backend in the cloud using Amazon AWS. The application uses an EC2 server as an application server accessing the MySQL database in RDS and now I will create the front end using the TMS Web Core.
Thank you for your help.
Hi Marcos, I understand the problem is solved now?
Hi Wagner.
Yes, it was resolved.
Thank you