Duplicates in TableView

Discuss all problems you have with Servoy here. It might help to mention the Servoy version and Operating System version you are using

Duplicates in TableView

Postby Ugo » Fri Jan 25, 2013 12:51 pm

Hello,

Suddenly, all my table views are presenting duplicated data ( cf attached screenshot ) while for sure the database doesn't have those errors, any ID being unique.
I tried a few server restart, and even loaded a new solution, which actually has no difference with the previous one, with bo effect.

Using Servoy 6.0.6

Anyone with an idea, this is very problematical.
Attachments
doubles_tableview.png
doubles_tableview.png (213.53 KiB) Viewed 2878 times
Ugo Di Luca

SaaS Software Development Engineer ( Paris - France )
Cegid - http://www.cegid.fr
FileMaker Developer, trainer and consultant
DL Systems- http://www.dlsystems.fr
User avatar
Ugo
 
Posts: 28
Joined: Mon Dec 25, 2006 2:26 pm
Location: Paris, France

Re: Duplicates in TableView

Postby mboegem » Fri Jan 25, 2013 1:09 pm

Looks like a query containing a left join where the related data returns multiple rows for 1 row in the primary table.

Best is to check on what is happening in the servoy-admin pages > tab: performance
Clear everything what's in there, then navigate to this particular table, refresh the performance tab and see what is in there.

Is this a custom query or generated by servoy?
Marc Boegem
Solutiative / JBS Group, Partner
Servoy Specialist
• Servoy Certified Developer
• Servoy Valued Professional
• Freelance Developer

Image
User avatar
mboegem
 
Posts: 1750
Joined: Sun Oct 14, 2007 1:34 pm
Location: Amsterdam

Re: Duplicates in TableView

Postby Ugo » Fri Jan 25, 2013 1:33 pm

Hi,

Thanks for your answer. Actually, this is the result of a addTableFilterParam, I will inspect the dataset that comes with it

Ugo
Ugo Di Luca

SaaS Software Development Engineer ( Paris - France )
Cegid - http://www.cegid.fr
FileMaker Developer, trainer and consultant
DL Systems- http://www.dlsystems.fr
User avatar
Ugo
 
Posts: 28
Joined: Mon Dec 25, 2006 2:26 pm
Location: Paris, France

Re: Duplicates in TableView

Postby Ugo » Fri Jan 25, 2013 3:43 pm

Ok,

After some investigation, it seems that I'm loading a foundset twice, but I can't find where. Here's the code used on startup, no other filter is applied later on, and the result shawn in the scrrenshot is strictly the table foundset ( no relation in tabpanel )

Code: Select all
...some code before which will help :
- determine a premiminary dataset containing all entities directly connected to the user through a given relation
- set a first global table filter param...
..the result is stored in a variable
globals._app__aMy_entitesIDs=_myentities;

//then we apply another filter in order to get only any entity which are children from 'parent entities' connected to the user
//this will help extend the foundset to the children when we will apply the final filter
if (databaseManager.addTableFilterParam('my_db', null,'parent_ent_id','IN',globals._app__aMy_entitesIDs,'myglobfilterparent')==false){      
   //An error occured
   catchloginerror(_errorcode);
}
else{
   _filtered_entfs=databaseManager.getFoundSet('my_db', 'entites');
   _filtered_entfs.loadAllRecords();
   //at this stage, we get only those entities with a parent_id that is part of our previous filter
   
   _all_entitiesdset= databaseManager.convertToDataSet(_filtered_entfs,['ent_id']);
   _myentities_parent= _all_myentitiesdset.getColumnAsArray(1);
   
   //now that we have the array of the children, we concanate it with the first array
   globals._app__aMy_entitesIDs= globals._app__aMy_entitesIDs.concat(_myentities_parent);
   
   databaseManager.removeTableFilterParam('my_db','myglobfilterparent');
}

...some other code with no interest

var _result = databaseManager.addTableFilterParam('my_db', null,'ent_id','IN',globals._app__aMy_entitesIDs,'myglobfilterent')


By killing the first filter and applying a new one, it seems that my first '_filtered_entfs' is not replaced as I thought it should be through the tablefilterparam. As I see it, I'm now getting two foundsets in one, is that clear enough ?

Thank you
Ugo Di Luca

SaaS Software Development Engineer ( Paris - France )
Cegid - http://www.cegid.fr
FileMaker Developer, trainer and consultant
DL Systems- http://www.dlsystems.fr
User avatar
Ugo
 
Posts: 28
Joined: Mon Dec 25, 2006 2:26 pm
Location: Paris, France


Return to Discuss possible Issues and Bugs

Who is online

Users browsing this forum: No registered users and 6 guests