VFP Primary Key

Version: 6.1.0 - build 1418

A solution we are currently working needs to import data from a Visual FoxPro table. In developer, all works as expected, however, when deployed on a Servoy Application Server, the following error is emitted:

Cannot work without primaryKey on table ‘bclist’

In Developer, the table in question (‘bclist’) has a column called ‘pk’ whose Row Ident is set to ‘row_ident’ and whose Sequence Type is set to ‘servoy_seq’. We have deleted and re-created the VFP connection, but that did not help.

We have a different solution in Servoy 6.0.7 that accesses VFP tables with no problem, but this is our first attempt in Servoy 6.1.

Also, in 6.0.7, when we look at the table structure, we can highlight the ‘pk’ column and select the ‘Auto Enter’ tab, manipulate the ‘Next Value’ and ‘Step Size’ fields, and then click on the ‘Update Repository’ button. In 6.1, the buttons are disabled and the fields cannot be altered.

Has something changed in 6.1? Is this a bug, or are we missing something?

Have you tried restarting the application server?

The server has been re-started several times. We also uninstalled and re-installed the solution, re-starting the server each time.

In Developer try the following:

  1. Right-click the database connection
  2. From the popup menu choose “Reload tables/table structure from DB”
  3. If necessary also select the option “Synchronize with DB server information”
  4. If records have been added outside of Servoy also select “Update Servoy Sequences”

Then export the solution and import it on the server. Restart the server.

Hope it helps…

I tried the items you mentioned prior to posting this thread but, to be certain, followed your steps as writtten. The results are the same…the Application Server does not recognize the VFP table as having a pk (although Developer does).

And you did check the option to allow data model changes in the solution import? If that’s the case then I am out of options and will have to rely on one of the application server veterans to help you out.

Cheers,

The Allow Data Model Changes is selected by default.

Thanks for all your suggestions, Omar…they were a good ‘sanity’ check for us!

Would any of the Servoy engineers care to comment? This is preventing us from completing a customer installation. Help, please.

Harro sounds like he is having the same problem with the Application Server not recognizing the pk column. The difference is that his error is emitted on an MS SQL table while the error we receive is emitted on a VFP table. BUT…it’s the same error! In our solution, we are trying to import VFP data into MS SQL tables (we are not getting the error on our MS SQL tables). Also, like us, his solution works fine in Developer; that is, the error only occurs on the Application Server.

https://www.servoy.com/forum/viewtopic.php?f=4&t=18515

Servoy…please help!

kwpsd:
The server has been re-started several times. We also uninstalled and re-installed the solution, re-starting the server each time.

Did you start with a new repository database? If not, try truncating all the repository tables and then re-importing your solution. We were having repository issues with the RCs which necessitated these steps when updating the app server in some instances. Worth a try.

Hi, David.

Thank you for replying. This is a new installation at our customer’s location, so we started with a virgin MS SQL back end. I created the ‘repository_server’ table in MS SQL Studio, then installed the Servoy Application Server. The solution runs fine, except when trying to access the VFP tables; that’s when we get the pk error.

I would like to try your suggestion, but I don’t know what you mean by ‘truncating’ the repository tables. Would you mind providng a little more detail?

Hi Kim,

You may also want to upgrade your VFP driver to: JDBC 3.0 package version 5.1 (http://www.hxtt.com) because there are known issues with the version (JDBC 3.0 package version 4.2) that is provided by default with the Servoy install.

Kind regards,

kwpsd:
Hi, David.

Thank you for replying. This is a new installation at our customer’s location, so we started with a virgin MS SQL back end. I created the ‘repository_server’ table in MS SQL Studio, then installed the Servoy Application Server. The solution runs fine, except when trying to access the VFP tables; that’s when we get the pk error.

I would like to try your suggestion, but I don’t know what you mean by ‘truncating’ the repository tables. Would you mind providng a little more detail?

Truncating = sql term for deleting all the data in tables. But wouldn’t help you as you started from a new database.

You say it works on your development machine using developer but not on the server machine using Servoy server. Have you tried firing up Servoy server on your development machine and developer on your server machine and try things out with those combinations? If things don’t work with Servoy server on your development machine then it is quite likely a Servoy issue. We rarely run into discrepancies between the two but you need to cross this possibility off.

With that out of the way, look at the differences between your server and developer machines. 32-bit vs 64-bit? Java 1.6 vs Java 1.7? Operating systems? MS SQL version discrepancy?

As Omar posted, I would suspect the JDBC driver before anything else. For example, an older driver (or database or java) on a 64-bit operating system can be a problem. We’ve had to go back to a 32-bit operating system in the past because of this.

You really need to know these kinds of things if you are responsible for hosting or installing Servoy solutions. It’s a different skill set than developing applications.

You may also want to upgrade your VFP driver to: JDBC 3.0 package version 5.1…

Omar, I upgraded the driver, however, it made no difference. I tried serveral different DBF files that work in Developer on the Application Server, and all produce the ‘no pk’ error.

Truncating = sql term for deleting all the data in tables. But wouldn’t help you as you started from a new database.

David, thank you, now I understand the terminology. You can delete all the records from the tables in the repository? I did not know that…I always thought the repository was a ‘hands off’ kind of thing, lest you break things. What do you do after ‘truncating’ the tables? Run the servoy_server.bat -updateRepository command, re-install the Application Server, do nothing?

My Developer is running on a Windows 7 64-bit computer using Java v1.6.0_29-b11. The Servoy Application Server is running on a 64-bit Windows 2008 R2 computer with the same Java version. The same Servoy installation program was used on both systems to install Servoy. I would think that the solution running on the Application Server would run just as it did in Developer unless there is a bug.

I have not yet tried installing/running Developer on the Application Server but plan to do so and will report back.

Thank you both for you suggestions!

kwpsd:
David, thank you, now I understand the terminology. You can delete all the records from the tables in the repository? I did not know that…I always thought the repository was a ‘hands off’ kind of thing, lest you break things. What do you do after ‘truncating’ the tables? Run the servoy_server.bat -updateRepository command, re-install the Application Server, do nothing?

Just restart the server and reimport your solutions :) Deleting all the solutions in the servoy admin app also serves to truncate the repository tables.

Useful to start with a “fresh” repository sometimes when debugging hard-to-track errors on the server. On very rare occasions we have had errors due to the repository getting “out of whack”. Lots of modules and lots of versions with lots of duplicated objects as part of the development process might have something to to do with it. Maybe a duplicated object UUID doesn’t get set properly along the way. Or maybe it’s just because we have over 12,000 “warnings” in most of our solutions! What can you do…

The end result usually is that we don’t see changes from latest solution import. After clearing caches and doing all the usual client-side fixes to no avail, resetting the repository is what does the trick for us. 6.1 RC’s were definitely an issue in this regard but haven’t run into it with 6.1 final yet.

Deleting all the solutions in the servoy admin app also serves to truncate the repository tables.

I did not know this either. However, I have been deleting all solutions/modules before re-installing the application all along (thereby, and unknowingly, truncating the repository tables).

I have even uninstalled Servoy, deleted the repository_server database from MS SQL, then re-created the repository_server database and re-installed Servoy and the solution. But, I still get the ‘no pk’ error.

Today, I plan to install Developer on the server to see if that makes any difference.

In Developer, when I create VFP tables in the solution, I set the following in the Solution Explorer:

column name: pk
Row Ident: row_ident
Sequence Type: servoy seq

If I save the solution and re-start Developer, the Sequence Type has been changed to ‘db_identity’.

When I import the solution on the Servoy Application Server, I disovered that ‘Row Ident’ and ‘Sequence Type’ are blank (I discovered this by installing Developer on the Application Server), and when running the solution in Developer, the ‘no pk’ error is emitted. If I then assign the ‘Row Ident’ and ‘Sequence Type’ as described, then the solution runs fine.

Why would the ‘Row Ident’ and ‘Sequence Type’ be blank? I do not know if this is happening when I save the solution, export the solution, or import the solution. Should I report this as a bug?

It could be related to: https://support.servoy.com/browse/SVY-2503. If not, definitely report. Nicely done!