Hi, I m very mew to the oracle.
I want to teach transaction and locks to the diploma student. I searched so many examples of these topics from the Google Search engine, but fail to search simple and short example. I understood the topics, but can't find simple example. Will you please help me to posts some simple and shorts examples so that i can teach that students practically?

try this

session1
SELECT * FROM EMP FOR UPDATE;----it locks the table (do not commit)

session2
update emp set empno = 1000;----it is trying to acquire the table to update


Till session 1 commits session2 will remain in waiting state (deadlock).

Off-course there are ways to avoid that.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.