Connect By Clause -  Major Bug in Oracle 9.0.1

Currently I am working with Oracle 8.1.6 database,
now we are migrating to Oracle 9.0.1.
We are often using "Connect By" clause in our queries since our database structure is hierarchical.
I am facing one problem with "Connect By" clause in
Oracle 9.0.1, actually which is working properly with Oracle 8.1.6.
I am giving the Problem.
I have created a Table say Object_Master,
Then I insert 3 rows in that table,
and then I commit and try to execute one query,
Same thing is working properly in Oracle 8.1.6 but same query is not working in Oracle 9.0.1.
Following is the script.
Create table Object_Master
ObjectId Number(5),
ObjectName Varchar2(255),
ParentId Number(5),
DeleteStatus Varchar2(1),
IsSecuritySet Varchar2(1))
Insert Into Object_Master Values (1,'john',0,'N','Y')
Insert Into Object_Master Values (2,'ADMIN',1,'N','Y')
Insert Into Object_Master Values (3,'ADMIN',1,'N','Y')
Commit
Select * from
Object_Master
Start with ObjectId = 1
Connect By parentid = Prior ObjectId
And DeleteStatus = 'N' And ( IsSecuritySet = 'N' Or ObjectName = 'ADMIN' )
This script is working perfectly with Oracle 8.1.6 but when I try to run this sc[i]Long postings are being truncated to ~1 kB at this time.

Hey Mitesh,
What's going on? So many posting for the same question, and that is also not comlete. Try to post rest of your question.
Dharmesh Patel

Similar Messages

  • Connect by clause - Major bug with Oracle 9.0.1

    Currently I am working with Oracle 8.1.6 database,
    now we are migrating to Oracle 9.0.1.
    We are often using "Connect By" clause in our queries since our database structure is hierarchical.
    I am facing one problem with "Connect By" clause in
    Oracle 9.0.1, actually which is working properly with Oracle 8.1.6.
    I am giving the Problem.
    I have created a Table say Object_Master,
    Then I insert 3 rows in that table,
    and then I commit and try to execute one query,
    Same thing is working properly in Oracle 8.1.6 but same query is not working in Oracle 9.0.1.
    Following is the script.
    Create table Object_Master
    ObjectId Number(5),
    ObjectName Varchar2(255),
    ParentId Number(5),
    DeleteStatus Varchar2(1),
    IsSecuritySet Varchar2(1))
    Insert Into Object_Master Values (1,'john',0,'N','Y')
    Insert Into Object_Master Values (2,'ADMIN',1,'N','Y')
    Insert Into Object_Master Values (3,'ADMIN',1,'N','Y')
    Commit
    Select * from
    Object_Master
    Start with ObjectId = 1
    Connect By parentid = Prior ObjectId
    And DeleteStatus = 'N' And ( IsSecuritySet = 'N' Or ObjectName = 'ADMIN' )
    This script is working perfectly with Oracle 8.1.6 but when I try to run this sc[i]Long postings are being truncated to ~1 kB at this time.

    Hey Mitesh,
    What's going on? So many posting for the same question, and that is also not comlete. Try to post rest of your question.
    Dharmesh Patel

  • Major bugs in oracle 11g 11.1.0.7??

    Hii All,
    We are planning to upgrade to 11g currently we are using
    Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bi
    PL/SQL Release 10.2.0.4.0 - Production
    CORE    10.2.0.4.0      Production
    TNS for Solaris: Version 10.2.0.4.0 - Production
    NLSRTL Version 10.2.0.4.0 - Production
               Now we are planning to upgrade to version 11.1.0.7,but heard that it contains many bugs.And our DBA suggest us version 11.2.0.1.0 where all the bugs in the earlier release of 11g got fixed. Is it true?
    These links show that there are some bugs in 11.1.0.7
    http://nilesh-joshi.blogspot.com/2010/06/oracle-111070-bug.html
    http://mikerault.blogspot.com/2009/03/more-fun-with-oracle11g-11107.html
    1)Can any one brief the bugs in the version 11.1.0.7 ???
    2)Let me know whether are all those bugs got fixed in the version 11.2.0.1.0??
    Is this bug oracle 11g needs group by - why? fixed in 11gR2???
    Regards
    Raghu.

    Bottom line - you'll be lucky if you never run into a bug in any release.
    I'd always be hesitant to go with any x.1 release including 11.2.0.1.
    Bear in mind that you're probably not upgrading today but in a few months time.
    11.2.0.2 is available on Linux
    Use Metalink to identify any bugs in any specific feature or release you're interested.
    Doc Id 738538.1 - 11.1.0.7 Patch Set - Availability and Known Issues
    Doc Id - 880707.1 - 11.2.0.1 Base Release - Availability and Known Issues
    Doc ID 1179474.1 - Known issues specific to 11.2.0.2
    Doc ID 1178583.1 - Bugs fixed in the 11.2.0.2 Patch Set

  • Bug in Oracle 8.1.6.0.0

    Did any one come accrossed with the bug no 1328999 in oracle 8.1.6.0.0 on solaries. If any one please reply me.
    Actually my problem is i am getting too many deadlocks in my application i am using MTS (Microsoft Transaction server as application server ) and database is 8.1.6.0.0. of oracle in solaries.
    Did any one has similar problems please reply me.
    If so
    How could you confirm that the problem u are getting is because of a bug in oracle 8.1.6.0.0
    Please some one reply me

    Hi kawollek,
    Thanks for the reply.
    But when i tried with the example provided. I am unable to connect to oracle. it gives the error 0ra-03114 not connected to oracle.
    How do i give the host string in oracle or dsn in the programe to connect to the database.
    If u have tried please help me.....
    Thanks & regards
    Rama Raju D.S

  • Bug in Oracle JDBC Pooling Classes - Deadlock

    We are utilizing Oracle's connection caching (drivers 10.2.0.1) and have found a deadlock situation. I reviewed the code for the (drivers 10.2.0.3) and I see the same problem could happen.
    I searched and have not found this problem identified anywhere. Is this something I should post to Oracle in some way (i.e. Metalink?) or is there a better forum to get this resolved?
    We are utilizing an OCI driver with the following setup in the server.xml
    <ResourceParams name="cmf_toolbox">
    <parameter>
    <name>factory</name>
    <value>oracle.jdbc.pool.OracleDataSourceFactory</value>
    </parameter>
    <parameter>
    <name>driverClassName</name>
    <value>oracle.jdbc.driver.OracleDriver</value>
    </parameter>
    <parameter>
    <name>user</name>
    <value>hidden</value>
    </parameter>
    <parameter>
    <name>password</name>
    <value>hidden</value>
    </parameter>
    <parameter>
    <name>url</name>
    <value>jdbc:oracle:oci:@PTB2</value>
    </parameter>
    <parameter>
    <name>connectionCachingEnabled</name>
    <value>true</value>
    </parameter>
    <parameter>
    <name>connectionCacheProperties</name>
    <value>(InitialLimit=5,MinLimit=15,MaxLimit=75,ConnectionWaitTimeout=30,InactivityTimeout=300,AbandonedConnectionTimeout=300,ValidateConnection=false)</value>
    </parameter>
    </ResourceParams>
    We get a deadlock situation between two threads and the exact steps are this:
    1) thread1 - The OracleImplicitConnectionClassThread class is executing the runAbandonedTimeout method which will lock the OracleImplicitConnectionCache class with a synchronized block. It will then go thru additional steps and finally try to call the LogicalConnection.close method which is already locked by thread2
    2) thread2 - This thread is doing a standard .close() on the Logical Connection and when it does this it obtains a lock on the LogicalConnection class. This thread then goes through additional steps till it gets to a point in the OracleImplicitConnectionCache class where it executes the reusePooledConnection method. This method is synchronized.
    Actual steps that cause deadlock:
    1) thread1 locks OracleImplicitConnectionClass in runAbandonedTimeout method
    2) thread2 locks LogicalConnection class in close function.
    3) thread1 tries to lock the LogicalConnection and is unable to do this, waits for lock
    4) thread2 tries to lock the OracleImplicitConnectionClass and waits for lock.
    ***DEADLOCK***
    Thread Dumps from two threads listed above
    thread1
    Thread Name : Thread-1 State : Deadlock/Waiting on monitor Owns Monitor Lock on 0x30267fe8 Waiting for Monitor Lock on 0x509190d8 Java Stack at oracle.jdbc.driver.LogicalConnection.close(LogicalConnection.java:214) - waiting to lock 0x509190d8> (a oracle.jdbc.driver.LogicalConnection) at oracle.jdbc.pool.OracleImplicitConnectionCache.closeCheckedOutConnection(OracleImplicitConnectionCache.java:1330) at oracle.jdbc.pool.OracleImplicitConnectionCacheThread.runAbandonedTimeout(OracleImplicitConnectionCacheThread.java:261) - locked 0x30267fe8> (a oracle.jdbc.pool.OracleImplicitConnectionCache) at oracle.jdbc.pool.OracleImplicitConnectionCacheThread.run(OracleImplicitConnectionCacheThread.java:81)
    thread2
    Thread Name : http-7320-Processor83 State : Deadlock/Waiting on monitor Owns Monitor Lock on 0x509190d8 Waiting for Monitor Lock on 0x30267fe8 Java Stack at oracle.jdbc.pool.OracleImplicitConnectionCache.reusePooledConnection(OracleImplicitConnectionCache.java:1608) - waiting to lock 0x30267fe8> (a oracle.jdbc.pool.OracleImplicitConnectionCache) at oracle.jdbc.pool.OracleConnectionCacheEventListener.connectionClosed(OracleConnectionCacheEventListener.java:71) - locked 0x34d514f8> (a oracle.jdbc.pool.OracleConnectionCacheEventListener) at oracle.jdbc.pool.OraclePooledConnection.callImplicitCacheListener(OraclePooledConnection.java:544) at oracle.jdbc.pool.OraclePooledConnection.logicalCloseForImplicitConnectionCache(OraclePooledConnection.java:459) at oracle.jdbc.pool.OraclePooledConnection.logicalClose(OraclePooledConnection.java:475) at oracle.jdbc.driver.LogicalConnection.closeInternal(LogicalConnection.java:243) at oracle.jdbc.driver.LogicalConnection.close(LogicalConnection.java:214) - locked 0x509190d8> (a oracle.jdbc.driver.LogicalConnection) at com.schoolspecialty.cmf.yantra.OrderDB.updateOrder(OrderDB.java:2022) at com.schoolspecialty.cmf.yantra.OrderFactoryImpl.saveOrder(OrderFactoryImpl.java:119) at com.schoolspecialty.cmf.yantra.OrderFactoryImpl.saveOrder(OrderFactoryImpl.java:67) at com.schoolspecialty.ecommerce.beans.ECommerceUtil.saveOrder(Unknown Source) at com.schoolspecialty.ecommerce.beans.ECommerceUtil.saveOrder(Unknown Source) at com.schoolspecialty.ecommerce.beans.UpdateCartAction.perform(Unknown Source) at com.schoolspecialty.mvc2.ActionServlet.doPost(ActionServlet.java:112) at com.schoolspecialty.ecommerce.servlets.ECServlet.doPostOrGet(Unknown Source) at com.schoolspecialty.ecommerce.servlets.ECServlet.doPost(Unknown Source) at javax.servlet.http.HttpServlet.service(HttpServlet.java:709) at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157) at com.schoolspecialty.ecommerce.servlets.filters.EcommerceURLFilter.doFilter(Unknown Source) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:186) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520) at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:462) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929) at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705) at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683) at java.lang.Thread.run(Thread.java:534)

    We used a documented option to abandon connects in the case of an unforeseen error. The consequence of using this option was not a graceful degradation in performance but a complete lockup of the application. The scenario in which we created a moderate number of abandoned connections was a rare error scenario but a valid test.
    How could this not be a bug in the Oracle driver? Is dead-lock a desireable outcome of using an option? Is dead-lock ever an acceptable consequence of using a feature as documented?
    Turns out other Oracle options to recover from an unexpected error also incur a similar deadlock (TimeToLiveTimeout).
    I did a code review of the decompiled drivers and it clearly shows the issue, confirming the original report of this issue. Perhaps you have evidence to the contrary or better evidence to support your statement "not a bug in Oracle"?
    Perhaps you are one of the very few people who have not experience problems with Oracle drivers? I've been using Oracle since 7.3.4 and it seems that I have always been working around Oracle JDBC driver problems.
    We are using Tomcat with the OracleDataSourceFactory.

  • Bug in Oracle JDBC thin driver (parameter order)

    [ I'd preferably send this to some Oracle support email but I
    can't find any on both www.oracle.com and www.technet.com. ]
    The following program illustrates bug I found in JDBC Oracle thin
    driver.
    * Synopsis:
    The parameters of prepared statement (I tested SELECT's and
    UPDATE's) are bound in the reverse order.
    If one do:
    PreparedStatement p = connection.prepareStatement(
    "SELECT field FROM table WHERE first = ? and second = ?");
    and then bind parameter 1 to "a" and parameter to "b":
    p.setString(1, "a");
    p.setString(2, "b");
    then executing p yields the same results as executing
    SELECT field FROM table WHERE first = "b" and second = "a"
    although it should be equivalent to
    SELECT field FROM table WHERE first = "a" and second = "b"
    The bug is present only in "thin" Oracle JDBC driver. Changing
    driver to "oci8" solves the problem.
    * Version and platform info:
    I detected the bug using Oracle 8.0.5 server for Linux.
    According to $ORACLE_HOME/jdbc/README.doc that is
    Oracle JDBC Drivers release 8.0.5.0.0 (Production Release)
    * The program below:
    The program below illustrates the bug by creating dummy two
    column table, inserting the row into it and then selecting
    the contents using prepared statement. Those operations
    are performed on both good (oci8) and bad (thin) connections,
    the results can be compared.
    You may need to change SID, listener port and account data
    in getConnecton calls.
    Sample program output:
    $ javac ShowBug.java; java ShowBug
    Output for both connections should be the same
    --------------- thin Driver ---------------
    [ Non parametrized query: ]
    aaa
    [ The same - parametrized (should give one row): ]
    [ The same - with buggy reversed order (should give no answers):
    aaa
    --------------- oci8 driver ---------------
    [ Non parametrized query: ]
    aaa
    [ The same - parametrized (should give one row): ]
    aaa
    [ The same - with buggy reversed order (should give no answers):
    --------------- The end ---------------
    * The program itself
    import java.sql.*;
    class ShowBug
    public static void main (String args [])
    throws SQLException
    // Load the Oracle JDBC driver
    DriverManager.registerDriver(new
    oracle.jdbc.driver.OracleDriver());
    System.out.println("Output for both connections should be the
    same");
    Connection buggyConnection
    = DriverManager.getConnection
    ("jdbc:oracle:thin:@localhost:1521:ORACLE",
    "scott", "tiger");
    process("thin Driver", buggyConnection);
    Connection goodConnection
    = DriverManager.getConnection ("jdbc:oracle:oci8:",
    "scott", "tiger");
    process("oci8 driver", goodConnection);
    System.out.println("--------------- The end ---------------");
    public static void process(String title, Connection conn)
    throws SQLException
    System.out.println("--------------- " + title + "
    Statement stmt = conn.createStatement ();
    stmt.execute(
    "CREATE TABLE bug (id VARCHAR(10), val VARCHAR(10))");
    stmt.executeUpdate(
    "INSERT INTO bug VALUES('aaa', 'bbb')");
    System.out.println("[ Non parametrized query: ]");
    ResultSet rset = stmt.executeQuery(
    "select id from bug where id = 'aaa' and val = 'bbb'");
    while (rset.next ())
    System.out.println (rset.getString (1));
    System.out.println("[ The same - parametrized (should give one
    row): ]");
    PreparedStatement prep = conn.prepareStatement(
    "select id from bug where id = ? and val = ?");
    prep.setString(1, "aaa");
    prep.setString(2, "bbb");
    rset = prep.executeQuery();
    while (rset.next ())
    System.out.println (rset.getString (1));
    System.out.println("[ The same - with buggy reversed order
    (should give no answers): ]");
    prep = conn.prepareStatement(
    "select id from bug where id = ? and val = ?");
    prep.setString(1, "bbb");
    prep.setString(2, "aaa");
    rset = prep.executeQuery();
    while (rset.next ())
    System.out.println (rset.getString (1));
    stmt.execute("DROP TABLE bug");
    null

    Horea
    In the ejb-jar.xml, in the method a cursor is closed, set <trans-attribute>
    to "Never".
    <assembly-descriptor>
    <container-transaction>
    <method>
    <ejb-name></ejb-name>
    <method-name></method-name>
    </method>
    <trans-attribute>Never</trans-attribute>
    </container-transaction>
    </assembly-descriptor>
    Deepak
    Horea Raducan wrote:
    Is there a known bug in Oracle JDBC thin driver version 8.1.6 that would
    prevent it from closing the open cursors ?
    Thank you,
    Horea

  • Bug in Oracle UpdatableResultSet? (insert, updateString requires non-empty ResultSet?

    As far as I can determine from the documentation and posts in other newsgroups
    the following example should work to produce an updatable but "empty" ResultSet which can be used to insert rows.
    But it doesn't work in a JDK 1.2.2 and JDK 1.3.0_01 application using Oracle 8i (8.1.7) thin JDBC
    driver against an Oracle 8.1.5 database I get the following error
    SQLException: java.sql.SQLException: Invalid argument(s) in call: setRowBufferAt
    However, if I change it to so the target (ie insert) ResultSet is initialized to contain one or more
    rows, it works just fine.
    ResultSet rset2 = stmt2.executeQuery ( "select Context.* from Context where ContextCd = '0' " );
    Is this a bug in Oracle's JDBC driver (more specifically, the UpdatableResultSet implimentation)?
    Does an updatabable ResultSet have to return rows to be valid and useable for insert operations?
    If it does, is there another way to create an updatable ResultSet that does not depend upon
    "hard-coding" some known data value into the query?
    try
    // conn is a working, tested connection to an Oracle database via 8.1.7 thin JDBC driver.
    // source statement
    Statement stmt = conn.createStatement (
    ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY );
    System.out.println("source rset");
    rset = stmt.executeQuery ( "select Context.* from Context" );
    // target Statement
    Statement stmt2 = conn.createStatement (
    ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_UPDATABLE );
    ResultSet rset2 =
    stmt2.executeQuery ( "select Context.* from Context where ContextCd = NULL" );
    System.out.println(
    "see if rset2 looks good even though empty (bcs primarykey = null)");
    ResultSetMetaData rsmd2 = rset2.getMetaData();
    int numColumns = rsmd2.getColumnCount();
    for( int i = 0; i <= numColumns; i++ )
    env.msg.println ( "(" + i + ") " + rsmd2.getColumnLabel(i) );
    // test results showed the correct columns even though no row returned.
    // quess we can use this trick to create an "empty" insert ResultSet.
    System.out.println("interate through rset and insert using rset2");
    if(rset.next())
    System.out.println("move to insert row");
    rset2.moveToInsertRow();
    System.out.println("insert values");
    rset2.updateString( "ContextCd", rset.getString("ContextCd") + "-test" );
    rset2.updateString( "Descrip", "test" );
    rset2.updateString( "Notes", "test" );
    System.out.println("insert row into db (but not committed)");
    rset2.insertRow();
    catch( ... ) ...
    Thanks
    R.Parr
    Temporal Arts

    I have noticed the same problem, actually it doens't matter if there is no data in your resultset. If you have a result with data and suppose you were to analyze the data by moving through all of the rows, the cursor is now after the last row. If you call insertRow, the same exception is thrown. Kinda strange, I didn't get any response as to why this is happening and that was a few weeks ago. I hope someone responds, at this point I am just re-writing some of my code to not use updateable resultsets.
    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Randall Parr ([email protected]):
    As far as I can determine from the documentation and posts in other newsgroups
    the following example should work to produce an updatable but "empty" ResultSet which can be used to insert rows.
    But it doesn't work in a JDK 1.2.2 and JDK 1.3.0_01 application using Oracle 8i (8.1.7) thin JDBC
    driver against an Oracle 8.1.5 database I get the following error<HR></BLOCKQUOTE>
    null

  • Bug in Oracle's handling of transaction isolation levels?

    Hello,
    I think there is a bug in Oracle 9i database related to serializable transaction isolation level.
    Here is the information about the server:
    Operating System:     Microsoft Windows 2000 Server Version 5.0.2195 Service Pack 2 Build 2195
    System type:          Single CPU x86 Family 6 Model 8 Stepping 10 GenuineIntel ~866 MHz
    BIOS-Version:          Award Medallion BIOS v6.0
    Locale:               German
    Here is my information about the client computer:
    Operaing system:     Microsoft Windows XP
    System type:          IBM ThinkPad
    Language for DB access: Java
    Database information:
    Oracle9i Enterprise Edition Release 9.2.0.1.0 - Production
    With the Partitioning, OLAP and Oracle Data Mining options
    JServer Release 9.2.0.1.0 - Production
    The database has been set up using the default settings and nothing has been changed.
    To reproduce the bug, follow these steps:
    1. Create a user in 9i database called 'kaon' with password 'kaon'
    2. Using SQL Worksheet create the following table:
    CREATE TABLE OIModel (
    modelID int NOT NULL,
    logicalURI varchar (255) NOT NULL,
    CONSTRAINT pk_OIModel PRIMARY KEY (modelID),
    CONSTRAINT logicalURI_OIModel UNIQUE (logicalURI)
    3. Run the following program:
    package test;
    import java.sql.*;
    public class Test {
    public static void main(String[] args) throws Exception {
    java.util.Locale.setDefault(java.util.Locale.US);
    Class.forName("oracle.jdbc.OracleDriver");
    Connection connection=DriverManager.getConnection("jdbc:oracle:thin:@schlange:1521:ORCL","kaon","kaon");
    DatabaseMetaData dmd=connection.getMetaData();
    System.out.println("Product version:");
    System.out.println(dmd.getDatabaseProductVersion());
    System.out.println();
    connection.setAutoCommit(false);
    connection.setTransactionIsolation(Connection.TRANSACTION_SERIALIZABLE);
    int batches=0;
    int counter=2000;
    for (int outer=0;outer<50;outer++) {
    for (int i=0;i<200;i++) {
    executeUpdate(connection,"INSERT INTO OIModel (modelID,logicalURI) VALUES ("+counter+",'start"+counter+"')");
    executeUpdate(connection,"UPDATE OIModel SET logicalURI='next"+counter+"' WHERE modelID="+counter);
    counter++;
    connection.commit();
    System.out.println("Batch "+batches+" done");
    batches++;
    protected static void executeUpdate(Connection conn,String sql) throws Exception {
    Statement s=conn.createStatement();
    try {
    int result=s.executeUpdate(sql);
    if (result!=1)
    throw new Exception("Should update one row, but updated "+result+" rows, query is "+sql);
    finally {
    s.close();
    The program prints the following output:
    Product version:
    Oracle9i Enterprise Edition Release 9.2.0.1.0 - Production
    With the Partitioning, OLAP and Oracle Data Mining options
    JServer Release 9.2.0.1.0 - Production
    Batch 0 done
    Batch 1 done
    java.lang.Exception: Should update one row, but updated 0 rows, query is UPDATE OIModel SET logicalURI='next2571' WHERE modelID=2571
         at test.Test.executeUpdate(Test.java:35)
         at test.Test.main(Test.java:22)
    That is, after several iterations, the executeUpdate() method returns 0, rather than 1. This is clearly an error.
    4. Leave the database as is. Replace the line
    int counter=2000;
    with line
    int counter=4000;
    and restart the program. The following output is generated:
    Product version:
    Oracle9i Enterprise Edition Release 9.2.0.1.0 - Production
    With the Partitioning, OLAP and Oracle Data Mining options
    JServer Release 9.2.0.1.0 - Production
    Batch 0 done
    Batch 1 done
    java.sql.SQLException: ORA-08177: can't serialize access for this transaction
         at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
         at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:289)
         at oracle.jdbc.ttc7.Oall7.receive(Oall7.java:573)
         at oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java:1891)
         at oracle.jdbc.ttc7.TTC7Protocol.parseExecuteFetch(TTC7Protocol.java:1093)
         at oracle.jdbc.driver.OracleStatement.executeNonQuery(OracleStatement.java:2047)
         at oracle.jdbc.driver.OracleStatement.doExecuteOther(OracleStatement.java:1940)
         at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:2709)
         at oracle.jdbc.driver.OracleStatement.executeUpdate(OracleStatement.java:796)
         at test.Test.executeUpdate(Test.java:33)
         at test.Test.main(Test.java:22)
    This is clearly an error - only one transaction is being active at the time, so there is no need for serialization of transactions.
    5. You can restart the program as many times you wish (by chaging the initial counter value first). The same error (can't serialize access for this transaction) will be generated.
    6. The error doesn't occur if the transaction isolation level isn't changed.
    7. The error doesn't occur if the UPDATE statement is commented out.
    Sincerely yours
         Boris Motik

    I have a similar problem
    I'm using Oracle and serializable isolation level.
    Transaction inserts 4000 objects and then updates about 1000 of these objects.
    Transactions sees inserted objects but cant update them (row not found or can't serialize access for this transaction are thrown).
    On 3 tries for this transaction 1 succeds and 2 fails with one of above errors.
    No other transactions run concurently.
    In read commited isolation error doesn't arise.
    I'm using plain JDBC.
    Similar or even much bigger serializable transaction works perfectly on the same database as plsql procedure.
    I've tried oci and thin (Oracle) drivers and oranxo demo (i-net) driver.
    And this problems arises on all of this drivers.
    This problem confused me so much :(.
    Maby one of Oracle users, developers nows cause of this strange behaviour.
    Thanx for all answers.

  • Bug in Oracle 9.2.0.1.0.

    I have found a bug in Oracle 9.2.0.1.0.
    Here is the bug analysis.
    Step 1:
    CREATE TABLE T1 ( ENO NUMBER, ENAME VARCHAR2(100));
    Step 2:
    CREATE TABLE T2 (DNAME VARCHAR2(1000));
    Step 3:
    INSERT INTO T1 VALUES (1,’KARTHIK’);
    Step 4:
    INSERINTO T2 VALUES ('VENKATRAMAN');
    Commit;
    Now try executing this command,
    Command:
    SELECT * FROM T1 WHERE ENO IN (SELECT ENO FROM T2);
    Here table T2 does not contain “ENO”.
    But the query returns,
    Output:
    =====
    ENAME
    DNAME
    1
    KARTHIK
    VENKATRAMAN
    “ENO” column is being fetched from the main query with table T1 and not from the sub query with table T1.
    Please verify this bug and kindly provide a response.
    Regards,
    Karthik

    Well, heres my test (10g, for I dont have a 9.2.0.1.0, but I think it´d show the same result):
    Connected to:
    Oracle Database 10g Enterprise Edition Release 10.1.0.4.0 - 64bit Production
    With the Partitioning, OLAP and Data Mining options
    SQL> select *
      2  from t1;
    ENO ENAME
       1 KARTHIK
    SQL> select *
      2  from t2;
    DNAME
    VENKATRAMAN
    SQL> select *
      2  from t1
      3  where eno in (select eno from t2);
    ENO ENAME
       1 KARTHIK
    SQL> alter table t2 add (eno number);
    Table altered.
    SQL> select *
      2  from t1
      3  where eno in (select eno from t2);
    no rows selected
    SQL> alter table t2 drop (eno);
    Table altered.
    SQL> select *
      2  from t1
      3  where eno in (select t2. eno from t2);
    where eno in (select t2. eno from t2)
    ERROR at line 3:
    ORA-00904: "T2"."ENO": invalid identifier
    SQL>
    But he is getting output of table T2 too se his last postI don´t think so, because he didn´t SELECT it. Would be nice to just copy & paste the output...
    Regards,
    Gerd

  • BUGS in Oracle Lite ADOCE

    am doing VB programming on msacess in iPAQ device ,
    there is some limitation in sql and one told me those are not exists in orale lite
    so i tred it , intallation ok , running msql ok , creating odb ok ,
    when it comes to programming with ADOCE it is the disaster ;
    i have table ORDER ( OREDERNO NUMBER(9) , ..... )
    when i use
    set orders = CreateObject(oladoce.recordset)
    orders.Open "ORERS", ,1,3
    orders.AddNew
    orders.Fields("ORDERNO").value = 21
    orders.Update
    the program exits on line 2 , even ON ERROR can't catch the error
    the funny thing it passes for some other numbers e.g.
    orders.Fields("ORDERNO").value = 1
    orders.update
    am i doing something wrong or
    there is bugs in oracle ADOCE

    here is the table ORDERS def.
    Name Null? Type
    ORDERNO N NUMBER(5)
    ORDERTYPE Y NUMBER(5)
    PRINTEDNO Y VARCHAR2(15)
    INVOICENO Y VARCHAR2(15)
    BRANCHNO Y VARCHAR2(8)
    COMPANYNO Y VARCHAR2(8)
    SALESMANNO Y VARCHAR2(15)
    CSMNO Y VARCHAR2(15)
    CUSTOMERNO Y VARCHAR2(15)
    SALESECTORNO Y VARCHAR2(4)
    ORDERDATE Y DATE
    DELIVERYDATE Y DATE
    DELIVERYTIME Y VARCHAR2(20)
    ORDERSTATUS Y NUMBER(5)
    and here is the code
    Set Conn = CreateObject("oladoce.activeconnection")
    Conn.Connect "retail"
    Set Orders = CreateObject("oladoce.recordset")
    Orders.Open "ORDERS", , 1, 3
    Orders.AddNew
    Orders.Fields("AREANO").Value = 17 ' here the program exits
    Orders.Update ' it does not even reatch this ine !!!
    you told me to try insert into statement
    i did the following :
    Set Conn = CreateObject("oladoce.activeconnection")
    Conn.Connect "retail"
    Set Orders = CreateObject("oladoce.recordset")
    sqlStmt = "INSERT INTO ORDERS(ORDERNO) VALUES ( 1 ) "
    Orders.Open sqlStmt, , 1, 3
    Set Orders = Nothing
    Conn.Disconnect
    and it does not insert the record into the database
    THE REALLY FUNNY THING WHEN I RUN
    Set Conn = CreateObject("oladoce.activeconnection")
    Conn.Connect "retail"
    Set Orders = CreateObject("oladoce.recordset")
    sqlStmt = "INSERT INTO ORDERS(ORDERNO) VALUES ( 1 ) "
    Orders.Open sqlStmt, , 1, 3
    Set Orders = Nothing
    Set Orders = CreateObject("oladoce.recordset")
    sqlStmt = "commit "
    Orders.Open sqlStmt, , 1, 3
    Set Orders = Nothing
    Conn.Disconnect
    i got an error message ' TABLE OR VIEW NOT FOUND '
    but when i open the table ORDERS i found that the record inserted !!!!!!!
    and you tell me OraLite is not BUGGY !!!!!!!!!!!!!!!!!!

  • Problems connecting from Forms 6i to Personal Oracle

    I have loaded Oracle 8i Personal Edition in the following directory c:\Oracle\Oar81 and Forms 6i in c:\Orawin95 on my local PC. I'm running windows 98 OS. I have been able to use SQL*Plus to query the customer and sales_order demo databases sucessfully. I've also went out to DOS and started up the listner. However when I bring up Forms Builder and try to connect to the database I get the following error: ORA-01034: Oracle not available. I am logging in as scott/tiger. Do I need to specify a database name? Do you have specific suggestions on how to get the Oracle database and Forms Builder talking?

    I have tried your solution and it did not work. Is there another proposition. It seems there is a lot of bugs in oracle forms 6i or personal oracle 8i.
    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by p g ([email protected]):
    Hi,
    I isntalled oracle8i in H:\oracle\ora81 and forms6i in H:\oracle\orant. In order to access tables from oracle8i into froms6i, I copied the service block
    CSCPRJ.DCS =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = TCP)(HOST = prashant)(PORT = 1521)))
    (CONNECT_DATA =
    (SERVICE_NAME = CSCPrj)
    from my oracle home tnsnames.ora file
    H:\oracle\ora81\network\admin\tnsnames.ora
    and pasted it in forms home tnsnames.ora file
    H:\oracle\orant\NET80\ADMIN\tnsnames.ora
    No reboot necessary..
    This let me access my tables from forms6i.
    Hope this helps
    prashant<HR></BLOCKQUOTE>
    null

  • Hierarchical Query - Connect By clause

    Hi
    I've written a query using the Connect By clause to generate the table data in Tree structure with the appropriate levels.
    But Data might not correct such that it may have data which loops around. Like Table1 is parent of Table 2 and Table 2 is parent of Table 3 and Table 3 is again Parent of Table 1. If such incorrect Data exists then I'm getting Oracle Error "ORA-01436: CONNECT BY loop in user data" which is correct.
    What I need is, whenever this error message is raised I need to give my own error message instead of this Oracle error in SQL statement. Please note, I'm not using any PLSQL block, I just have one SQL statement. Appreciate any help on this subject. Thanks.

    Hi,
    Outside of PL/SQL, I don't know of any way to substitute your own error messages for the ones Oracle provides.
    In Oracle 10 (and up), you can write a query using the CONNECT_BY_ISCYCLE pseudo-column. Using CONNECT BY NOCYCLE, the query will never actually raise the ORA-01436 error, but you can get it to display your message in cases where it would have, had you not been using CONNECT BY NOCYCLE.
    Here's how to do it:
    Put your real query, plus CONNECT_BY_ISCYCLE, in the WITH-clause.
    Get the MAX (CONNECT_BY_ISCYCLE) from that sub-query. Let's call this max_cbi.
    Do a UNION ALL of two prongs:
    (1) SELECTs everything (except, pehaps, CONNECT_BY_ISCYCLE) from the sub-query, WHERE max_cbi = 0
    (2) SELECTs your "error message" from dual, WHERE max_cbi = 1.
    Edited by: Frank Kulash on Nov 26, 2008 2:09 PM

  • Does oracle6i support connect by clause

    Want to just a list of all children to a parent ( Multi-Level tree) for the data stored in a table . How is it possible in oracle 6i ? can we use connect by clause in oracle 6i ?

    OK..iS THERE ANY OTHER WAY OUT TO GET THE ALL THE
    CHILD VLAUES FOR A PARTICULAR PARENTsomething like
    10g
    SQL> select connect_by_root ename, ename
      2  from emp
      3  connect by prior empno=mgr
      4  order by 1,2;
    CONNECT_BY ENAME
    ADAMS      ADAMS
    ALLEN      ALLEN
    BLAKE      ALLEN
    BLAKE      BLAKE
    BLAKE      JAMES
    BLAKE      MARTIN
    BLAKE      TURNER
    BLAKE      WARD
    CLARK      CLARK
    CLARK      MILLER
    FORD       FORD
    FORD       SMITH
    JAMES      JAMES
    JONES      ADAMS
    JONES      FORD
    JONES      JONES
    JONES      SCOTT
    JONES      SMITH
    KING       ADAMS
    KING       ALLEN
    KING       BLAKE
    KING       CLARK
    KING       FORD
    KING       JAMES
    KING       JONES
    KING       KING
    KING       MARTIN
    KING       MILLER
    KING       SCOTT
    KING       SMITH
    KING       TURNER
    KING       WARD
    MARTIN     MARTIN
    MILLER     MILLER
    SCOTT      ADAMS
    SCOTT      SCOTT
    SMITH      SMITH
    TURNER     TURNER
    WARD       WARDOracle7
    SQL> select 'BLAKE', ename
      2  from emp
      3  connect by prior empno=mgr
      4  start with ename='BLAKE'
      5  order by 1,2;
    'BLAK ENAME
    BLAKE ALLEN
    BLAKE BLAKE
    BLAKE JAMES
    BLAKE MARTIN
    BLAKE TURNER
    BLAKE WARD

  • Getting strange error with connect by clause

    Hi Everyone,
    I have a 2 test oracle databases and each of them contain a table called department (dept_no,dept_name, main_dept_no) where each department entry is connected to main department by dept_no in the MAIN_DEPT_NO column.
    The strange problem is when I execute the query on the 1 ^st^ database I get D.DEPT_NO is not available column (D.* all columns from department table) but it is there and what is more strange this query works fine on 2 ^nd^ database.
    Is there any settings I have to do in the database so that it can work with connect by clause ?
    SELECT SUBSTR(LPAD(' ', 4*(LEVEL))  || '· ' ||DEPT_NAME,1,50)  DEPT_NAME_HY, D.*
    FROM PERSONEL.DEPARTMENT D
    START WITH MAIN_DEPT_NO IS NULL
    CONNECT BY PRIOR DEPT_NO=MAIN_DEPT_NOThank you.

    SSU wrote:
    Hi Everyone,
    I have a 2 test oracle databases and each of them contain a table called department (dept_no,dept_name, main_dept_no) where each department entry is connected to main department by dept_no in the MAIN_DEPT_NO column. Did you mean two SCHEMAs or tow databases?
    Please post DB version.
    The exact error message you are getting.
    output of the below from the DB rom where you are getting the error
    DESC PERSONEL.DEPARTMENT

  • Recursive joins / how to define query using connect by clause

    Hi,
    I have a table A have 1-1 reltionship with table Employee
    Structure of table is as follows
    Table A
    id name employee_id
    100 aa 1
    200 bb 2
    300 cc 3
    400 dd 4
    500 ee 5
    Table Employee
    id parent_id
    1 null
    2 1
    3 2
    4 3
    5 1
    6 1
    I want to get all records from A table whose employee_id is equal to 2 or (recursive)decendants/child of employee with id 2 (i.e. employee with id 2,3,4 )
    i.e I want recursively join where in I get records from table A as
    id name employee_id
    200 bb 2
    300 cc 3 (because it is child of employee with id 2)
    400 dd 4 (becaue it is child of employee with id 3 which is child of 2)
    I know we can use In clause , but it will be performance wise not good.
    Can we do it in Toplink without using IN clause?
    Oracle has connect by clause, but other database might not have this caluse. So how can write a toplink query which can run on any database.
    Any help is highly appreciated.
    Thanks a lot.

    You can use TopLink's Hierarchical Query support but this only works with Oracle DB as it relies on the database to perform the query.
    --Shaun                                                                                                                                                                                                                                                                                                                                                                                                                                               

Maybe you are looking for

  • Report : invoice list

    hi In my function specs 1) pass vbeln to vbpa, partner role = 'WE' & 'RG' and get the ship-to-party and payer (kunnr) from vbpa table for each billing document from the first line item of the invoice. if ship-to-party code is entered in selection scr

  • Nv driver + video playback?

    I'm using the nv driver and video playback isn't perfect. Videos (in Mplayer and VLC for instance) stay on top of all other windows and when you move the window around the video flickers and becomes black (just while you're moving the window). It's a

  • E70: stuck with a silver colour!

    couldn't get my hands on the black colour & not sure if will be able to change the colour. any idea on this?

  • Sales order, stock transfer same copmany code

    Dear All, Busienss Scenario: Sales order needs to be raised in the Master Distribution Center (MDC) but the goods need to first reach the City Distribution Centre (CDC)and then be delivered to the customer. Here the MDC and CDC belong to the same com

  • Simlpe way to load an image with URL link into iOS with AIR

    I want to be able to display an image (basically a small banner) inside my iPhone game which is loaded from my server where I can advertise new games. What's the best way to do this? Are there any technical issues I should be aware of? Does it fall f