While doing research into web edition I wanted to set up a simple app that will connect to a local database and make modifications. From looking around, I’ve seen that I should be worried about some issues with the session global variables, as well as some other finicky elements in WE when working with databases.
Is there an example WE project that includes any database code to look at to see where it is best practice to store information about the database/session/etc and how best to access and modify database information specifically from a Web App? I have plenty of experience in databases on desktop apps, but it looks like things are different for WE apps with databases.
The short of it is that you should have a separate DB connection for each user session. If using SQLite, you likely also want to set MultiUser = True to enable write-ahead logging for fast disk writes. Otherwise, DB access is not really all that different between a web app and a desktop app.
I’d like to track down that conversation. I have had a couple of users say that dates they inputted weren’t correct. The fact that it’s just dates and is so rare made me think user error. But I’m open to investigating other possibilities.
The short of it is that you should have a separate DB connection for each user session. If using SQLite, you likely also want to set MultiUser = True to enable write-ahead logging for fast disk writes. Otherwise, DB access is not really all that different between a web app and a desktop app.[/quote]
Thanks for the info & help. I’m assuming there isn’t anything in the examples for connecting to a local MySQL server that’s already on the server? I would be integrating a Xojo Web App with some existing PHP pages that pull data from a MySQL database on the same server. Just trying to wrap my mind around WE and see if that’s the right tool for this job.
Yep thanks. In the process of getting a sample app set up and connecting to the database but I run into “unable to launch application on port xxxxx” errors about 80% of the time I upload a new build. I’ve checked file permissions and have set an app identifier. I guess that’s a separate issue.
So very simple apps that I build will upload and run fine, but now that I’ve added some code for the MySQL server, it’s including the MySQLCommunityPlugin.so along with some other libraries. Should I be worried about issues between 32/64 bit if I’m on a 64 bit server?
As Xojo apps are 32-bit only, you’ll need to install appropriate 32-bit compatibility libraries for your Linux server for Xojo web apps to run. I suspect MySQL on the server would also need to have a 32-bit driver available.
[quote]Because of the way that our system is set up installing 32bit packages will cause issues with the server and also with the automated patching.
If you really want to install them we will need to install them on your own because we are not able to provide support for something like this.
Also ia32 is not available in our repositories.[/quote]
Does this mean WE apps are basically a no-go on this specific server?
I may be missing something, but since you have any WE app running, no matter how simple, doesn’t that mean you have enough 32-bit compatibility installed? I thought it was go/no-go. Any additional complexity, such as the MySQLCommunityPlugin.so, you’re supplying in your Libs folder yourself.
Right that’s why I am a bit confused. I’m still getting some of the apps to run properly (very, very basic ones), but I haven’t gotten anything to run with the MySQLCommunityPlugin included. I was under the impression that it wouldn’t run at all since it’s a 64bit server.
I recall skimming that now. I found the whole issue confusing.
I’m glad someone found the EEWEb example useful. It doesn’t really make sense to me. It appears that they create a new database for each session. That seems like an odd hack. Why isn’t it being done with a database in the session object? Is that the issue people were saying is problematic?
Another thought, would the “Unable to launch application ‘xxxxx’ on port xxxxx” error message even be an indication of a 32/64 bit problem? Would it even get to the point of that error message if it wasn’t capable of running the application due to that?