Table records are not constant

Hi,


I have one table called "person" entity which contains 200 records initially. I am doing insertion or updation into the tables. There is no deletion from the table. So, the records count was supposed to be increased.  But, sometimes only 100 records are displayed in the frontend application. If I query also, it is returning only 100 records. After some time, it is returning 200 records.

I don't understand what magic is going on. I am wondering how the record count is decreased.

Kindly help me to resolve this issue.


Regards,

Divya

Divya check the Max records setting  on aggregates. 

Also when viewing in the IDE remember the view data is also limited. 

Hi Hanno,

I did not give the value for max records. And also, I am not viewing the data in IDE. I am seeing the data in the front end application.


Regards,

Divya

Can you share the oml perhaps? 

Hi Hanno,

I am not supposed to share the OML file. Could you please help me to resolve this issue without seeing the OML file. If you need more information that I can share with you.


Regards,

Divya

I have sent you a PM.

It is really difficult to solve without seeing the oml as this type of behavior of the system is not typical and one needs to see the query/refresh/data binding interaction in the oml.

divya v wrote:

Hi,


I have one table called "person" entity which contains 200 records initially. I am doing insertion or updation into the tables. There is no deletion from the table. So, the records count was supposed to be increased.  But, sometimes only 100 records are displayed in the frontend application. If I query also, it is returning only 100 records. After some time, it is returning 200 records.

I don't understand what magic is going on. I am wondering how the record count is decreased.

Kindly help me to resolve this issue.


Regards,

Divya

Hi Divya,

Firstly you need to check the Max limit setting of your query or aggregate.

Secondly if its fine, you need to check your data binding conditions and the refreshing of data aggregate or query on your search click.


Deepa Tiwari wrote:

divya v wrote:

Hi,


I have one table called "person" entity which contains 200 records initially. I am doing insertion or updation into the tables. There is no deletion from the table. So, the records count was supposed to be increased.  But, sometimes only 100 records are displayed in the frontend application. If I query also, it is returning only 100 records. After some time, it is returning 200 records.

I don't understand what magic is going on. I am wondering how the record count is decreased.

Kindly help me to resolve this issue.


Regards,

Divya

Hi Divya,

Firstly you need to check the Max limit setting of your query or aggregate.

Secondly if its fine, you need to check your data binding conditions and the refreshing of data aggregate or query on your search click.


Hi Deepa,


If I query also in service studio using SQL query, it is returning only 180 records. But actual record count is 240.

SQL query:

select count(*) from {person};   


Regards,

Divya.


Hi,

If I give value in Timeout of that aggregate, I think, It will work . But I am not sure.

To avoid that issue, I have given the value in seconds(1500). It means 25 minutes.


Regards,

Divya

That is really weird. Are you connecting to external tables?

Do you have Binary data fields in that table?

divya v wrote:

Hi,

If I give value in Timeout of that aggregate, I think, It will work . But I am not sure.

To avoid that issue, I have given the value in seconds(1500). It means 25 minutes.


Regards,

Divya

Hi Divya,

Can you Please Share the OML. 


Hanno wrote:

That is really weird. Are you connecting to external tables?

Do you have Binary data fields in that table?

Hi Hanno,

From external tables, I am taking the data and inserting into Outsystem DB. For every 30 mins, the timer is running. So, the timer job is taking the records from external tales and inserting into Outsystem DB.


Regards,

Divya

Hi,


Below is my preparation. GetAlertTablesByInterfaceName is the aggregate 

Below are the entity and attributes.


Regards,

Divya


Are you caching the data? In your escape.


The issue would be with the process of inserting records from the external system.

It seems that the data is slow in committing to your OutSystems database.

Hanno wrote:

The issue would be with the process of inserting records from the external system.

It seems that the data is slow in committing to your OutSystems database.


It seems that the data is slow in committing to your OutSystems database.--- No. If it is slow in commiting means, at least it should show the actual record counts(Old) of Outsystem table.

Because I was able to see 240 records yesterday. But Today morning, I was able to see only 180 records. And also, now I am able to see correct record counts(240). 


Regards,

Divya


Then I would guess your process is deleting existing records before inserting again. Nothing else would make much sense.

Hanno wrote:

Then I would guess your process is deleting existing records before inserting again. Nothing else would make much sense.

In my timer logic, There is no such logic to delete the entries from Outsystem table.


Regards,

Divya 


Again, without access to the OML we could be playing this guessing game for a while.

You can share the OML with me in a private message - I promise confidentiality.

Otherwise you will need to figure it out on your own.

Hi Hanno,

I am really sorry. I can't share the OML file.

I have one query. Can I use the CommitTransaction in order to resolve this issue?

Because CommitTransaction will commit the records into the DB permanently.


Regards,

Divya

divya v wrote:

Hi Hanno,

I am really sorry. I can't share the OML file.

I have one query. Can I use the CommitTransaction in order to resolve this issue?

Because CommitTransaction will commit the records into the DB permanently.


Regards,

Divya

Why don't you try the CommitTransaction and let us know what happens? 


Hanno wrote:

divya v wrote:

Hi Hanno,

I am really sorry. I can't share the OML file.

I have one query. Can I use the CommitTransaction in order to resolve this issue?

Because CommitTransaction will commit the records into the DB permanently.


Regards,

Divya

Why don't you try the CommitTransaction and let us know what happens? 


I tried CommitTransaction also. But this also did not work.

Please find my attached OML file and Kindly help me.


Regards,

Divya


Thanks, Divya

Some notes on what I have seen in the .oml:

  1. Unnecessary use of ListFilter where the filter(s) could be added to Aggregate/Advanced SQL
  2. Too many loops and sub-loops (I have simplified the logic somewhat)
  3. You are reading and writing to the same table in the same loop - this could cause locking errors when reading, even though you are using commits when writing to the table. You should really revisit your logic.
  4. Don't set a site property - it is bad practice - see here: [1] [2] [3]
  5. Having an aggregate in a loop is also not ideal.

In my opinion, you really need to rethink how you are trying to solve your problem. I don't think the loops with inserting to and reading from the same tables are an optimal or even good solution.

Anyway, I don't completely understand what you are trying to achieve here, but I have attempted to optimise the code somewhat in the attached .oml.