So I have reviewed a lot of tutorials both written and on video concerning using databases connections in web services developed using Xojo Web. Most of these tutorials seem to be basic starter apps focused on teaching how to create a web service in Xojo, and I am not sure if the architecture shown is the best method for developing scalable web services in Xojo.
Each of these tutorials seem to put database connection code in the Application object. I believe many open a single connection on the open event and close the connection on the close event. Since the Application object is shared by each connection - doesn’t this mean that every connection would be sharing a single database connection? While one client used the connection, wouldn’t additional clients need to wait for the connection to be released?
Even though web services are stateless and do not have session data held between connections, it seems to me that the database connections should be acquired on each session initiation, perhaps from a pool of connections in the application object.
I might not have a good grasp on how the Xojo web framework works. I am hoping someone can give me a pointer in how this should be handled in a real world web service and if concurrent connections can execute code in the application object at the same time.