Mairlist on one computer, with mairlistDB server

Hello everybody,

I think it’s a bug (or maybe a feature request)…
I use mairlist only on one computer : all is installed on it, and all is used on this computer…
For “database locked” errors, I upgrade my license to advanced server in order to use the mairlistDB server (kind of proxy of the mairlistDB local file). It should fix all “locked” errors. But, at the moment, I do have 2 databases configuration on my mairlist configuration :

  • The mairlistDB local (my original database)
  • The mairlistDB internet client (set to connect to the mairlistDB Server).

The problem is that both database configuration have the same database ID. It’s normal, as they are both related to the same database. But, the problem is when opening mairlist playout… as I can’t choose the database I want to use when opening the playout, I have a warning message each time to tell me that there are duplicated database ID and unexpected behaviour can occur.
No problem for mairlistDB app that let me choose, at opening window, which database I want to use…
Mairlist configuration also raise an alert at opening as one or more database have the same databaseID.

In my mind, mairlistDB Server had been thought to be use when you have 2 computers (minimum). In this case, 2 instances of mairlist will run. And each instance will have its configuration and each one will have only one database configuration… So, even if database ID will be the same, they are used on two different computers.

I think it’s a bug as mairlistDB server could be used also (like in my case) to better use database connection, event if there is only one computer…

Note : I tried to unchecked the mairlistDB local database configuration to keep only the mairlistDB internet client. It works only if the mairlistDB server process had been launched before you unchecked the local file database. If you start it after, you get a “no database connections found”…

Maybe it could be handy :

    • To add a command line parameter of mairlist.exe program, to choose which database to open (specifying the database ID). Something like
      mairlist.exe -dbid '{XXX}'
    • To give the mairlistDB internet client a specific databaseID, not the same as the related ‘remote’ database.

What do you think about it ?

Regards,

Sylvain

Hi Sylvain,

as I already told you in detailed PMs this doesn’t work and they can’t have the same ID.

And after I read this thread I’m thinking that you still get wrong how the db server works and what it does, aside from my explanations (?).

That’s irrelevant even when you are using a local db and are connected to a second via db server with the same database ID. You can’t use two identically IDs in the same instance.

No. It is possible to use it on one PC only (also there is no need for that if you have no other connected PC) but all your database entries needs different IDs.

You need to remove the database connection from the configuration, not just uncheck it. I know that is not logical but couldn’t be changed easy if I remember it right.

If you want to have different configurations you can use the Multi Instance Manager

Although it is meant for Multi-Station-Playouts on one PC it can be used to start standalone instances with different settings and database connections.

You can only run one instance at a time if you have no multi instance upgrade. But that’s fine if you just need different connections etc (so you can have two with just one database connection or different layouts, different audio routings etc with the same database).

Still you need to have database entries with different IDs or only one entry.

If the server is not active there is no connection mAirList could establish. So that does make sense, right? :wink:

This is already possible but not in the way you want it to work. It’s a parameter to open one of the databases that are set up as a standard when opening the db server connection or auto importer to provide auto-start options without needing to manually select a database on start-up.

But it will still be affected by two same IDs in the configuration so just use ONE of the databases or change the ID of one.

All of your problems are based on two identically IDs of the set databases.

That’s not relevant - if you establish a connection to a database with the same ID like the local db on one PC you will get errors and write restriction problems.

Did you use the Multi Instance Manager for this setup?

The internet client needs no ID - it connects to the db server which uses the ID of the connected database.

Hello Stefan,

Big thank you for trying to help me these last few days.
I’m not sure I’m totally wrong… as I read carefully post where Torben said that “mairlistDB Server” is a kind of “proxy” for a database (and not a database itself - that’s was I thought at the beginning). So, it makes sense that, as it’s not a database, but only a server in front of the database, the displayed ID is the one of the database behing the “proxy”.

But, to be sure I do things correctly. I will tell you what I did.

On my unique computer dedicated to the station, I have a mairlistDB (local mode) connection to a sqlite file on my hard drive :
image

with this ID :

image

I just want to replace the local database access by the “mairlistDB Server” access as it can avoid having “database locked” errors during playback.

So, after upgrading my license, I launched this program “Database Server” :
image

And get this window :
image

I checked the “enable server” checkbox and let the other options with default values. Here, I can’t choose which database to link. I guess mAirlist use the activated one (so, my mairlistDB in local mode). The only one I have at the moment.

Previously, in mairlistDB app management, I created an administrator user.
image

In mairlistConfiguration, I created a new database connection with the “mAirlistDB (internet client)”
image

And, I put my parameters within this window :

And “test login” succeeds.
image

When I save my new database connection, mAirlist configuration ask me to retrieve the Database ID. I said “yes”.

So now, I get 2 database connection : the original one, and the new one
image

And, if I check the database ID of my second connection, I get :
image

As you can see, it’s the same database ID as the one of the mairlistDB in local mode. I confirm that the circle arrows icon doesn’t renew the ID as it retrieves it from the id stored in the database.

So, now, I just want to use the second connection for my mAirlistDB app management and my mAirlist Playout app.
That’s why I unchecked the first one :

But now, I will not be able to start the “Database Server” program because there will be no more active database connection. And if I let both activated, I have some warning messages…

Where I’m wrong here ?
Maybe you can detailed me the correct steps (assuming you have understood my mono-pc mono-instance configuration) ?

To answer your questions, I don’t use “multi instance” manager because my license doesn’t allow me to do that and because I need only one instance.

Yes, I understand very well. But as you can see, mairlist do the job for me and I can’t change it by myself (except in database.ini file).

Mmmm, if I remove my local database connection, “database server” program will not start telling me “no database connections found” and I will loose everything for nothing.

Maybe I’m not clear.
I know very well that if the server is not running, mairlist could not establish connection. I was telling that if I unchecked the “local” mairlistDB, I can’t start the server as the “DBServer.bat” process warns me, at startup, that there is no connection found.
I was explaining that, if the “DBServer.bat” is running and I unchecked after, in configuration, the “local” mairlistDB, the server keeps working until it is stopped. After that, it ‘knows’ that the “local” mairlistDB had been disabled and refuse to start…

Yes, it’s logical. But, on one computer with one instance, it’s a problem as 2 connections must be enabled : the local one (to which the db server should connect) and the “internet client” one (that mairlist playout and mairlist app management should reach to work)…

A general question:
why do you want to re-integrate the same database?

This is not the right way to work with a database-server.

The mAirListDB Server programme is a tool only for accessing a database from a remote mAirList installation, for instance, granting a remote DJ access to your own music. It has nothing to do with correcting “database locked”-issues, i. e. this flaw has its reasons elsewhere. If you set up your local database correctly – just as @Stefan_Hillen is trying to work out for you (but obviously not with you) – it will work, as it does on almost every other users’ stations.

As explained earlier, with the local file, I get some “database locked” errors during playback that cause silences between tracks…
And Stefan told me that “mairlistDB Server” could better manager database connection and avoid this king of error.

On my side, I have a script that launch at the event “OnPlayerStart” that use methods to get/set data on the playlistItem… But, I don’t know if my script comes into conflicts with some mairlist internal database calls (for logging or whatever)…

If there is only one instance accessing the local Mairlist *.mldb file, this behavior is not normal and must have other causes.

We can’t know that because we don’t know the script.

Thank you Tondose for your answer.

For “mairlistDB Server”, it’s what I think since the beginning. But maybe as the program manage all database connection, it is able to better route calls, and avoid multiple calls not managed by accessing directly to the local database file.

Honestly, my local database has nothing specific. I have one station, one instance, one computer. I set the local database like this.
image
image
image
image

All other tabs are unchanged.

The only thing I have, as explained to ssnoopy, is that I have a OnPlayerStart script that add volume points on the playing track. And maybe it comes into conflicts with internal database calls I don’t see…

Here it is if you want to check… (its development is still in progress/test).

I use documented methods to add volume points, and to get data from database… Nothing complex or exotic I think…
OnPlayerStart.mls (8.5 KB)

Do you still get the error “Database locked” if you deactivate the script?

Why don’t you simply believe what experts tell you? Guessing problems away is always erratic.

For the script, please follow @ssnoopy ’s suggestion.

And “experts” said me that mAirlist DB Server could help me, in my mono-instance, mono-computer, mono-database configuration to avoid “database locked” errors.
I was said that I can’t have 2 identical databaseID (what I understand very well) and I explained that I can’t choose when I set the database connection and asked for how to do it, and what I did wrong.

I don’t ask for anything better than to do what experts can tell me : that’s why I explain you the objectives of what I’m trying to achieve.

Not yet.

I will give it a try today but if it’s the cause of the database locked, what can I do ? Does it mean that we can modify anything on the current playing track (like adding volume envelope points) ?

Do you get any error messages while running the script? (See system log.) Which AI did you employ for writing your script? Would you mind explaining the line

SweeperItemDB := Database(0).LookupByInternalID(SweeperItem.GetDatabaseID);

please?

There is no SystemLog in this script. So, I can’t tell if error messages are during its execution or not.
As I will try to disable it today, I will also try to add SystemLog to see if there is any code in it that give me the “database locked” errors (which is a random error)…

I don’t use any AI for writing this script. All my scripts are self-made with an intensive use of this community, and the online mairlist documentation https://scripting.docs.mairlist.com

As this script modifies the SweeperItem playlistItem Object, the original item values are not available anymore. In this part of the script, I use this line of code to retrieve the original SweeperItem Object from the database, with its original values stored in database.

To be more precise : “start next” cue point had been modified earlier by a postprocessing scripts during scheduling the hour. So, here in the playlist, the “start next” cue point is not the original one. And here in the OnPlayerStart script, I need to retrieve the original value of the “start next” cue points. So I requested the database to give me the value.

mAirList Script will log major errors by itself. Did you have a look into the logfile, actually? Or is this an educated guess of your’s, too?

Fot the script, why do you try retrieve the original StartNext-value from the database at all? On player start, before fiddling around with any values, read it directly from the playlist item in question, store it in a variable and reinstate it at the right point in time.

1 Like

Is it me or are you kidding me ? You do not have to help me if you think I’m not listening to the help you bring me. I can assure you I don’t ask better to do what the community propose me (that’s why I’m currently trying to run a playlist without this OnPlayerStart script.

By the way, I use massively the mairlist logfile to debug my script and my problem BEFORE writing to the community. I’m a developer since nearly 20 years and I know very well how we can debug code on system…
But, except if I’m wrong, when mairlist logs an error, it doesn’t tell which script triggered the error. And as there is lot of things that can be executed in the same time, it’s not as easy as you seems to convince me.

|2024-07-28 17:49:24|Error|Error writing log entry into database Heaven REWIND / REPLAY: [FireDAC][Phys][SQLite] ERROR: database is locked|

Here, who can tell it’s the OnPlayerStart Event that trigger this error ? Before there is a start playlist item event and after a stop playlist event. That’s why I imagine to add a SystemLog instruction at the beginning and at the end of specific instruction of the script to identify where the error occurs…

Secondly, to your last proposal :

Because it has been modified in this playlist PREVIOUSLY, after being scheduled by mAirlist DB app (by a custom postprocessing script). So, when the playlist comes into the playout, the segue had already been altered.

Reading it on the playlist item gives me the modified value.
As this point of the script, I need the original duration of the playlist item. As StartNext cue point is not the original value, the duration is not correct. So, I retrieve the original item in the database to retrieve the original cue points (and therefore, the right duration).

Please read carefully what I wrote about it - you can use it BUT only with one opened instance at a time.

No, you never mentioned that you were using one PC only in that post and you never wrote about a script that will access the database too :wink:

I just explained to you when the db server could help you and what it does regarding to this information.

And when I asked you about your setup in a PM, after you posted and deleted a thread with, for me, confusing informations and obviously after you bought the advanced server version, you then told me about your special setup on a virtual computer with virtual cables‘ audio routing and playing from two playlists sometimes. And using a script.

So how should people know that you are going a route with your mAirList that isn‘t standard by far?

Btw: Of course you can’t change the ID of connected database by using the internet client connection - every user would then be able to change the ID of a remotely connected DB and make it unavailable for all other connected clients.

You’re totally right Stefan. It’s my fault if I didn’t explain my configuration very well.

As a result, I bought an advanced server license that will not be useful for me because it will not help me to avoid those errors. Too bad…
Maybe one day, I will bought another standard mairlist license to install it on a second computer… and at this moment, this “mairlistDB server” will become useful…
For now, problem is not (really) solved, but too bad again… I don’t want to take more of your time.
I have another open topic for scripting purpose about saving playlist, but I’m going to try to figure it out on my own, as I think I annoyed you.

Thank you for all your replies for the last days.

Best regards,


Sylvain