Oracle dirty read
<p>I'm new using Oracle database 11g.</p>

<p>I was testing table and row locks using SQL Developer.</p>

<p>I have a row in my table like this:</p>

<ul>
<li>id : 1</li>
<li>desc: 'abc'</li>
</ul>

<p>I did an update without commit to change the field <code>desc</code> to <code>'zxc'</code>. In another session I did a select that returned the old record:</p>

<ul>
<li>id : 1</li>
<li>desc: 'abc'</li>
</ul>

<p>I was thinking that it would give me an error or something else because I don't want to see old data.</p>

<p>Finally when I commited in the other session I executed again the query in the second session and returned me the commited data.</p>

<p>How can I prevent old data read?</p>

<p>UPDATE:</p>

<p>I read about the sql "SELECT FOR UPDATE" and it prevents to get the row that was not commit but for example someone tell me about banks so i'm not sure is this approach has good performance and other issue is about lost connection without commit. Maybe i need to use a function or PLSQL to minimize the lost connection actually i'm using a PHP script ( Laravel Framework ).</p>

<p>Thanks in advance.</p>