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

asked 07 Sep '12, 05:40

Vlisidis%20Akis's gravatar image

Vlisidis Akis
163119
accept rate: 5%


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
Ugur

link

answered 07 Sep '12, 06:43

Ugur%20Kocak's gravatar image

Ugur Kocak ♦
5616
accept rate: 23%

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.

link

answered 07 Sep '12, 12:08

Vlisidis%20Akis's gravatar image

Vlisidis Akis
163119
accept rate: 5%

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 ♦♦
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×1

Asked: 07 Sep '12, 05:40

Seen: 878 times

Last updated: 07 Sep '12, 14:28

Related questions


© Copyright Gerger 2017