Incorrect Child Relation Error

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

Incorrect Child Relation Error

Postby kwpsd » Tue Feb 23, 2016 2:53 am

Servoy 7.4.6

After upgrading to 7.4.6, our customers started getting the following error message:

An incorrect child relation (census_to_census_summary) was accessed through a foundset (or a record of foundset) with datasource 'null'. The accessed relation actually has 'db:/arm_data/billing_census' as primary datasource. It will resolve for legacy reasons but please fix it as it is error prone.


The code that failed is:
Code: Select all
        var fs = databaseManager.getFoundSet( 'arm_data', 'billing_census' ).duplicateFoundSet()
       
        fs.loadRecords( census_to_census_summary )   // FAILED ON THIS LINE OF CODE

The table 'billing_census' has lots of data, so I do not understand the 'null' ascpect of the error message. The code had been working for many years. I am at a loss how to fix this. The 'billing_census' table is related to the 'billing_summary' table using a PK and FK. What is the proper way to code this relationship?

Thanks!
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: Incorrect Child Relation Error

Postby ROCLASI » Tue Feb 23, 2016 9:21 am

Hi Kim,

This method is in a form context?
Is this form using the same datasource as the left side of the census_to_census_summary relation?
Robert Ivens
SAN Developer / Servoy Valued Professional / Servoy Certified Developer

ROCLASI Software Solutions / JBS Group, Partner
Mastodon: @roclasi
--
ServoyForge - Building Open Source Software.
PostgreSQL - The world's most advanced open source database.
User avatar
ROCLASI
Servoy Expert
 
Posts: 5438
Joined: Thu Oct 02, 2003 9:49 am
Location: Netherlands/Belgium

Re: Incorrect Child Relation Error

Postby kwpsd » Tue Feb 23, 2016 6:24 pm

Hi, Robert. I hope you are doing well.

The method is on a print selector form having no datasource, just form variables. Once the print parameters are selected by the user, the method creates an appropriate foundset that is passed to a Jasper Report.

If I examine the foundset prior to execution of the fs.loadRecords( census_to_census_summary ) code, the foundset has data.
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: Incorrect Child Relation Error

Postby Andrei Costescu » Wed Feb 24, 2016 10:22 am

This is a result of case SVY-9196. It's just a message that shouldn't interfere with how the solution runs.

It probably works for you because the variables you have defined match the primary dataproviders listed in the relation.
This is (I think) in your case intended but in other cases it might work by mistake and lead to errors. You can change that into a global relation instead.

So now you have a table-based relation that actually works on form variables. The purpose of that case was to make that kind of unexpected situation obvious so that it can be clarified.

Now an unrelated comment (no relation to the situation you have but other ppl. searching for this error message might bump into it): there is one known case where where this message can appear incorrectly - if you have set on a field of a form a related dataprovider going through multiple relations, like "a_to_b.b_to_c.someColumn". That is already fixed for next release.
Andrei Costescu
Servoy
Andrei Costescu
 
Posts: 1018
Joined: Tue Jun 26, 2007 3:14 pm

Re: Incorrect Child Relation Error

Postby ROCLASI » Wed Feb 24, 2016 1:27 pm

Andrei Costescu wrote:It probably works for you because the variables you have defined match the primary dataproviders listed in the relation.

<snip>

So now you have a table-based relation that actually works on form variables.


Interesting. I didn't know you could do that.
So effectively you have a global relation but instead based on a form variable (okay...technically not a true global relation then).
Robert Ivens
SAN Developer / Servoy Valued Professional / Servoy Certified Developer

ROCLASI Software Solutions / JBS Group, Partner
Mastodon: @roclasi
--
ServoyForge - Building Open Source Software.
PostgreSQL - The world's most advanced open source database.
User avatar
ROCLASI
Servoy Expert
 
Posts: 5438
Joined: Thu Oct 02, 2003 9:49 am
Location: Netherlands/Belgium

Re: Incorrect Child Relation Error

Postby kwpsd » Wed Mar 09, 2016 2:34 am

Thank you both for your input. And, please accept my apologies for the late reply.

It's just a message that shouldn't interfere with how the solution runs.


Perhaps, but it sure freaks out our users who are not necessarily computer savvy.

Regardless, I wanted to point out that stopping/restarting Servoy server seems to have cleared the problem as it has not reappeared in more than a week's 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: Incorrect Child Relation Error

Postby Harjo » Wed Jun 01, 2016 9:12 am

there is still some error on the line here, I think.

kwpsd is mentioning that users really see this error, popping up, right?
and Andrei, says it's just an error in the error pane inside Eclipse, right?
Harjo Kompagnie
ServoyCamp
Servoy Certified Developer
Servoy Valued Professional
SAN Developer
Harjo
 
Posts: 4321
Joined: Fri Apr 25, 2003 11:42 pm
Location: DEN HAM OV, The Netherlands

Re: Incorrect Child Relation Error

Postby Andrei Costescu » Wed Jun 01, 2016 9:24 am

It shouldn't generate any popup - just a message in the app. server logs and developer console view should appear.
Btw, I made that be a WARN message (7.4.7) in the logs instead - as more ppl. were scared by it :) even when it was correct.

Your users didn't get popups right kwpsd?
Andrei Costescu
Servoy
Andrei Costescu
 
Posts: 1018
Joined: Tue Jun 26, 2007 3:14 pm

Re: Incorrect Child Relation Error

Postby kwpsd » Wed Jun 01, 2016 6:57 pm

It's been a while...I believe the error message came from the customer's log file. My apologies for the confusion in my original post.
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


Return to Programming with Servoy

Who is online

Users browsing this forum: No registered users and 7 guests

cron