Well I am hoping I am just confused and have misunderstood you.

It appeared that you said JDBC connections and Sql*plus ones were different,
and that a if I perform an insert inside a transaction using JDBC that
within the same transaction I would not be able to read the row inserted.

If in fact you did say that there are two things which are significant.
First, the server does not distinguish by client type and both SQL*Plus and
JDBC drivers look essentially the same to it.  They both use the same wire
protocol to speak with the server.

On the second issue, read committed has to do with other transactions.  Run
the embedded JDBC program... you might need to fix up the connection URL.

import java.sql.*;                   // JDBC classes
public class Foo {
    public static void main( String[] args ) throws SQLException {
        // Get connection to the database
        DriverManager.registerDriver( new oracle.jdbc.driver.OracleDriver()
);
        Connection con = DriverManager.getConnection(
"jdbc:oracle:thin:@localhost:1521:ORCL", "scott", "tiger" );

        /*  Create the table */
        Statement stmt = con.createStatement();
      stmt.execute( "CREATE TABLE FOO ( X VARCHAR2(32))" );

      con.setAutoCommit( false );
        stmt.executeUpdate( "INSERT INTO FOO VALUES ('Gina')" );

        /* Won't see Gina here! */
        ResultSet rs = stmt.executeQuery( "SELECT X FROM FOO" );
        System.out.println( "Gina says see nothing" );
        while( rs.next() ) {
            System.out.println( "Oh oh, Found " + rs.getString( 1 ));
        }
        rs.close();

        con.rollback();

        /* Won't see Gina here for sure! */
        rs = stmt.executeQuery( "SELECT X FROM FOO" );
        System.out.println( "Won't find anything here!" );
        while( rs.next() ) {
            System.out.println( "Found " + rs.getString( 1 ));
        }

        /* All done, drop the table */
      stmt.execute( "DROP TABLE FOO" );
    }
}      

_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to