Database insert failing randomly

We have an integration layer that does XML over HTTP.   I have a created a table in outsystems that holds the created Date, XML input and XML output (as text).  When we are troubleshooting I can turn this on and all integration calls should be logging the inputs/outputs to this table but I noticed while looking at the table data that there are breaks in the IDs.   

I started debugging and saw that when we have an integration error response (contains <Error> in the XML string) those records are not being written to the database.   In Outsystems I see all of the parameters being passed to the Create_IL_Logging entity function and I see an ID being passed back as if the record has been created, but it does not exist in the database.  

Has anyone seen this before?   Are there some text characters that Outsystems will not write to the Database  (but does not pop an error if they are included in the string?)

Solution

As for your last question: no, that's not the case. The only reason for those records to "disappear" is when after the Create Entity Action finishes, an exception is thrown that rolls back the transaction. You could try to add a CommitTransaction call directly after the Create - if that works, there's an exception somewhere. Is there any post-processing of an Error message that could do this?

Solution

Yep that's exactly what it was.  I should have come back to update this after I found the solution.   I had created logic to notify the user if an error occurred while retrieving their information  (via user exception)   so that exception was rolling back the insert.   I added the Commit and all is well now.



Josh Herron wrote:

I added the Commit and all is well 

The alternative could be to set the rollback property of the exception to False. Happy coding!

I didn't even realize there was a rollback property!   Learning more every day, thanks all!

Most welcome :)