Does odoo keep a database connection open in a multitenant system? - odoo

We know odoo can use the dbfilter - in the config file - for it to choose the right database when a new request comes in.
But does it keep the database connection open after the request is fulfilled (in its registry object)?
Let's say I have a system with 50 databases and dbfilter=^%d$. Here odoo will use the subdomain as the database filter and process the request. But I would like to know if it will keep the database connection open as a registry object so that every other request the comes from the same subdomain later on, doesn't have to open the connection, again.
Asking this because what if in my multi tenant architecture, certain DB's are used much less frequently than the others. Will keeping the database connection open be an expense? (Please consider 50 databases and subdomains)

Related

How to make sure uploaded files saved successfully

Here is the scenario:
A user select some files using a browser or an app and send them to a server.
The server save them on the file system permanently.
The server save the address of the files on a database.
How can I make sure this scenario happens like a transaction? For example, do I need to calculate the number/checksum of files both at the client side and the server side? What happens if the server shutdown after the 2nd step and before the 3rd step? What other things should I consider for a robust file uploading?

How to move MVC application from one server to another?

Currently we are subscribed to GoDaddy for their dedicated server lease, and now we are considering just purchasing our own server and just moving off of GoDaddy.
I have no idea how to put all of my source code from one server to another and also move the database and other files. Please explain what process has to be followed for this.
Also wanted to ask if their would be any changed for the third party tools i have used in my application?
To migrate my web application from one server to another I would do following :
Make a list of all transferable which would be:
Latest and running Source code on the server (ideally located in wwwroot)
database back up files (usually .mdb or .bak)
Copy source code and database back up to targeted server. Obviously depending upon type of the server you may need to set up the site in IIS and and point it to new directory
Restore database backup on database server
edit web.config to point to new database server and credentials.
Another important tip: If you have kept domain name with GoDaddy and only changing hosting server you may also need to change namedserver of you domain, without which you will not be able to point your domain to new hosting provider!
You may not succeed on the very first attempt of copying your stuffs to target server. It's always better to maintain back up so that you can copy files again and again in case something goes wrong on the new server.
As long as third party charges are concerned please check with your service providers they may be able to guide you best. For above simple stuff you do not need to worry about license stuff.
All the best!

Laravel passport oauth multiple database connection

So, I'm building this api where each client use the same system (controllers, models). Each client has his own database and a website that connect's to this database.
Now that's the problem, this api must serve all this websites with different database connections and since I'm new to Laravel, I'm facing a hard time. What's the best way to do that?
Should I save each database in a file (for example client's id is 1, so we have a folder with a file named 1.env with database info)?
PS.: I'm using oauth2
The solution I found was: each client with his own database and a folder with "users" and a subfolder for each client. Inside, a file with database info, in login we use a global table that indicates where's the database from that user. Next step is load the database connection and check user/password. That was a quick solution.
However in my research I stumped into "multi tenancy" thing that seams way better, you can find it more on this link.

SQL Server Replication: cannot open file (OS Error 5) even though I can manually log in as the executing user and open the file

I have a remote server running SQL Server 9.0.3042, trying to subscribe to a publication on a server running SQL Server 10.0.2531.
These servers are on different domains which basically hate each other and largely refuse to allow their users access to each other.
They do both communicate nicely with a third domain, and it is a user from that domain which I am using as the process owner on both servers.
I have created a shared folder on the publishing server, and I am using it as the Snapshot folder, set via Publication Properties -> Snapshot -> "Put files in the following folder" and have confirmed that the files are being published locally and can be accessed via the shared folder.
The Snapshot Agent on the publishing server runs and appears to complete successfully.
I've then created a Pull subscription on the subscribing server and told it to run with the Agent Process Account of the same user that runs the snapshot agent on the publisher.
I've redirected the snapshot location to "Alternate folder" and set that folder to be the shared folder on the remote server that I set up earlier.
The Pulling server connects correctly to the Publishing server, And then fails because "The process could not read file "\[server].[domain][share][snapshot directory][file].pre" due to OS error 5"
I've logged into the Pull server as the executing account and manually navigated to, and opened, that file. I've done the same on the publishing server.
I'm out of ideas. What am I screwing up?
OS Error 5 is ERROR_ACCESS_DENIED. You're not being allowed to get to the folder. Check to make sure that the user account trying to get to the files has at least read access to the folder containing the files.
The decision has been taken that we're pretty much on the point where we're going to move every user in the company over to a brand new domain, and that this problem isn't worth the time and effort of fixing.
I did find this SO question which relates a similar problem, but I don't intend to investigate this matter any further.

HSQLDB equivalent of H2 automatic mixed mode

Is there one? Apparently not. The H2 automatic mixed mode is described
here.
Revival for further reference.
As stated by #fredt, as far as I know, there is no official magic parameter to achieve mixed mode.
Still, you can always start a server programmatically using a Server object so that other process are able to connect to your database.
I discovery a trick to accomplish something pretty close to mixed mode. In order to do that you will need to set the remote_open property to true and connect using this form of URL.
The idea here is doing something like this:
Try connecting to the server using the kind of URL stated above.
If you can't connect it means the server haven't been started, so go ahead and start the server programmatically.
When you connect again, one of three things will happen.
If no database file exists, one will be created in the specified file path and the server will start serving it from the URL alias.
If the database file exists and it isn't being served, the server will open the file from the specified path and start serving it.
If the database file exists and it is being served, the server will simply return a connection.
I'm not sure if it is safe to use that kind of pattern when you plan to spawn a lot of short lived processes (particularly I haven't dive into HSQLDB code to check how it handles database / creation / opening for multiple simultaneous requests when remote_open is set). Still, I've been using this kind of pattern to share development databases between Web Applications for a while and never ran into a single database corruption problem.
The main limitation here is that when the application acting as a server is closed, open connections will stop working and throw Exceptions... Which is not an Issue for my development environment, here this will generally only means one or two broken requests until another server is started and the connection pool detects and renews its connections.
No HSQLDB does not support such a mode.