I added a new empty record to the datasource X. I closed the insert dialog, I go to another screen, and when trying to commit at the application level, an error is raised because the empty record is still there, and the system tries to insert it. I couldn't find a rollback or abortchanges procedure. Is there a way to formally abort changes made to a datasource? Thx |
Hi Vlisidis, 1- If you are showing one row in the dialog For the insert dialog, you can delete datasource row on cancel button with api_datasource.deleteRow API. For editing an existing row, you can use datasource refreshRow APIs, in order to requery your row from its base table/view. 2- If you are showing multiple rows in the dialog You can call api_datasource.clear api, this will delete all the rows but will not have any effect on commit. Or, you can call api_datasource.executeQuery to get fresh data and delete/update/insert operations to the datasource will be ignored. 3- If the above solutions don't fit to your scenario You can use api_datasource.takeSnapshot/loadSnapshot APIs in order to create and restore savepoints for your datasource data. This method may be a bit slower. Regards |
My case is the number 1 scenario, and I did exactly what you say. It works fine but I cannot say that I am happy to handle a rollback/abort operation this way. My first thought was the clear function, but any delete operation in Oracle generates a lot of data in the redo logs causing a performace penalty, especially if the database in archivelog mode. I suspect that the clear function actually delete all rows from the corresponding DSI_XXXX table. Thank you Ugur for the fast responce. Hi Vlisidis, I understand why you think this way. I felt the same way too. Overall, I was worried to use the DSI tables heavily. However, I found out that using the datasource API's have virtually no effect on performance. So, I am confident that you can use the api_datasource.clear with a peace of mind.
(07 Sep '12, 14:28)
Yalim K. Gerger ♦♦
|