databaseManager.saveData oddity

Questions and answers on designing your Servoy solutions, database modelling and other 'how do I do this' that don't fit in any of the other categories

databaseManager.saveData oddity

Postby steve1376656734 » Thu Mar 28, 2019 6:53 pm

I am facing an issue where I cannot save some records and cannot figure out why. I have set a breakpoint where I think the problem is occurring and this is what I find:

1. I have some edited records which I confirmed by running databaseManager.getEditedRecords()
2. I run databaseManager.saveData() which returns false. From this, I assume the records have not been saved for some reason.
3. I run databaseManager.getFailedRecords() which returns no records.
4. I run databaseManager.getEditedRecords which shows the same records as in step 1.

debug.png
debug.png (235.17 KiB) Viewed 135 times

During the above there are no errors shown in the developer console, no errors in the Servoy log and no SQL is issued to the database.

Can anyone suggest what may be happening?

Thanks.
Steve
SAN Developer
There are 10 types of people in the world - those that understand binary and those that don't
steve1376656734
 
Posts: 218
Joined: Fri Aug 16, 2013 2:38 pm
Location: Lanzarote

Re: databaseManager.saveData oddity

Postby Manolo_Etec » Fri Mar 29, 2019 10:08 am

Hi Steve.
When I have this problem, normaly is because a have in an entity a condition that return false or when there is a duplicate pk, but normaly it return an error of duplicate pk that you can see....
Manuel López
Etec Programación SL
manuel@etecsoft.com
http://www.etecsoft.com

Servoy 8.2.2
Windows 10
Yesterday: Java 1.8.0_141-b15
User avatar
Manolo_Etec
 
Posts: 60
Joined: Fri Sep 12, 2008 3:58 pm

Re: databaseManager.saveData oddity

Postby dev-ws-011 » Tue Apr 16, 2019 11:13 am

Hi Steve,

The reason for save to fail can be as follows:

    1. Column is updated with duplicate pk after new/edit record.
    2. Column data type mismatch e.g. date is expected but string is passed.
    3. Data validation failure for not null on column has occurred.
Check for above mentioned probable issues. Hope this will resolve you problem.

Thanks.
Servoy Developer
dev-ws-011
 
Posts: 6
Joined: Fri Oct 21, 2016 8:23 am

Re: databaseManager.saveData oddity

Postby steve1376656734 » Tue Apr 16, 2019 12:08 pm

Thanks both for the suggestions but unfortunately I cannot tell what the issue was as it appears to have stopped happening without any changes to the code!
Steve
SAN Developer
There are 10 types of people in the world - those that understand binary and those that don't
steve1376656734
 
Posts: 218
Joined: Fri Aug 16, 2013 2:38 pm
Location: Lanzarote

Re: databaseManager.saveData oddity

Postby ROCLASI » Tue Apr 16, 2019 12:18 pm

Hi Steve,

I am not sure if you did but perhaps for next time, also check the PostgreSQL log(s) for exceptions.

Hope this helps.
Robert Ivens
ROCLASI Software Solutions / JBS Group, Partner
SAN Developer / Servoy Valued Professional / Servoy Certified Developer
Twitter: @roclasi / @servoyforge
--
ServoyForge - Building Open Source Software.
PostgreSQL - The world's most advanced open source database.
User avatar
ROCLASI
Servoy Expert
 
Posts: 5300
Joined: Thu Oct 02, 2003 9:49 am
Location: Netherlands/Belgium


Return to Programming with Servoy

Who is online

Users browsing this forum: Bing [Bot] and 1 guest