Samples JDK
Main Page
Related Pages
Packages
Classes
Files
File List
src
com
freemindcafe
jdbc
sample1
package-info.java
1
/**
2
* \brief global temporary table with on commit preserve rows; \htmlonly <font size="3" color="red">Incomplete ??</font> \endhtmlonly
3
*
4
* <h3>Concepts</h3>
5
* <p>
6
* <ul>
7
* <li>sqlplus login opens up a connection and session. We can close the session by doing a disconnect;</li>
8
* <li>We can again open the session by doing a connect;</li>
9
* <li>Two sqlplus processes means two connections and two sessions.</li>
10
* <li>If we do disconnect on the two sessions then we will have two connections but no sessions .</li>
11
* <li>The table is visible across the sessions.</li>
12
* <li>Data will not be visible across the sessions.</li>
13
* <li>Because of 'on commit preserve rows', the data will be available even after the transaction is done.</li>
14
* </ul>
15
* </p>
16
*
17
* <h3>Steps</h3>
18
* <ul>
19
* <li>Open two sqlplus sessions.</li>
20
* <li>Run the following in any session to make sure that we start in clean state<br>truncate table tab_tmp;<br>drop table tab_tmp;</li>
21
* <li>Run the following in First session <br><i>create global temporary table tab_tmp (name VARCHAR2(30)) on commit preserve rows;</i></li>
22
* <li>Run the following in Second session <br><i>select * from tab_tmp;</i><br>Second session can see the table</li>
23
* <li>Run the following in First session <br><i>insert into tab_tmp values('abc');</i></li>
24
* <li>Run the following in First session <br><i>select * from tab_tmp;</i>First session can see the row</li>
25
* <li>Run the following in Second session <br><i>select * from tab_tmp;</i><br>Second session can't see the row</li>
26
* <li>Run the following in First session <br><i>disconnect;</i></li>
27
* <li>Run the following in First session <br><i>connect;</i></li>
28
* <li>Run the following in First session <br><i>select * from tab_tmp;</i>First session can't see the row</li>
29
* <li>Run the following in First session <br><i>show autocommit;</i>autocommit should be off</li>
30
* <li>Run the following in First session <br><i>insert into tab_tmp values('abc');</i></li>
31
* <li>Run the following in First session <br><i>commit;</i></li>
32
* <li>Run the following in First session <br><i>select * from tab_tmp;</i>First session can see the row</li>
33
* </ul>
34
*/
35
package
com.freemindcafe.jdbc.sample1;
Generated on Fri Feb 19 2016 08:35:42 for Samples JDK by
1.8.9.1