SQL Query showing different results

SQL Query showing different results

  

Hi everyone greetings,

I am working on a project. I have to develope a pop-up  web screen that uses drop down to select users and add them to the application. I am done with this. The problem is that i am using SQL query to fetch the list of users from USER table to show in the combo box. The query is giving the right results in the test but when i run the application. The combo box is inflated with the totally different result. My application's espace is not multi-tenant. I can't figure out where is the issue. 

Please find the attached screen shots.

Kind regards, 

Hello Hassan,

As you are not using parameters here, I only see two possibilities: MultiTenant and Different UserProvider...

Are you sure that you don't have a Multi-Tentant problem here?
And how about the User Provider? Are you using the correct one?

Cheers.

Eduardo Jauch wrote:

Hello Hassan,

As you are not using parameters here, I only see two possibilities: MultiTenant and Different UserProvider...

Are you sure that you don't have a Multi-Tentant problem here?
And how about the User Provider? Are you using the correct one?

Cheers.

Hi eduardo,

i have checked my espace module and in the properties tab "Is Multi-tenant" is set to NO.  What about user provider . sorry i didn't got what you are asking about..?

My application is using "Multi-tenant " module in the dependency tab but i don't know about it. What about user provider and how to solve Multi-tenant problem??

regards

Hi Hassan,

The user provider is the provider that is shown in the eSpace properties:

Queries you are testing are tested with the tenant / user provider that is configured via menu Module / Configure Tenant to Test Queries. If the Tenant listed there is different from the User Provider (or the Effective User Provider as shown in Service Center - but you can probably ignore that) you may get different results.

Like Kilian said,

If these two are different, the results in Design time and Run time will possibly be different:

Cheers

Hi eduardo,

For my application espace. These both properties are same but the application is showing different data to every user that is logged in. what could be the issue.? same logic is applied but different result.

Regards,

Like Kilian said,

If these two are different, the results in Design time and Run time will possibly be different:

Cheers



Hi Hassan,

Are you saying that every user gets different data, or that all users get the same data, but this is different from when you are testing?

Hi Kilian Hekhuis,

Thanks for the information. But i could not figure out how to solve this issue?

Regards

Hassan wrote:

Hi Kilian Hekhuis,


Thanks for the information. But i could not figure out how to solve this issue?

Regards



Stupid Question, is the same environment? 

Do you have the Source Record List of your combo box defined properly? It should bound to your SQL node.

Tiago Gafeira wrote:

Do you have the Source Record List of your combo box defined properly? It should bound to your SQL node.

yes its fine. Working absolutely fine for some users and totally different for some others. with same SQL queries.


@Hassan

I'm with @Tiago. Are you sure you have the source well defined in your combo?

Looks like you have User in Source Entity defined hence all the users are being populated in the combo box.

You should be using Source Record List attribute.


Hi João,

I don't think this is the case...

Hassan stated that some users get the "correct" results and some not. 

Also, it seems, by the pictures, that the combo box is not showing all users...

Could be the case of different aggregate/sql but as he already stated that the combo box is attached to the correct source, the behaviour remembers a tenancy problem.

But he also stated that the module is not multi tenant...

If the query uses input parameters, can also be the case of a mismatch between test values and runtime values, but the query seems to not be using parameters...

And he stated that is not a user provider problem...

So, it seems to be witchcraft! ??

Hassan,

If the combo box is using the correct source, your module is not Multi Tenant (Is Multi Tenant property is set to false), the user provider is the same... 

Some questions.

1. Are the users in different tenants? 

2. Does the query have I put parameters?

In the case 2 is true, may be a logic problem that is passing different values for your query than those you are using for test.

In case of 1, even the module not being multi tenant, the users entity is. This is why you can't find there the IT users, for example.

In this case (I may be wrong), if your users are defined in different tenants, they will see only users from the same tenant in User entity.

Please, see if this is the case.

Cheers

Hassan,

Ok, one more thing: did you sort the Aggregate? Though I would expect the database to present the list the same for each invocation, even if unsorted, it might be it uses different execution plans for different users, sorting the output differently.

Eduardo Jauch wrote:

Hassan,

If the combo box is using the correct source, your module is not Multi Tenant (Is Multi Tenant property is set to false), the user provider is the same... 

Some questions.

1. Are the users in different tenants? 

2. Does the query have I put parameters?

In the case 2 is true, may be a logic problem that is passing different values for your query than those you are using for test.

In case of 1, even the module not being multi tenant, the users entity is. This is why you can't find there the IT users, for example.

In this case (I may be wrong), if your users are defined in different tenants, they will see only users from the same tenant in User entity.

Please, see if this is the case.

Cheers

Eduardo

no i'm not passing the input parameters to the query. The logic is well implemented. The test result is perfect. But the query results as i said earlier are different to different users. 

i think the users are in different tenants..How can I update them to be in the same tenant? 


Regards



Hello Hassan,

As stated here, it seems that to create tenants, you need to build an application.

If your users are really in different tenants (I would check this first), this means that you (your company) probably have already an application to manage tenants and users.

So I would talk to someone to understand why the users are in different tenants, if it makes sense to them to be in the same tenant and if you can change them to the same tenant or someone else has to do it.

And I'm curious... Why your users are in different tenants and why they should all see same data?

Cheers