Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> RE: Have you had any issues with 9.2.0.5

RE: Have you had any issues with 9.2.0.5

From: Lord David <DLord_at_ironmountain.co.uk>
Date: Fri, 9 Jul 2004 15:38:16 +0100
Message-ID: <64C5AA1FF5364B409CC917BC616E8C24011EB0D9@harsvr28.internal.haysims.co.uk>


Fuad,

The bug number is 3724758. Fortunately, there's an easy workaround, which is to make sure that you wait until you have got everything from the statement before you close it. Here's the code I used to reproduce the error: -


import java.io.*;
import java.lang.InterruptedException;
import java.sql.*;

import oracle.jdbc.OracleTypes;

class TestCase {

   public static void main (String args [])

      throws SQLException, IOException, InterruptedException{

// Load the Oracle JDBC driver

      DriverManager.registerDriver(new oracle.jdbc.OracleDriver());

// Prompt the user for connect information

      String user = "enter user here";
      String password = "password here";
      String database = "tns_alias here";


// Connect to the database
// You can put a database name after the @ sign in the connection URL.
System.out.println ("Connecting..."); Connection conn = DriverManager.getConnection ("jdbc:oracle:oci8:@" + database, user, password); System.out.println ("connected.");
// Open a callable statement
System.out.println("Preparing callable statement..."); CallableStatement cs = conn.prepareCall("declare" + " type cv_type is ref cursor;" + " l_cv cv_type;" + " begin" + " open l_cv for select count(*) from dual;" + " :1 := l_cv;" + " end;");
// Register the out parameter
System.out.println("Registering out parameters..."); cs.registerOutParameter(1, OracleTypes.CURSOR);
// Execute the statement
System.out.println("Executing statement..."); cs.execute();
// Close the callable statement
System.out.println("Closing statement..."); cs.close();
// Get the result set
// Crash occurs at this point
System.out.println("Getting result set..."); ResultSet rs = (ResultSet) cs.getObject(1);
// Get the result
rs.next(); int i = rs.getInt(1); System.out.println("Result is " + String.valueOf(i));
// Close the result set
rs.close();
// Close the connection
conn.close();

   }
}
--
David Lord 



> -----Original Message-----
> From: Fuad Arshad [mailto:fuadar_at_yahoo.com] 
> Sent: 09 July 2004 15:08
> To: oracle-l_at_freelists.org
> Subject: RE: Have you had any issues with 9.2.0.5
> 
> 
> can you give some examples we're having  a similar issue on 
> 9.2.0.4 and not sure 
> a bug reference.? the case scenario.?
> Lord David <DLord_at_ironmountain.co.uk> wrote:
> Hi,
> 
> We've run into a bug with the JDBC drivers. When trying to 
> get an object
> from a closed CallableStatement object the JVM crashes. It 
> should raise an
> error. It looks like in previous versions, you could do this 
> even though it
> is not strictly allowed.
> 
> Regards
> --
> David Lord 
This email and its attachments are confidential under applicable law and are intended for use of the sender's addressee only, unless the sender expressly agrees otherwise, or unless a separate written agreement exists between Iron Mountain and a recipient company governing communications between the parties and any data that may be so transmitted.  Transmission of email over the Internet is not a secure communications medium.  If you are requesting or have requested the transmittal of personal data, as defined in applicable privacy laws, by means of email or in an attachment to email, you may wish to select a more secure alternate means of transmittal that better supports your obligations to protect such personal data.

If the recipient of this message is not the recipient named above, and/or you have received this email in error, you must take no action based on the information in this email.  You are hereby notified that any dissemination, misuse or copying or disclosure of this communication by a recipient who has received this message in error is strictly prohibited. If this message is received in error, please return this email to the sender and immediately highlight any error in transmittal.  Thank you.

----------------------------------------------------------------
Please see the official ORACLE-L FAQ: http://www.orafaq.com
----------------------------------------------------------------
To unsubscribe send email to:  oracle-l-request_at_freelists.org
put 'unsubscribe' in the subject line.
--
Archives are at http://www.freelists.org/archives/oracle-l/
FAQ is at http://www.freelists.org/help/fom-serve/cache/1.html
-----------------------------------------------------------------
Received on Fri Jul 09 2004 - 09:37:15 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US