Deploy action inserts into DB 3 times

Deploy action inserts into DB 3 times

  
Hello!

I have created Deploy action to insert several records into DB. The structure is as following:
- In Processes > Timers added Timer with Schedule = When Published, Priority = "3 - Normal" and timeout 20 minutes
- Deploy action contains single call of the action like "CreateRecords"
- CreateRecords contains several subsequent calls to action "Record_Create", one for each record to create (6 in total, if this matters).
- Record_Create:
1. Reads existing record with Simpe Query, Max Records = 1.
2. Sets the fields of the returned record (except ID of course).
3. Calls auto-generated "CreateOrUpdateRecord" with th updated return record of the Query.

Every record is created 3 times. SQL server profiler shows that, for every record, there are 3 calls in such order: 3 times GET, 3 times UPDATE (this surprised me actually, I thought having ID = 0 is enough to skip update), 3 times INSERT... Than it goes to the next record.

SPIDs (Server process IDs) are different for every call of 3, but the same through the whole scenario of 1... So this looks like the action is executed 3 times in parallel. This is very strange. The best idea I have is that this is somehow caused by Timer settings - but there is nothing special there (described at the start of the post).

Could someone help with this please?
That's strange.
Can you:
1) create a smaller version of the oml only with the timer,action and entity to recreate the error
2) debug the execution of CreateRecords out of the timer

?
Suddenly, the issue disappeared. What I did was just:
1. Deleted Deploy action and changed Timer to execute CreateRecords directly.
2. Checked that records were inserted 3 times again.
3. Since it didn't work, I created Deploy again and made it call CreateRecords again and linked it back to the timer (not rolled back, but created again, because it's so easy).
After this, the issue disappeared! I have re-checked several times and it's gone. %/

Nice.
The only option I can imagine (and it wouldn 't happen more than once) was if you had a breakpoint somewhere so it tried to start 3 times until you removed/skipped it and then it completed all three simultanously.
No, I didn't have any breakpoint. I was trying to debug this when I noticed the issue by just starting debug before publish, but it didn't stop on the breakpoint. I have checked this several times (deleted from the table and did publish after that) and during 2 days (shutting down everything overnight), so I'm totally sure there was an issue. I'm also sure that I have used the action call just one time, not 3 times.

I'm thinking that if there are outsystems developers here, they might have a clue, knowing the internals of the publishing process, given that it was strictly 3 times, most probably 3 parallel threads. And this might be a bug in the system. I'm glad that it disappeared, but now concious about if it might happen again. I also thought if this might be related to tenant (like it's executing action for every tenant), but I have much more tenants than 3, and the table is marked as not multitenant. I wanted also to try caching (assuming that setting cache minutes for the action to 1 should block the parallel execution), but it had resolved before I tried this.
Outsystems executes processes up to three times when failures occur.  If you look back in the Service Center error log at the time of the original problem you will most likley find that the process reported some type of error and, as designed, executed it three times.  Without seeing the code or knowing what was happening at the time, it would be tough to help any more but it explains why you see it exactly three times.
Curt, it can't be reexecution because Igor said "for every record, there are 3 calls in such order: 3 times GET, 3 times UPDATE (this surprised me actually, I thought having ID = 0 is enough to skip update), 3 times INSERT... Than it goes to the next record." As if 3 timers were running simultaneously.
Igor Kirtak wrote:
Suddenly, the issue disappeared. What I did was just:
1. Deleted Deploy action and changed Timer to execute CreateRecords directly.
2. Checked that records were inserted 3 times again.
3. Since it didn't work, I created Deploy again and made it call CreateRecords again and linked it back to the timer (not rolled back, but created again, because it's so easy).
After this, the issue disappeared! I have re-checked several times and it's gone. %/
 
 
 Hi 
i want to work with the Timer but i don't understant how if someone can help me and can give me exactly the details please
best cheers
Hi Ilham,

To make sure everybody can get the most value out of the Community, please:
- do not post your questions simultaneously in multiple topics;
- do not post questions in an unrelated topic (like you just did on the above post).

To learn about timers, start on the link "Implement Business Processes" under www.outsystems.com/learn.
Hi Joao

But here i'm talking about 'Timers' not about Business Processes !!! and this topics is about the Timers so where is the problem,then i posted simultaneously in multiple topics because i have a severels issus on my application Outsystem and i need a help realy !!!

Thanks
Following the instructions I gave you, you would get to http://www.outsystems.com/help/servicestudio/9.0/default.htm#Designing_Processes/Overview_of_Designing_Processes.htm. As you can see, the full path of the link is:
Home • Developing an Application • Using Processes and Timers • Using Processes • Overview of Designing Processes

This topic is not "about timers". This topic is about 3 records being created when one was expected.
If you search for 'timers' in the community, you will find 100+ discussions threads!

I actually encourage you to post multiple questions if you have multiple doubts. However, this question seemed to me like exactly the same as you posted in http://www.outsystems.com/forums/discussion/15333/timers/.