Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Committing inside a loop
ctcgag_at_hotmail.com wrote:
> Frank <fbortel_at_nescape.net> wrote:
>
>>Mark D Powell wrote: >> >> >>>pagesflames_at_usa.net (Dusan Bolek) wrote in message >>>news:<1e8276d6.0311250803.3cbc43be_at_posting.google.com>... >>> >>> >>>>Hello, >>>> >>>>I'm just creating some document how developers should/must not behave >>>>when dealing with Oracle database. I written down some basic rules and >>>>came with idea what's the most stupid thing that you can do to your >>>>database. >>>>I have two on mind, first one is not using BIND variables and the >>>>second one is using COMMIT in a loop statement. However, there will be >>>>more of these. >>>>So I have question to you here. What's the most stupid, but in real >>>>world foundable, mistakes in development applications using Oracle >>>>datatabase? >>> >>> >>>Dusan, I would suggest you change your wording about issuing commit >>>within a loop since in many cases the commits need to be performed >>>within a loop. I think it is the frequency of commits rather than the >>>logical coding structure that is the issue. In my opinion how >>>frequently a commit should be issued is dependent on how likely >>>another session will need update access to the rows being processed. >>>In a transaction driven system the inventory rows may well require >>>commits be issued on a per-row or very few row basis. While another >>>program in the application, which is the only source of update >>>activity for a table that has low select activity, would best be >>>served by one or very few commits. >>> >>>Be careful in the process of trying to get something into the hands of >>>developers that you do not over simplify the problem and end up making >>>a statement that you later consider "dumb". Writing for developers is >>>not an easy task. >>> >>>Good luck >>>-- Mark D Powell -- >> >>I'm sure Dusan referred to the "we have a possible 1555, so let's >>commit every ...uhm, 5000 processed rows".
>>Committing within a loop to "prevent" 1555's from happening is >>creating the 1555's!
-- Regards, Frank van BortelReceived on Sun Nov 30 2003 - 10:47:54 CST