90
Views
10
Comments
Simple entity Delete record times out
Question

I have a simple entity with a single record in it, which I want to delete. This entity has no relationships to any other table.

In one of my flows, I call the 'delete' action on the entity, passing in the ID of the record I wish to kill.

Sometimes this completes near near instantly. But sometimes it jams up, taking up to 90 seconds and timing out whatever part of my application is trying to use it.

Does this delete compile to a simple SQL delete or is there some other weirdness going on in OS that is breaking somehow?

Does any have any idea what could be happening? 

Rank: #2174

MichaelR wrote:

I have a simple entity with a single record in it, which I want to delete. This entity has no relationships to any other table.

In one of my flows, I call the 'delete' action on the entity, passing in the ID of the record I wish to kill.

Sometimes this completes near near instantly. But sometimes it jams up, taking up to 90 seconds and timing out whatever part of my application is trying to use it.

Does this delete compile to a simple SQL delete or is there some other weirdness going on in OS that is breaking somehow?

Does any have any idea what could be happening? 

You should check your log first from Service Center > Monitoring, it will help you to find out what is causing timeout for your process. You can ask further if you need more help


Rank: #5248

Abdiel Alvin wrote:

You should check your log first from Service Center > Monitoring, it will help you to find out what is causing timeout for your process. You can ask further if you need more help

I know what is timing out my process, it's the built-in 'delete' action on an entity taking up to 90 seconds to run:


Entity Action Delete<entityname> took 72096 ms
SLOWSQL


but OS flow actions tend to time out after about 25 seconds without response, meaning this delete action hangs whatever flow it is called in.

I've tried replacing the 'delete' action with a custom SQL delete as well and it still seems to take forever.

Try to do that delete query as well on that machine toward the database machine. lot of possible suspect here but check that one out as well. could be latency or network issue.

Rank: #5248

I think it might have to do with some sort of lock that OS puts on the table

In the specific flow that often jams up, it's calling a couple of actions that delete, add and delete a row from the entity in rapid succession. By altering a setting to avoid this branch of the code we no longer have the problem.

HOWEVER while it's not a breaking issue for us in the current case, the behavior from outysystems is still concerning. If there was a lock we would hope OS would give a more useful response than just freezing for a minute. I also can't seem to reproduce it in another module so It seems like there may be some edge-case behavior in the underlying OS db that is causing this.

I guess you already raised this to OS given your statement.

I am just curious that your single record entity takes up 90 second to do. Can you share the flow?

Hi,

We have also stumbled upon this issue in one of apps. Do you perhaps have any information or a resolution from OS on why this could be happening?

Regards,

Heinri

Rank: #5248

I don't think we ever had a 'solution' sorry, I think we managed to avoid it through some reworking of our flows. I can't remember any details on what exactly we changed though, sorry.

Champion
Rank: #269

It sounds like a lock issue, Couple of thing you can do to check or minimize the issue

1) Is it possible that someone else may have the record opened in a transaction/ Do you do bulk operations on the table that take a while, if so these may be locking multiple records or even the entire table

2) Are you using getforupdate? this puts a lock on the record until the record is later updated and can increase your chance of having issues

3) Are you doing a lot of operations in the action or the actions calling it? A transaction will stay open until the last action exits or is manually closed and that can result in record locks being open. If you are doing the delete at the end of your logic you could try doing a committransaction to see if that helps

I agree with Jeanene, it does sound like a locking issue.


To further enhance your investigation, I would like to suggest triggering the concern and after doing so, try generating a QUERIES PERFORMANCE Report so you can analyze how long and what kind of action is taking up the resource or causing the contention lock.


CRUD operations are tagged here especially if they are not performing well.

Aside from that, try reading the logs under the GENERAL Tab as it shows data such as SLOW SQLS or at least any hint that could lead towards this issue. then the rest of the community can assist from there.

It would be nice to open up a new post or thread to this concern so the rest of the community can help assist in this issue.


Thanks!

-Jose

Hi MichaelR ,

Can you please check connection between application server & database server, It may be due to connection issue between application server & database server.


Regards

Shashikant Shukla