corsasport.co.uk
 

Corsa Sport » Message Board » Off Day » Geek Day » Any DBA's here?


New Topic

New Poll
  Subscribe | Add to Favourites

You are not logged in and may not post or reply to messages. Please log in or create a new account or mail us about fixing an existing one - register@corsasport.co.uk

There are also many more features available when you are logged in such as private messages, buddy list, location services, post search and more.


Author Any DBA's here?
Ash_EP3
Member

Registered: 15th May 07
Location: Melksham, Wiltshire
User status: Offline
16th Jan 11 at 02:17   View User's Profile U2U Member Reply With Quote

As above.

I have a quick question in regards to Oracle and locked rows/sessions...

Thanks in advance
Ian
Site Administrator

Avatar

Registered: 28th Aug 99
Location: Liverpool
User status: Online
16th Jan 11 at 02:31   View Garage View User's Profile U2U Member Reply With Quote

Post it.
Ash_EP3
Member

Registered: 15th May 07
Location: Melksham, Wiltshire
User status: Offline
16th Jan 11 at 03:06   View User's Profile U2U Member Reply With Quote

The scenario is simple... the application has a front end which communicates with the DB and can be updated from the back office or manually via SQLdeveloper or SQLplus.... the obvious issue is the exclusivity of rows and the problem lies when 1 or 2 users (or even a scheduled script) is updating a record at the same time (thus the last committed change will be the only update).

I just wanted to know what the options are for this type of scenario? It seems apparent that there are 2 choices... either lock the record down so no changes can be made whilst the record is being updated or just allow the record to stay unlock but run the risk of multiple changes at the same time being lost...
Gaz
Member

Registered: 24th Aug 03
Location: Widnes, Cheshire
User status: Offline
16th Jan 11 at 12:24   View User's Profile U2U Member Reply With Quote

I used Oracle in my previous job with user's constantly locking out customers records. The solution completed by the support guys was to run a batch job that looked for records locked or stuck in session older that 45minutes as one of our user's didn't spend that long updating one record.

I'm unsure how it was done. or what effects it had (e.g lost data) and how they got around it but its what happened - just another avenue for you to think about.
Ash_EP3
Member

Registered: 15th May 07
Location: Melksham, Wiltshire
User status: Offline
16th Jan 11 at 12:39   View User's Profile U2U Member Reply With Quote

quote:
Originally posted by Gaz
I used Oracle in my previous job with user's constantly locking out customers records. The solution completed by the support guys was to run a batch job that looked for records locked or stuck in session older that 45minutes as one of our user's didn't spend that long updating one record.

I'm unsure how it was done. or what effects it had (e.g lost data) and how they got around it but its what happened - just another avenue for you to think about.


Ah ok, thanks for the info mate
Ian
Site Administrator

Avatar

Registered: 28th Aug 99
Location: Liverpool
User status: Online
16th Jan 11 at 13:21   View Garage View User's Profile U2U Member Reply With Quote

Your options are correct, either lock or not.

Curious as to why the commit should take over a few seconds? CS has to lock for updates but it's over and done very quickly so you generally wouldn't notice.

Is this to ensure the integrity of the read as well? Is there any scope to alter the table structures?

My first thoughts is that if you're offering people that amount of time to read, decide upon an update and then make it that you should have another table for the writes that inserts new records and you introduce a foreign key to that record to tie it to the other table.

You may introduce anomalies in terms of concurrent writes but you would have then been able to store them all and you can discriminate on date/time or something to decide which is the best one.

Might also be some scope to notify the users if a write has taken place and tell them they're too late to attempt a commit?

Really depends on the scenario.

 
New Topic

New Poll

  Related Threads Author Forum Replies Views Last Post
Which Brakes ? Corsa GSI pandamoanium Help Zone, Modification and ICE Advice 27 3788
16th May 03 at 14:23
by Daimo B
 
Fitted My V6 Brakes (Pics) Mav 3000 Help Zone, Modification and ICE Advice 44 3882
19th Nov 03 at 02:32
by Chris R
 

Corsa Sport » Message Board » Off Day » Geek Day » Any DBA's here? 28 database queries in 0.0090771 seconds