Similar Database Server Confuses Eclipse

Questions and answers regarding the use of eclipse environment as seen in Servoy Developer

Similar Database Server Confuses Eclipse

Postby gdurniak » Thu May 12, 2016 7:16 pm

I unloaded one of my Sybase ASA 10 Databases, and re-loaded an edited version with a new name, on a new Server

However, when I added it as a Resource in Eclipse ( Developer 7.4.3 ), it made a mess. My solution suddenly had 1300 Warnings

The original Database Server was somehow displaying the edited tables from the new Server

How could this happen ? Is there some hidden ID that I need to remove ?

Although both databases are on the same port ( localhost:2638 ), they have different names

Disabling the new server removed the warnings

greg
gdurniak
 
Posts: 232
Joined: Thu Jul 08, 2004 7:25 pm
Location: Bayside, NY, USA

Re: Similar Database Server Confuses Eclipse

Postby mboegem » Fri May 13, 2016 11:52 am

Hi Greg,

gdurniak wrote:However, when I added it as a Resource in Eclipse ( Developer 7.4.3 )


What did you do to add it?
In case you added a database connection through Servoy: does it have a different name, or the same name as the old connection?
Marc Boegem
Solutiative / JBS Group, Partner
• Servoy Certified Developer
• Servoy Valued Professional
• Freelance Developer

Image

Partner of Tower - The most powerful Git client for Mac and Windows
User avatar
mboegem
 
Posts: 1742
Joined: Sun Oct 14, 2007 1:34 pm
Location: Amsterdam

Re: Similar Database Server Confuses Eclipse

Postby gdurniak » Fri May 13, 2016 12:17 pm

In Resources, I right clicked Database Sources, New Connection, and defined a new database with a different Server Name, and ServiceName

I also Right Clicked "All Solutions", Create New, using the same "Resource"

I now see that this somehow added Servoy Repository Tables to the new database, which is probably the problem

My original Solution has it's own Repository Database file ( servoy_repository.db )


Fortunately, I did very little in the New Solution, so I can trash everything, and start over

How do I Create New Solution, without making a mess ? Perhaps each solution must have it's own Resource ?

Why would Developer add Repository Tables, without warning ?

greg
File Shoppe
gdurniak
 
Posts: 232
Joined: Thu Jul 08, 2004 7:25 pm
Location: Bayside, NY, USA

Re: Similar Database Server Confuses Eclipse

Postby Andrei Costescu » Mon May 16, 2016 7:19 am

Is that "Connect to existing database" or "Create new database"?
If you used connect to existing database what were the names of the old connection name (so Servoy identifiers) and the new connection name?
What are the real database names (old and new) from the connection URLs? The 2 URLs themselfes are different right?

Did you by any chance have in the resources project .dbi information left over from some other old connection with the same name as the new connection? Did you use the "Synchronize with DB server" wizard in the process?

Also what exactly do you mean by "I unloaded one of my Sybase ASA 10 Databases, and re-loaded an edited version with a new name, on a new Server". What kind of changes did you make to it and using which tool?
Andrei Costescu
Servoy
Andrei Costescu
 
Posts: 1018
Joined: Tue Jun 26, 2007 3:14 pm

Re: Similar Database Server Confuses Eclipse

Postby gdurniak » Thu May 19, 2016 12:01 pm

Sorry for the delay. For some reason, I am not getting email notification when a reply is posted ( the Option is checked off )

I used "Connect to existing database"

The original database is called "daypart", and the new database is called "smartmatch". These names are used in each connection URL

The new name "smartmatch" has never been used before

I did not "Synchronize with DB server"

Making the "edited version" of my db was very simple. In Sybase Central, I unloaded "daypart", and re-loaded into a new db as "smartmatch". I then opened "smartmatch" in Sybase Central, and deleted a few tables ( so the new db is similar, but much smaller )

Why would Eclipse add Repository Tables to my new db file, without warning ? I do not see any way to tell Eclipse which db file is the proper Repository ( named servoy_repository.db ). Where is that setting hidden ?

greg
File Shoppe
gdurniak
 
Posts: 232
Joined: Thu Jul 08, 2004 7:25 pm
Location: Bayside, NY, USA

Re: Similar Database Server Confuses Eclipse

Postby Andrei Costescu » Thu May 19, 2016 1:46 pm

Just to be sure: you mentioned the 2 names and that they appear in the connection URL. Do the server names used in Servoy match the database names or did you use the same name for the connection after deleting the old one? (so I am now talking about first field in server editor ("Server name") is it "daypart" for your "daypart" DB/URL and "smartmatch" for your "smartmatch" DB/url?) They can be different and I am asking to make sure you didn't use the same "Server name" for the new connection as the old connection had.

I don't see a reason for developer to create repository tables in a random DB. The repository database is identified only by it's "Server name". So the Servoy server with name "repository_server" (I am talking here again about the server name as configured in Servoy not the one from the URL - which can be anything you like) is considered to be the repository server.

But developer doesn't use/need that repository server - as it stores it's (repository) stuff in the workspace as files.

So it's not clear to me what is happening there - make sure you don't have duplicate names in server connection URLs between "repository_server", "daypart" and "smartmatch" (and in case you deleted the "daypart" connection from developer before connecting to the new one make sure the server name from Servoy is different as well).

For example if you would start application server - so not developer - with the "-upgradeRepository" flag and the server connection named "repository_server" from servoy.properties file (doesn't matter to which real DB / URL it points to, it can even be configured to point to "smartmatch" for example) didn't have the repository tables in it, it would indeed create them. But I guess you didn't do that.
Andrei Costescu
Servoy
Andrei Costescu
 
Posts: 1018
Joined: Tue Jun 26, 2007 3:14 pm

Re: Similar Database Server Confuses Eclipse

Postby gdurniak » Thu May 19, 2016 2:54 pm

Yes, both have their own Server Name, and URL ServiceName

This modification has not yet been exported to Server, so Server should have no effect ( but that suggestion makes sense. Server might create Tables when the solution is imported )


What I will try to do is, delete the Repository Tables from the new database file, and see if the Warnings go away

Since the Workspace is separate from the Repository, I should not lose anything


in my servoy.properties file, Server 28 is servoy_repository, but how does it know to use that ? is it based on the Repository_UUID ? and how is that set ?
Server 44 is smartmatch ( the new db ). How did the properties file get updated ?
Server 1 is daypart


A Related Question: Does it matter if this new Solution uses the same "Resource" ? Defining a new Resource in Eclipse is also confusing, since the name "Resource" in the Solution Manager does not change, only the ToolTip name changes

greg
Last edited by gdurniak on Thu May 19, 2016 3:19 pm, edited 1 time in total.
File Shoppe
gdurniak
 
Posts: 232
Joined: Thu Jul 08, 2004 7:25 pm
Location: Bayside, NY, USA

Re: Similar Database Server Confuses Eclipse

Postby Andrei Costescu » Thu May 19, 2016 3:18 pm

Just make sure any production server doesn't use the same connection as repository before you start to delete tables :). Btw if you have a simple way to reproduce your situation you could create a step-by-step guide or create a video - it should help get to the bottom of what has happened.

The resources project is meant to keep all other things a DB repo would normally keep that are not solutions (styles, information about DB connections/column info and settings, users/groups, ...).
When you create a new solution you can use the same resources project, especially if you are going to deploy the new solution to the same application server as the previous active solution (so both will use the same repository DB when deployed).

If you want your solution to use other styles, DB column information (including Servoy sequences, default values, dbidents, ...) you can create and use a new resources project.
Yes, the Solution Explorer node for Resources does not change label. Only the tooltip shows the name of the workspace project that is being shown and used by the currently active solution. I'm usually not that interested in the name of the resources project after I initially link a solution to it. Activating another solution will automatically activate and show the contents of it's referenced resources project.
Andrei Costescu
Servoy
Andrei Costescu
 
Posts: 1018
Joined: Tue Jun 26, 2007 3:14 pm

Re: Similar Database Server Confuses Eclipse

Postby gdurniak » Thu May 19, 2016 3:23 pm

in my servoy.properties file, Server 28 is servoy_repository, but how does it know to use that ? is it based on the Repository_UUID ? and how is that set ?
Server 44 is smartmatch ( the new db ). That is a surprise. How did the properties file get updated ?
Server 1 is daypart

greg
File Shoppe
gdurniak
 
Posts: 232
Joined: Thu Jul 08, 2004 7:25 pm
Location: Bayside, NY, USA

Re: Similar Database Server Confuses Eclipse

Postby Andrei Costescu » Thu May 19, 2016 3:37 pm

About you edit & last msg.: as I said in a previous post it finds the repository_server by name (by the server name (Servoy one not URL one) - so "repository_server" not "servoy_repository").
Developer and application server use by default the same servoy.properties file. When you add a connection in developer it saves that info to the servoy.properties file.

If you then close developer and start application server for some testing it will use the servoy.properties file that includes your new connection.

Don't start developer while from the same installation the application server is already running and vice-versa. (make a separate app. server install for your application server - and then you can modify your servoy.properties from developer and only change what you want or update the server's file when you want to)
Andrei Costescu
Servoy
Andrei Costescu
 
Posts: 1018
Joined: Tue Jun 26, 2007 3:14 pm

Re: Similar Database Server Confuses Eclipse

Postby Andrei Costescu » Thu May 19, 2016 3:43 pm

To make things clearer about DB usage. For each connection you have:

  • real DB running (Sybase in your case)
  • Servoy connection information for that database (stored in servoy.properties file)
  • DB structure/columns/metadata/servoy specific DB features for that DB (stored in the resources project in case of developer or in repo. DB in case of application server)
Andrei Costescu
Servoy
Andrei Costescu
 
Posts: 1018
Joined: Tue Jun 26, 2007 3:14 pm

Re: Similar Database Server Confuses Eclipse

Postby gdurniak » Thu May 19, 2016 4:05 pm

That's kind of what bugs me

If "repository_server" is the Repository, why would Server or Eclipse ever write repository tables elsewhere ?


I will try not to obsess over this, and move on

Servoy is full ( too full ) of surprises ...

greg
File Shoppe
gdurniak
 
Posts: 232
Joined: Thu Jul 08, 2004 7:25 pm
Location: Bayside, NY, USA

Re: Similar Database Server Confuses Eclipse

Postby Andrei Costescu » Thu May 19, 2016 4:13 pm

Create a reproducible scenario and make a video (if you have time) - then we have a chance of seeing who creates those tables and why.
Normally it won't happen.
Andrei Costescu
Servoy
Andrei Costescu
 
Posts: 1018
Joined: Tue Jun 26, 2007 3:14 pm


Return to Eclipse Environment

Who is online

Users browsing this forum: No registered users and 4 guests