IWETHEY v. 0.3.0 | TODO
1,095 registered users | 1 active user | 2 LpH | Statistics
Login | Create New User
IWETHEY Banner

Welcome to IWETHEY!

New lock and load
...everything is in a transaction therefore the locks (in accord with Oracle's usual configuration) are only held from an update to a commit. (As opposed to from a select to a commit, which you'd find in most other databases...


The reason for this is that there are two common types of locking strategies (isolation levels): Repeatable Read and Cursor Stability. Repeatable Read means just that. Once you've read a record, you can go back an reread it and be guarenteed that you will get the identical data again. This tends to accumulate locks which can lead to lock escalation (row to page to table to tablespace/dbspace), but if you need to be sure that when the commit is issued that all the data the app depends on is consistent, this is what you need (financial apps particularly). Cursor Stability only maintains share locks on "the current row" (and maybe the one on either side in the access order) and exclusive locks when when a row has been inserted or updated. I don't know about Oracle, but a 'select...for update' in DB2 obtained a share lock and was only escalated to exclusive once the update command was issued. (Share locks allow multiple readers and no writers, exclusive locks allow no other readers or writers.)

There are two other locking strategies: Read Committed and Read Uncommited. These are dangerous in the hands of those with a "little learning". Read Committed is like Cursor Stability without the share locks, meaning you aren't even guarenteed that the row you just read can be re-read again. In a high volume read-only application, this is great. Read Uncommited, sometimes called Dirty Read, means you can read any row regardless of what others are doing, meaning the row you get could have old values. This is great for data warehousing where you are only interested in aggregate values, not in particular values. In transactional systems, where the inexperienced want to use it for "performance", it is disaster.
Have fun,
Carl Forde
New re: lock and load
Interesting you mention this. I just completed my ColdFusion certification (yeah, I know), and my study-guide had these four transaction isolation levels as "suggestions to the DB" in order of speed (low to high) and "safety" (high-to-low):

* serializable (default)

* repeatable_read

* read_committed

* read_uncommitted

________________
oop.ismad.com
     Concurrency: the race is on - (FuManChu) - (40)
         Interesting, but ... - (Another Scott) - (4)
             I think he's talking to shrinkwrappers - (FuManChu)
             I'd criticize it differently - (ben_tilly) - (2)
                 That's true for servers, less so for workstations - (drewk) - (1)
                     True... - (ben_tilly)
         Favorite quote - (drewk) - (1)
             Speaking of quotes... (new thread) - (folkert)
         Just use databases and transactions. Fixed! -NT - (tablizer) - (32)
             Yes and no... - (Simon_Jester)
             And again, you demonstrate yourself to be wrong - (ben_tilly) - (30)
                 Up with people - (FuManChu) - (24)
                     No connection - (ben_tilly) - (23)
                         Questions - (tablizer) - (22)
                             Don't try to solve the problem - (ben_tilly) - (7)
                                 Dude, you are rude. Grow some people skills - (tablizer) - (4)
                                     This was one of your most hilarious posts ever, Bryce. -NT - (CRConrad) - (2)
                                         I am learning NOT to flame back. Me grow up........I think -NT - (tablizer) - (1)
                                             A: Doubt it. B: Still, YOU calling SOMEONE ELSE rude=>funnee -NT - (CRConrad)
                                     Yes, you did answer something - (ben_tilly)
                                 lock and load - (cforde) - (1)
                                     re: lock and load - (tablizer)
                             Question for you - (drewk) - (13)
                                 All the damn time - (broomberg) - (9)
                                     No hints from the peanut gallery - (drewk) - (8)
                                         Give him the benefit - (broomberg) - (7)
                                             Fairy nuff - (drewk) - (6)
                                                 Barry's right; overnormalization is 1 of Bryce's hobbyhorses -NT - (CRConrad) - (4)
                                                     Huh? What did I over-normalize? -NT - (tablizer) - (3)
                                                         It means the opposite of what you seem to think it does. HTH -NT - (CRConrad) - (2)
                                                             Okay then, what did I UNDER-normalize? - (tablizer) - (1)
                                                                 SIGH... "A hobby-horse" means, something you like to... - (CRConrad)
                                                 Note: in this case it really is a bad idea - (ben_tilly)
                                 Re: Question for you - (tablizer) - (2)
                                     Also called trade-offs. - (static) - (1)
                                         re: Also called trade-offs - (tablizer)
                 Ah yes, the Upperson procedure - (tuberculosis)
                 Guilty until proven innocent? -NT - (tablizer) - (3)
                     No, you said something stupid - (ben_tilly) - (2)
                         You don't seem to disagree anywhere - (tablizer) - (1)
                             I disagree with, "Fixed!" - (ben_tilly)

People from Iowa are often kinda dumb, but their English isn't that bad, even though they come from Central America.
104 ms