Hey guys,
I started deploying my test solution to a couple of users, I ran into some really wierd problems.
My solution basically has some global fields where it takes the data, and when the user hits “commit” button, it’ll create a new record in the main table.
However, my users getting this “error saving data” message. Nothing is written in the “more detail” window.
I tried it out on my developer version. and the more detail window says “JDBC serious Primary key error” or something like that.
I went to my dataprovider window and click properties with the pk field. Properties says that it is a SERVOY SEQ, and the serial # is at 227. When i SYNC with DB, the number changed to #229. Can this be the cause of my PK errors? Am i doing something wrong to cause pk errors? and Should i use Servoy SEQ or DB identity as my primary key? The biggest problem is, how can my PKs get out of sync in the first place? i never even messed with it at all. Always leaving the pkids as default.
**i tried erasing ALL the data from all my tables, then sync all the servoy seq back to 1, however, i still get a mysterious “error saving data” message and clicking on detail reveals no written error message in the message box"
ANY IDEAS?!??!
Using Servoy 2.2
Microsoft SQL server 2000.
PLEASE HELP.
thanks!
Have also seen this error a couple of times but only when moving between development and deployed systems. Synching the PK with database has always sorted it for me with no re-occurence.
HTH
Graham Greensall
Worxinfo Ltd
In general this happens if you run multiple servers agains the same repository. The sequences are managed by the server to ensure uniqueness but if you run two servers they can potentially start conlicting, I have seen this happen many times if you run server for production and connect with developer to the live repository and also create new records with developer. Solution: don’t use developer to create new records if you are also running server.
jaleman:
In general this happens if you run multiple servers agains the same repository. The sequences are managed by the server to ensure uniqueness but if you run two servers they can potentially start conlicting, I have seen this happen many times if you run server for production and connect with developer to the live repository and also create new records with developer. Solution: don’t use developer to create new records if you are also running server.
That makes sense. I had just changed over server from my local developer setup to a new SQL server 2000 server. Can you confirm if the following will fix the problem:
Since all data is still dummy, i plan to erase ALL data. Reset the SEQ ID. Then I will no longer connect to the database with my developer from my local desktop. (which means I can only develop on my SQL server 2000 computer only? or can i use my desktop only) I need to make absolutely sure that “error saving form” does not happen for my end users.
Thanks for your help.
That will fix the problem
One thing I find during development is that in general there isn’t much need to have users test it as ‘clients’ per se and thus little need to have Server running. I often have individuals just check it out on my station using developer. Alternatively you can have one or two check it out using client but from your Developer IP address. Developer also launches Servoy Server automatically from that box you are using and there are client trial licenses automatically available that allow them to connect.
john.allen:
One thing I find during development is that in general there isn’t much need to have users test it as ‘clients’ per se and thus little need to have Server running. I often have individuals just check it out on my station using developer. Alternatively you can have one or two check it out using client but from your Developer IP address. Developer also launches Servoy Server automatically from that box you are using and there are client trial licenses automatically available that allow them to connect.
Thanks for the pointers. However, we have engineering, QA, and manufacturing department that all want their inputs into how the database should loo like. Client testing is crucial. But you’re right, it might be better just to have everything on my developer machine rather during my development stage.
jaleman:
That will fix the problem
AHHH! I deleted all my data, resync the servoy SEQ # back to 1 and I’m only launch 1 version of developer (on my SQL server machine) and immediately, it’s STILL giving the same “error saving form” error messages.
I do also have audit trail turned on. (can that be part of the problem?)
this problem only started after I migrated everything over from my developer client computer to the new SQL server 2000 server. arg!
Isn’t it something else then? What do you see if you start with stacktrace?
jaleman:
Isn’t it something else then? What do you see if you start with stacktrace?
It must be. what is a stacktrace?
Hi Sammy,
On a Mac you start stacktrace using this command in Terminal when you have navigated to the Servoy directory:
java -DSTACKTRACE=true -jar servoy_developer.jar
I’m not sure how to launch it from a PC but presumably using the command line in a similar fashion. Couldn’t find a reference for a PC doing a very quick search but you can probably locate one. Basically it is a log file that writes everything that is going on with every Servoy action.
I finally am able to consistently reproduce the problem. It’s the strangest thing.
i have a script that runs (launches a popup window to log in the user barcode) when i exit the field (ONDATACHANGE method). These are just regulard fields.
When I hit the TAB key after entering data, the data records, script launches, no errors. however, when i use a mouse to click OFF the field after entering data, the ERROR message “error cannot save form” pops up, then the rest of my script launches like before. The data still gets recorded.
Really strange error. anyone have any ideas?
sammyzheng:
I finally am able to consistently reproduce the problem. It’s the strangest thing.
i have a script that runs (launches a popup window to log in the user barcode) when i exit the field (ONDATACHANGE method). These are just regulard fields.
When I hit the TAB key after entering data, the data records, script launches, no errors. however, when i use a mouse to click OFF the field after entering data, the ERROR message “error cannot save form” pops up, then the rest of my script launches like before. The data still gets recorded.
Really strange error. anyone have any ideas?
When you hit tab data is not sent to the backend database, if you click on an empty part of the form you do trigger a savedata command that sends all pending changes to your backend db.
Most probably when you click out of the field not all (required [fk’s?]) are filled in which is why you get an error and when you tab you do fill them all in. If certain fields must be filled in before the database is happy (db constraints) you can (temporarily) disable servoy autosave function using the function setFocusLostSaveEnabled on the Application object.
jaleman:
sammyzheng:
I finally am able to consistently reproduce the problem. It’s the strangest thing.
i have a script that runs (launches a popup window to log in the user barcode) when i exit the field (ONDATACHANGE method). These are just regulard fields.
When I hit the TAB key after entering data, the data records, script launches, no errors. however, when i use a mouse to click OFF the field after entering data, the ERROR message “error cannot save form” pops up, then the rest of my script launches like before. The data still gets recorded.
Really strange error. anyone have any ideas?
When you hit tab data is not sent to the backend database, if you click on an empty part of the form you do trigger a savedata command that sends all pending changes to your backend db.
Most probably when you click out of the field not all (required [fk’s?]) are filled in which is why you get an error and when you tab you do fill them all in. If certain fields must be filled in before the database is happy (db constraints) you can (temporarily) disable servoy autosave function using the function setFocusLostSaveEnabled on the Application object.
The strange thing is that it’s a regular field and ondatachange, execute a pop up window. If i turn off the “ondatachange” i don’t get that error. Even if i click off the field to savedata. There aren’t any db constraints (that i know of) at all. Wierd. the data gets recorded without any problems. Is there an “omit error message” command similiar to filemaker’s seterrorcapture(on) command?
Why not post the method which you run with the ‘onDataChange’ event ??
Cheers
Harry
Harry Catharell:
Why not post the method which you run with the ‘onDataChange’ event ??
Cheers
Harry
I don’t think the method has anything to do with it, because all it does is call a pop-up window.
but here it is:
globals.g_password = null
application.showFormInDialog(forms.alp_od_final_password,-1,-1,-1,-1);
forms.alp_od_final_password.elements.password.requestFocus()
The field is a regular number field in a table. If i take out the ondatachange method and just type in a number, no problems at all. But once i put in the method to run ondatachange, that’s when i get the error when i click off the field (but not using tab)