1. Narayana Bhat
  2. PowerBuilder
  3. Wednesday, 29 November 2017 07:51 AM UTC

Hi

I want to know performance related result for  Commit command which we are using inside PowerBuilder and Backend is SQL Anywhere 16 & Isolation Level used 'RU'

1. If I use commit script for each row, what is the performance impact?

2. If I use commit script for batch of row, what is the performance impact?

In above 1 and 2, which one will give good performance?

Also

If I give datawindow.update() and not given commit, commit will be given batch of record [Isolation Level 'RU']. Will I get updated result back to my datawindow retrieve on Same transaction ?

Narayana Bhat

 

Michael Kramer Accepted Answer Pending Moderation
  1. Wednesday, 29 November 2017 10:40 AM UTC
  2. PowerBuilder
  3. # 1

To me the real question is: Do you need transaction handling in case an error occurs during INSERT/UPDATE/DELETE ?

I have seen so many data inconsistencies in my career coming from DB transactions not matching the "business" transaction from user's point-of-view.

 

Re: Performance

You "collect" DB server resources as long as you have a running transaction since the DB server has to be able to rollback changes in case you abort your transaction using ROLLBACK. So: Don't make DB transactions run longer than necessary.

Whether you commit 10 times each time for a single row or commit once across 10 rows will have limited performance impact unless you have very slow DB server roundtrips. 

 

HTH, /Michael

Comment
  1. Narayana Bhat
  2. Wednesday, 29 November 2017 11:29 AM UTC
Dear Michael,



Yes error handling is necessary and also if update fails rollback also necessary



Narayana

  1. Helpful
  1. Michael Kramer
  2. Wednesday, 29 November 2017 16:03 PM UTC
You need transactions (COMMIT/ROLLBACK) that potentially span across multiple rows.



Example: In a "project planning app" I see a myriad of tasks on screen. I selected 20 of these tasks, then drag-and-drop an avatar onto one of them to assign these tasks to the avatar's person. I want such drag-and-drop to either succeed 100% or fail completely.



HTH /Michael

  1. Helpful
  1. Narayana Bhat
  2. Thursday, 30 November 2017 06:46 AM UTC
Yes, true. Either it has to commit entire batch or should rollback entire batch

  1. Helpful
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.