This content has been marked as final. Show 9 replies
Why would you want to execute a SavePoint from a XAI Inbound Service?
I don't see any reason to do that, you'd perform SavePoints within Scripts, where your custom logic is encapsulated.
Define/Develop your algorithm (Plug-In Script), encapsulate your business logic within a Service Script, invoke the Service Script using Business Service F1-SavePointDispatcher and deal with hadError switch.
Configure the Service Script (SS) that has the business logic for which you'd like to enable the SavePoint:
SS: RXS-StartSA - This has only one Edit Data step for demonstration purposes
SS: RXS-StartSAO - This SS will also have other part of the business logic. It will invoke above SS along with SavePoint handling
--Step 1 - Edit Data: terminate with error (90000, 1 %1='Report error/exception for SavePoint'); --Schema <schema> <saId mdField="SA_ID"/> <acctId mdField="ACCT_ID"/> </schema>
Expose RXS-StartSAO as a XAI Inbound Service, let's call it - RXS-SavePointTest; Refresh XAI Registry using XAI Command.
-- Step 1 - Edit Data: move "parm/saId" to"RXS-StartSA/saId"; move "parm/acctId" to"RXS-StartSA/acctId"; move "RXS-StartSA" to "F1-SavePointDispatcher/scriptData"; move 'RXS-StartSA' to "F1-SavePointDispatcher/scriptName"; invokeBS 'F1-SavePointDispatcher' using "F1-SavePointDispatcher"; if ("F1-SavePointDispatcher/hadError") move "F1-SavePointDispatcher/messageCategory" to "parm/exception/messageCategory"; move "F1-SavePointDispatcher/messageNumber" to "parm/exception/messageNumber"; end-if; --Data Area Business Service : F1-SavePointDispatcher Service Script : RXS-StartSA -- Schema <schema> <saId mdField="SA_ID"/> <acctId mdField="ACCT_ID"/> <exception type="group"> <messageCategory/> <messageNumber/> </exception> </schema>
Do a XAI Submission:
You can see above that there was no application error. You could take necessary programmatic actions depending on the hadError switch.
--Request <RXS-SavePointTest> <saId></saId> <acctId>1234567890</acctId> </RXS-SavePointTest> --Response <RXS-SavePointTest> <saId/> <acctId>1234567890</acctId> <exception> <messageCategory>90000</messageCategory> <messageNumber>1</messageNumber> </exception> </RXS-SavePointTest>
Now if you ignore SavePoint handling and invoke the Script directly, Framework will terminate the execution and report an error like below:
<ResponseStatus>F</ResponseStatus> <ResponseCode>1016</ResponseCode> <ResponseText>Unexpected error during request processing. (Server Message) Category: 90000 Number: 1 Call Sequence: Program Name: LocalServiceSessionHelper$1 Text: Report error/exception for SavePoint Description: Table: null Field: null</ResponseText> <ResponseData text="Unexpected error during request processing. (Server Message) Category: 90000 Number: 1 Call Sequence: Program Name: LocalServiceSessionHelper$1 Text: Report error/exception for SavePoint Description: Table: null Field: null" category="11011" numParm="1" parm1="(Server Message) Category: 90000 Number: 1 Call Sequence: Program Name: LocalServiceSessionHelper$1 Text: Report error/exception for SavePoint Description: Table: null Field: null" number="1016" />
Hi OATS Explorer,
Sorry, I didn't see your question asking me to explain the way to use a snapshot in a VM, I do not come so often on this forum.
I did some suppositions in my answer, so if it is not related to your initial question, please ignore it.
Otherwise because I believe, that in your QA/test environment, you do not care about production processes, I guess you would need to launch some series of scripts like the creation of Vs for example, then relaunch them after having made some configuration changes, correct ?
If yes, do you use a virtualization system like Oracle VirtualBox or VMware ?
If yes, the virtualization system provides the ability to save instantaneously the state of your machine before doing any operation of the operating system and any application inside.
Once these operations are done, you can ask the virtualization system to come back to the previous state, it is the same principle of the save point/restore you was mentioning.
As part of EMEA Presales team, our needes are similar to the one described here above for our demonstrations, we use VirtualBox and thanks to it we are very flexible even to exchange our environments accross people even by FTP.
If you do not use such a system, maybe it is time to see with your organization if the use of virtualization system would bring other benefits.
Again, please kindly ignore this hypothesis if it is not the right one.
Okay...perhaps the question is a bit ambiguous?
If your requirement is related to maintaining the state of the application/server then yes, what Mapa4 says is correct, use VM environment - Oracle VM/VMware/Microsoft VPC | Hyper-V/etc.; for e.g. in Microsoft VPC (or Hyper-V Snapshots) you could also enable an option of Undo Disks, to delete all the changes done at the end of the session OR commit them in the end.
If your requirement is to handle business logic programmatically in order to enable Savepoint/Rollback then above example should suffice.