Hi All,
We have a solution that uses a MSSQL DB and It had some integrity constraint defined on it between some of its tables.
During development, we removed integrity constraint.
The problem is that when we import the solution from the Server page Administration,there are some
warning messages indicating that table(s) X had constraints, nevertheless, we have deleted them.
We can import the solution, but we have some unwanted behaviour like failed insert…
we had to uninstall and reinstall servoy to resolve the problem.Something we wont to do after each modification ine the database structure
My question is there any way to reset the kept info.
Thank you for your support
Servoy version : 5.1.4 - build 964
BD : MSSQL Server 2005
If you change anything in the database schema outside of Servoy then Servoy won’t see those changes as you have noticed. The only thing to do to solve this is to restart Servoy Server. It reads all schema information at startup.
So totally no need to reinstall Servoy after a schema change.
I’m sorry if I have noticed or supposed something not correct about how Servoy manage the Shema Database update.
Robert wote
The only thing to do to solve this is to restart Servoy Server. It reads all schema information at startup.
We have restarted the Servoy Server many times but always the same warning messages appear.
Something important to indicate about test we did before reinstall Servoy:
we have tested the same solution based on the same database, but in two different Servoy Server.
In one Server it works fine, but in the second Server it fails,nevertheless , they have an identique configuration.
Can we know where the Database Shema information is kept? it might help us or someone who has the same
problem to see the difference?
Ok, thank you for the information about Servoy repository.
Unfortunately, we didn’t take a screenshot of the warning because we had to solve the problem immediately on the client test Server.
The warning was something like :
The server version of the table ‘XX’ in server ‘YYY’ doesn’t have constraint while the import version has constraint.
We are trying to reproduce the problem to have the exact message.
We’ve tried to reproduce the problem in a sample solution by adding and removing constraint, but it doesn’t happen.
I hope that it’ll be the case for ever
But is there a way to reinitialize the servoy repository if we need to do that?
madimane:
But is there a way to reinitialize the servoy repository if we need to do that?
Like I said Servoy Server reads the schema when it launches and stores it.
But if you really want to start from scratch you export all your solutions to .servoy files. Stop Servoy server and drop the database and create a new one with the same name. Launch Servoy server via the commandline using java -jar servoy_server.sh -upgradeRepository (or launch Developer if you want a GUI). This will recreate the tables for you in the repository database. After this you can launch Servoy Server normally and re-import the solutions.
If you’re making database changes outside of Servoy (which we do all the time since our database structure is setup via database scripts) we’ve found that if you shutdown the server and delete all the records in the servoy_columninfo table that’s enough to do the trick. That way you don’t have to mess with actually rebuilding the repository as mentioned above. We wish there was a way in the admin console to tell the server to rescan so it could detect all changes but unfortunately there isn’t.
Yeroc:
we’ve found that if you shutdown the server and delete all the records in the servoy_columninfo table that’s enough to do the trick
Like living on the edge?
Servoy should be aware of any changes in your database after restart.
Messing around with the repository database shouldn’t be necessary in any way.
If you change properties of existing columns (like varchar type columnlength from 50 to 1000), Servoy will be aware of the change after server restart, but still your solution isn’t as the repository holds all this data.
Especially the link Paul Bakker mentioned: Docs
(Only for Servoy versions that have the Maintenance plugin shipped v5.1 and higher if I’m not mistaken)
As far as I know the thread you are referencing is only applicable to Servoy 5.x. We’re still on 4.1.7 so don’t have the option to tell Servoy to rescan the database structure. Glad that’s an option moving forward though. We’ve found that a restart of the server alone isn’t always sufficient to get it to see the new database changes.
Yeroc:
As far as I know the thread you are referencing is only applicable to Servoy 5.x. We’re still on 4.1.7 so don’t have the option to tell Servoy to rescan the database structure.
True, I mentioned that in the more specific link.
Manually editing the repository database though can be quite harmful. It’s a complex structure of records where you’ll also have to take into account that records are version bound.
(not sure if this goes for the ‘servoy_columninfo’ as this info is bound to the database structure which - I assume - won’t change whenever you move back to a previous version)
madimane:
The warning was something like :
The server version of the table ‘XX’ in server ‘YYY’ doesn’t have constraint while the import version has constraint.
Othmane,
This message is not about database constraints, but about column flags compared from the one you are importing against the one that is in the Servoy repository.
The flags compared are: row_ident, pk, uuid and excluded.