If a B4J server app (works on a Host1 of a LAN) uses a big MySQL database on a dedicated Host0 (of this LAN), and also planned to make other apps on different hostsX (and connecting to the same Host0 db) - how correctly to use the connections pool to avoid errors ?
There are tons of subs inside the app where the DB is used - is a new connection to be opened at each sub and closed at sub finish ?
My MySQL server is a separate Ubuntu 20.04 PC (let it be "server") in the same LAN together with my developer laptop.
My project app is a server non-UI app that i run at server.
Test app is the UI app (of @amykonio) that started at my laptop and trying to connect to MySQL of the server. And failed yet.
My MySQL server is a separate Ubuntu 20.04 PC (let it be "server") in the same LAN together with my developer laptop.
My project app is a server non-UI app that i run at server.
Test app is the UI app (of @amykonio) that started at my laptop and trying to connect to MySQL of the server. And failed yet.
In that case, MySQL is set to accept connections from remote pc's? (@Magma was right).
Have you tried to connect to MySQL using for example workbench from your laptop?
also...
Edit the "bind-address" directive in /etc/mysql/mysql.conf.d/mysqld.cnf:
bind-address = 127.0.0.1 ( The default. )
bind-address = XXX.XXX.XXX.XXX ( The ip address of your Public Net interface. )
bind-address = ZZZ.ZZZ.ZZZ.ZZZ ( The ip address of your Service Net interface. )
bind-address = 0.0.0.0 ( All ip addresses. )
Nice... now you must optimize the loops (wait for them, limit the time for them, return error or ok) and don't have them inside of resultset loops.. hope all will work fine...
Hi there, I want to share a tactic / a small guard for MySQL/MariaDB DataBases.. Well all we know that having a Database online and not in localhost is difficult to protect from brute force attacks / ransomware attacks... Well i ll give a little "pebble" to help others to think / different -...
Be careful. On a non jServer handler, yes, but in a jServer handler, do NOT use Wait For unless you also create a message loop. Since each handler runs in its own thread, Wait For should not be needed (other requests will be handled by other threads). Again, if Wait For is needed in a jServer handler, then please see: https://www.b4x.com/android/forum/threads/resumable-subs-wait-for-sleep-in-server-handlers.81833/
Several simple handlers with simple web-forms for settings
Several ABM-pages for Admin interface and data explorer interface
Separate classes for APIs (to control the Python sub-system for recognition and Web-API to work with external public server) and work with files ("black box" file system)
Thanks again for the test application - it, at last, started to work at my side ?
1000 records are being inserted by the connections pool during ... maybe 2 minutes !!!11 Interesting that in Release and Debug mode - almost the same SLOW speed.
But works without errors.
So, it looks like the pool is working...but very slow...but working