Commit Transaction

2
Hi there, I have a Java Action that does the following : this.getContext().endTransaction(); throw new WebserviceException(ErrorCode, ErrorDescription); But everything still gets rolled back after this action gets called. Essentially what needs to happen is, everything that's been changed before the Java action gets called has to get committed and then the error needs to get thrown. How can I accomplish this?
asked
2 answers
1

I think you can set error handling to 'custom without rollback' on the call of the java action.

answered
4

I fixed it!!! :)

Basically what happened was, we are exposing the same microflow as a web service and also using it in the application. Now when the third party applications call the web service and execute the Microflow, everything gets committed, and the error gets thrown. 100% working.

But the moment we want to call the same microflow out of Mendix, it ignores the endTransaction() call, and rolls back. I assume it is because we throw a WebServiceException, and this is not compatible.

So now, instead of calling the microflow in Mendix, we imported the published web service, and then invoke the webservice. Now everything is working 100%. YAY!!!! :)

answered