View previous topic :: View next topic
|
Author |
Message |
MSMITHUK
New User
Joined: 31 Mar 2005 Posts: 5 Location: London
|
|
|
|
Hi,
I wonder if someone can help with a design that I have been given to code and I am not sure it will work.
The objective is to insert rows into a database, however before hand we want to use a common validation module. This validation module will check for the existence of the row, if it is found then a reply is sent to the user. However if it is not the designer wants us to use repeatable read so that the "space" or "slot" will not be used by anyone before we then go to another module to do the insert. They are trying to make generic validation modules and insert modules. So we do not want the insert to fail due to the fact another transaction has inserted a row into the databse with the same key.
Hope this makes sense. My question is that on a singleton selection using WITH RR, if this row does not exist will the empty slot be held until the next commit point.
Thanks in advance |
|
Back to top |
|
|
hikaps14
Active User
Joined: 02 Sep 2005 Posts: 189 Location: Noida
|
|
|
|
hi,
if u r using RR isolation then no one else can else can access ur table
( except only UR level isolation which can't be update) .
so don't worry about any updations at all .
i hope i hav got ur Querry correctly .
plz do correct me if u find me wrong .
Thanks ,
-Kapil |
|
Back to top |
|
|
MSMITHUK
New User
Joined: 31 Mar 2005 Posts: 5 Location: London
|
|
|
|
Thanks for your reply. However I am more concerned with rows that might be inserted during my Unit Of Work with the predicate that I have validated with.
An E.G.
UOW starts
Call Validation
- Select 1 from MYTABLE where surname = 'SMITH' With RR
* The result from this is +100 row not found *
Call Process
- Insert surname values('SMITH') into MYTABLE
COMMIT
I do not want the insert to fail due to someone inserting a row with the surname of "SMITH" after my validation module but before my process module.
I am wondering if you can hold the primary key of 'SMITH' before actually inserting it.
Cheers
Moira |
|
Back to top |
|
|
|