VFP Primary Key

Questions and answers regarding general SQL and backend databases

VFP Primary Key

Postby kwpsd » Mon Jul 30, 2012 5:17 am

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?
Kim W. Premuda
San Diego, CA USA
User avatar
kwpsd
 
Posts: 687
Joined: Sat Jul 28, 2007 6:59 pm
Location: San Diego, CA USA

Re: VFP Primary Key

Postby omar » Mon Jul 30, 2012 9:46 am

Have you tried restarting the application server?
Intrasoft, Founder
Omar van Galen
omar@intrasoft.nl
+31-(0)6-21234586
Servoy Developer
omar
 
Posts: 377
Joined: Sat Feb 12, 2011 4:51 pm
Location: Intrasoft, The Netherlands

Re: VFP Primary Key

Postby kwpsd » Mon Jul 30, 2012 3:57 pm

The server has been re-started several times. We also uninstalled and re-installed the solution, re-starting the server each time.
Kim W. Premuda
San Diego, CA USA
User avatar
kwpsd
 
Posts: 687
Joined: Sat Jul 28, 2007 6:59 pm
Location: San Diego, CA USA

Re: VFP Primary Key

Postby omar » Mon Jul 30, 2012 7:05 pm

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...
Intrasoft, Founder
Omar van Galen
omar@intrasoft.nl
+31-(0)6-21234586
Servoy Developer
omar
 
Posts: 377
Joined: Sat Feb 12, 2011 4:51 pm
Location: Intrasoft, The Netherlands

Re: VFP Primary Key

Postby kwpsd » Mon Jul 30, 2012 10:45 pm

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).
Kim W. Premuda
San Diego, CA USA
User avatar
kwpsd
 
Posts: 687
Joined: Sat Jul 28, 2007 6:59 pm
Location: San Diego, CA USA

Re: VFP Primary Key

Postby omar » Tue Jul 31, 2012 12:08 am

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,
Intrasoft, Founder
Omar van Galen
omar@intrasoft.nl
+31-(0)6-21234586
Servoy Developer
omar
 
Posts: 377
Joined: Sat Feb 12, 2011 4:51 pm
Location: Intrasoft, The Netherlands

Re: VFP Primary Key

Postby kwpsd » Tue Jul 31, 2012 2:35 am

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.
Kim W. Premuda
San Diego, CA USA
User avatar
kwpsd
 
Posts: 687
Joined: Sat Jul 28, 2007 6:59 pm
Location: San Diego, CA USA

Re: VFP Primary Key

Postby kwpsd » Tue Jul 31, 2012 7:35 pm

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!
Kim W. Premuda
San Diego, CA USA
User avatar
kwpsd
 
Posts: 687
Joined: Sat Jul 28, 2007 6:59 pm
Location: San Diego, CA USA

Re: VFP Primary Key

Postby david » Tue Jul 31, 2012 8:05 pm

kwpsd wrote: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.
User avatar
david
 
Posts: 1727
Joined: Thu Apr 24, 2003 4:18 pm
Location: Washington, D.C.

Re: VFP Primary Key

Postby kwpsd » Tue Jul 31, 2012 8:55 pm

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?
Kim W. Premuda
San Diego, CA USA
User avatar
kwpsd
 
Posts: 687
Joined: Sat Jul 28, 2007 6:59 pm
Location: San Diego, CA USA

Re: VFP Primary Key

Postby omar » Wed Aug 01, 2012 4:47 pm

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,
Intrasoft, Founder
Omar van Galen
omar@intrasoft.nl
+31-(0)6-21234586
Servoy Developer
omar
 
Posts: 377
Joined: Sat Feb 12, 2011 4:51 pm
Location: Intrasoft, The Netherlands

Re: VFP Primary Key

Postby david » Wed Aug 01, 2012 5:40 pm

kwpsd wrote: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.
David Workman, Kabootit

Image
Everything you need to build great apps with Servoy
User avatar
david
 
Posts: 1727
Joined: Thu Apr 24, 2003 4:18 pm
Location: Washington, D.C.

Re: VFP Primary Key

Postby kwpsd » Thu Aug 02, 2012 2:54 am

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!
Kim W. Premuda
San Diego, CA USA
User avatar
kwpsd
 
Posts: 687
Joined: Sat Jul 28, 2007 6:59 pm
Location: San Diego, CA USA

Re: VFP Primary Key

Postby david » Thu Aug 02, 2012 6:16 pm

kwpsd wrote: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.
David Workman, Kabootit

Image
Everything you need to build great apps with Servoy
User avatar
david
 
Posts: 1727
Joined: Thu Apr 24, 2003 4:18 pm
Location: Washington, D.C.

Re: VFP Primary Key

Postby kwpsd » Thu Aug 02, 2012 6:36 pm

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.
Kim W. Premuda
San Diego, CA USA
User avatar
kwpsd
 
Posts: 687
Joined: Sat Jul 28, 2007 6:59 pm
Location: San Diego, CA USA

Next

Return to SQL Databases

Who is online

Users browsing this forum: No registered users and 1 guest