Ask the Expert

How to handle locking

I want to redesign the lock of an unlock policy for tables (or row of them) in a multithreading environment. What needs a lock? How do I lock them (update, full lock)? How do I prevent deadlocking?

    Requires Free Membership to View

Oracle will handle your locking for you. You do not have to code anything. Oracle's policy is that writers only block writers, they do not block readers. I would highly suggest that you get a copy of Tom Kyte's "Expert one-on-one Oracle book". It contains good examples of how transaction processing occurs in the Oracle database.

You could use the DBMS_LOCK package to implement your own locking, but this does not lock any tables. It only locks sections of code in your application. So I doubt that you want to use this...

This was first published in May 2004

There are Comments. Add yours.

TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
Sort by: OldestNewest

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to: