Cursors non closed immediately

hello to everybody....i don't understand a thing....
i work on application under bea weblogic 8.1 sp3 on hp with oracle 10 db.I use the prepared statemtn to insert a certain number of record.....but also when tha application finish to insert....and I close de PreparedStatement and the Connection taken by the pool ( transactional driver XA oracle 10 and transactional Data Source )...i still see the opened cursors on oracle....and then after a while them come closed....
Th question is...why when I close the prepared statement and the connection the oracle cursors don't close immediately?

giorgio giustiniani wrote:
hello to everybody....i don't understand a thing....
i work on application under bea weblogic 8.1 sp3 on hp with oracle 10 db.I use the prepared statemtn to insert a certain number of record.....but also when tha application finish to insert....and I close de PreparedStatement and the Connection taken by the pool ( transactional driver XA oracle 10 and transactional Data Source )...i still see the opened cursors on oracle....and then after a while them come closed....
Th question is...why when I close the prepared statement and the connection the oracle cursors don't close immediately?Prepared statements offer higher performance by being re-useable. WebLogic
will cache prepared statements along with the pooled connection they came
from. In the same way we do not really close a pooled connection when you
call close(), it is the same for most prepared statements. Are you using
our pools?
Joe

Similar Messages

  • SQLException: Cursor is closed while calling a java stored procedure

    Hi,
    I got the following error when trying to read from a cursor of a java stored procedure:
    java.sql.SQLException: Cursor is closed
    The java procedure is stored in the database and wrapped by a sql call. Then another java class executes the sql call.
    The stored procedure looks like this:
    import java.io.Reader; import java.security.MessageDigest; import java.sql.*; import java.text.DateFormat; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Date; import java.util.List; import oracle.jdbc.OracleCallableStatement; import oracle.jdbc.OracleConnection; public class test { static Connection conn = null; static String username = null; static String password = null; static Integer userid  = null; public static void main(String args[]) throws Exception {     username = "keller";     password = "945435";     login(username, password); }       public static String login(String in_username, String in_password) {     String access = null;     String password = null;         try {             DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());  // Non OracleVM             System.out.print("Verbindung wird initialisiert... ");             conn =         //DriverManager.getConnection("jdbc:default:connection:");           //conn.setAutoCommit(false);             DriverManager.getConnection("jdbc:oracle:thin:@[...]:1521:[...]","[...]","[...]");             System.out.println("OK");                         System.out.print("Logindaten werden ueberprueft... ");             String sql = "SELECT matrikelnr, password FROM student WHERE name = ?";             PreparedStatement pstmt = conn.prepareStatement(sql);             pstmt.setString(1, in_username);             ResultSet rset = pstmt.executeQuery();             while (rset.next())             {             userid = rset.getInt(1);                 password = rset.getString(2);             }             access = "student";                         pstmt = conn.prepareStatement(sql);             if (password == null) {             sql = "SELECT dozentnr, password FROM dozent WHERE name = ?";                 pstmt = conn.prepareStatement(sql);                 pstmt.setString(1, in_username);                 rset = pstmt.executeQuery();                 while (rset.next())                 {             userid = rset.getInt(1);                     password = rset.getString(2);                                     }                 pstmt = conn.prepareStatement(sql);                 if (password == null) {                   throw new SQLException("User nicht gefunden!");                 }                 access = "dozent";             }             //rset.close(); // Resultset schließen             //pstmt.close(); // Statement schließen                         // MD5 Hash vergleichen             MessageDigest md5 = MessageDigest.getInstance("MD5");             md5.reset();             md5.update(in_password.getBytes());             byte[] result = md5.digest();             StringBuffer hexString = new StringBuffer();             for (int i=0; i<result.length; i++) {               if(result[i] <= 15 && result[i] >= 0){                 hexString.append("0");               }               hexString.append(Integer.toHexString(0xFF & result));
    if (password != null) {
    if (password.equals(hexString.toString())) {
    System.out.println("OK");
    } else {
    throw new Exception("Falsches Passwort!");
    catch(SQLException e) {
    System.err.println("SQL Fehler!");
    System.err.println(e.getMessage());
    catch(Exception e) {
    System.err.println("Fehler!");
    System.err.println(e.getMessage());
    return access;
    public static void getLeistungsschein(int matrikelnr, ResultSet[] rout)
    ResultSet rs = null;
    try
    System.out.print("Berechtigung ueberpruefen... ");
    if (userid != matrikelnr)
    throw new Exception("Zugriff verweigert, keine Berechtigung!");
    int mnr = matrikelnr;
    ((OracleConnection)conn).setCreateStatementAsRefCursor(true);
    PreparedStatement ps = conn.prepareStatement("select bezeichnung, note from klausur inner join leistungsschein on klausur.KLAUSURNR=leistungsschein.KLAUSURNR where matrikelnr= ?");
    ps.setInt(1, mnr);
    rs = (ResultSet)ps.executeQuery();
    rout[0]= rs;
    catch(SQLException e) {
    System.err.println("Fehler!");
    System.err.println(e.getMessage());
    catch(Exception e) {
    System.err.println("Fehler!");
    System.err.println(e.getMessage());
    The sql call:
    create or replace
    procedure pgetleistungsschein(matrikelnr in number, cur OUT refcurpkg.refcur_t) is
    language java name 'Klausurverwaltung.getLeistungsschein(int, java.sql.ResultSet[])';
    And finally the wrapper is called by another java programm, see this:
    import java.sql.*;
    import java.util.ArrayList;
    import java.util.List;
    import oracle.jdbc.OracleCallableStatement;
    import oracle.jdbc.OracleResultSet;
    import oracle.jdbc.OracleTypes;
    public class cursortest {
    public static void main(String[] args) {
    try{
    //-- Oracle Treiber laden
    Class.forName( "oracle.jdbc.driver.OracleDriver" );
    Connection c = DriverManager.getConnection( "jdbc:oracle:thin:@sligo.fh-trier.de:1521:ubuntu", "dbsem_java","javajava");
    CallableStatement stmt = null;
    ResultSet rs1 = null;
    int matrnr = 945098;
    // Call PLSQL Stored Procedure
    stmt = (CallableStatement)c.prepareCall("{ call ? := getklausuren(?) }");
    stmt.setInt(2, matrnr);
    // 2nd parameter is OUT paremeter
    stmt.registerOutParameter(1, OracleTypes.CURSOR);
    // Execute the callable statement
    stmt.execute();
    //Cursor in ResultSet einlesen
    rs1 = ((OracleCallableStatement)stmt).getCursor(1);
    ResultSetMetaData rsmd = rs1.getMetaData();
    int anzSpalten = rsmd.getColumnCount();
    List<String[]> zeilen = new ArrayList<String[]>();
    while(rs1.next())
    String[] zeile = new String[anzSpalten];
    for (int i=1; i<=anzSpalten; i++)
    zeile[i-1]=rs1.getString(i);
    zeilen.add(zeile);
    String[][] array_angeb_klaus = (String[][])zeilen.toArray(new String[zeilen.size()][anzSpalten]);
    //**** ENDE
    rs1.close();
    stmt.close();
    //c.close();
    catch (SQLException e){
    System.out.println(e);
    catch (ClassNotFoundException f){
    System.out.println(f);

    On top of what jschell says, this just looks wrong in terms of how Oracle's internal Java works as well.
    [Have a look here |http://www.oracle.com/technology/sample_code/tech/java/codesnippet/jdbc/refcur/index.html] (unless things have changed significantly over the past few years for Oracle Java).
    Is the db you are querying a different one to the one this Java is stored in?

  • Eader/Standard/Pro hanging, closing immediately after opening or printing gibberish from application

    Reader/Standard/Pro (versions X & XI hanging, closing immediately after opening or printing gibberish from applications

    1qaz2wsx3edc4rfv5tgb6yhn7 wrote:
    after opening or printing gibberish from applications
    I'm not sure what this means. How is Reader or Acrobat printing from applications? Could you give us some more details as to what you are doing and how you are doing it? Also, do you have all those applications installed on the same machine or is it happening on multiple computers?
    More information = more chance we can help.

  • Applications closing immediately after opening  Text messages not delivered

    It there any way to restore the phones applications when they start to malfunction, instead of doing a complete system restore. As the application are closing immediately after opening. I've tried deleting and restoring them.
    Also text message seem to get lost when doing a system restore. They don't just arrive when its finished. They never get delivered. Caused a few big problems for me but I'll only do it at night now. Has anyone had the same problem.?? Thanks.

    It's in it 7th hour to restore
    and it hasn't started with the photos
    music yet. That cant cant be right??? Can it??

  • OM Sales Order Header should be Closed Immediately after Lines are closed

    Hi,
    OM Sales Order Header should be Closed Immediately after Lines are closed.
    Could you tell me how to modify the header workflow, if anyone has done this...could you please share.
    Thanks

    Thanks Mano, it worked.
    I have one question in workflow, let me create new thread.
    Could you please check my other question at below.
    OM Notable able to capture Approver Rejected comments from the Note field in WF
    OM Notable able to capture Approver Rejected comments from the Note field in WF

  • I downloaded a document dpf, I can not see it and also when I open my iBook is closed immediately. What should I do?

    I downloaded a document dpf, I can not see it and also when I open my iBook is closed immediately. What should I do?

    1. Install the free Adobe Reader app
    2. Open the PDF attachment with Adobe Reader.

  • I have an iphone 4. Recently I have issues with certain apps closing immediately once they are open. ie Email. Tried re-booting entire thing and still having issues. Any one else having this issue or a fix for it?

    I have an iphone 4. Recently I have issues with certain apps closing immediately once they are opened.(ie Email). Tried re-booting entire phone and still having issues. Any one else having this issue or know a fix for it?

    Delete background Apps from memory and then Reset.
    To Delete background Apps, double click Home button, in the bar at bottom, hold down on an App Icon until the minus sign appears, tap all the minus signs, until all background Apps are cleared from memory. Then Reset, hold both Home and Power buttons until the iPhone begins to restart itself, ignor the 'slide to power off' let the iPhone restart itself. Usually takes about 10 seconds of holding both buttons.

  • Remote app closing immediately upon launch

    Apple Remote app launches on my ipad and then immediately closes.  This has just started happening.  I've not updated any OS.  I've tried uninstalling and then reinstalling. No love.  Any suggestions?  Currently running 7.0.6.   Thanks

    You can try closing all apps in the Task Bar at bottom.

  • REFERENCE CURSOR NOT CLOSING - Urgent!!!!!!

    I have some Oracle Stored Fucntions which return REFERENCE TYPE CURSOR. I noticed they are not closing. I even tried the following , but no luck. Any help is much needed.
    PACKAGE Types
    AS
    PRAGMA SERIALLY_REUSABLE;
    TYPE ref_cursor IS REF CURSOR;
    END Types;

    Thanks Justin.
    As you have replied to my query , I am placing the next again.
    I am using the following code :
    counter = 1;
    parm_status = OCIParamGet(stmthp, OCI_HTYPE_STMT, errhp, &mypard, (ub4) counter);
    /* Loop only if a descriptor was successfully retrieved for
    current position, starting at 1 */
    while (parm_status==OCI_SUCCESS)
         /* Retrieve the data type attribute */
         OCIAttrGet((dvoid*) mypard, (ub4)OCI_DTYPE_PARAM, (dvoid*) &dtype,(ub4 *) 0, (ub4) OCI_ATTR_DATA_TYPE, (OCIError *) errhp );
    When I have a stored proc with a reference cursor open then the above code works fine. But if I close the cursor before returning from the procedure then in the above case OCIParamGet() is returning a parameter descriptor , which raises unhandled exception when being called from OCIAttrGet().
    I think as the memory got freed where the reference cursor points , oracle should return some exception that could be handled but instead I receive unhandled exception.
    Is this a problem with Oracle or I need to something else at the client side.
    Please let me know all your views.
    Regards
    Sutanu

  • Downloaded, installed (in OS 10.8.2 (12C60)) click to open and closed immediately

    I try to open the app but it is closing immediatly without showing any window.  What I can do for settling this issue ?

    Could you please provide more details like:
    1. Which Application - Acrobat/Reader
    2. Version - Reader XI (11.0)/ Reader X (10.0)
    3. Any error message?
    4. Can you try with Adminstrator and Root accounts. What is the current user account?
    5. Open /Applications/Utilities/Console and then open application. See if there is error logged there. Please share the error.
    Thanks,
    Karan

  • Applications Closing Immediately After Launching

    I signed up for the yearly subscription of Adobe CC Complete and installed Adobe Premiere, Photoshop and AE. No matter which program I open, after creating a new project or opening an old one the application closes immediately. Applications that do not require creating a new file just close after opening.
    Things i've tried:
    Logging out and back in of the creative cloud installer.
    Using Adobe CC cleaner.
    Disabling the firewall and virus protection.
    Reinstalling multiple times.
    Any assistance is much appreciated.

    It's in it 7th hour to restore
    and it hasn't started with the photos
    music yet. That cant cant be right??? Can it??

  • Non-closing PHP tags in includes?

    Hi,
    This post is directly targetted at David Powers, who is often here (but, of course, could interest others)...
    I'm currently reading the book "Adobe Dreamweaver CS5 with PHP Training From The Source" and I just came accross a strange affirmation:
    on page 184, in the "Why the Next Page Doesn't Always Load" sidebar, in the third bullet you state: "If the include file contains only PHP code, remove the closing PHP tag. This is not only legitimate, it's the recommended best practice."... jaw dropping... I've never seen that...
    I need more explanations... Why would it be recommended? Wouldn't it break the code (particularly PHP) since there's an opening tag but not a closing one? That means that we could have a lot of opening tags without closing tags? Why would it be different from the code that is "inside" the page, for as far as I know it, includes "include" the code into the page "before running it"? So, doesn't PHP "sees" the same thing whether the code is "embed" in the page or included via the include statement?
    Lot of questions, but I need more details, 'cause I'm not sure a Google research on that topic would give me any results...
    Nelson

    Nate has already given you the explanation. If you want the chapter and verse, take a look at the following page in the PHP Manual: http://docs.php.net/manual/en/language.basic-syntax.instruction-separation.php. It says in part:
    "The closing tag of a PHP block at the end of a file is optional,  and in some cases omitting it is helpful when using include() or require(), so unwanted whitespace will  not occur at the end of files, and you will still be able to add  headers to the response later. It is also handy if you use output buffering, and would not like to see added unwanted whitespace  at the end of the parts generated by the included files."
    The Zend Framework Coding Standard for PHP goes much further on the the following page: http://framework.zend.com/manual/en/coding-standard.php-file-formatting.html
    "For files that contain only PHP code, the closing tag ("?>") is  never permitted. It is not required by PHP and omitting it  prevents the accidental injection of trailing white space into the response."
    The "never permitted" applies only to files being submitted to the Zend Framework.
    If anything comes after the PHP code in a file, you must use the closing tag. It's only when the file ends with PHP that you can omit it.

  • After Effects CC 2014 Trial Closing Immediately After Launch

    Basically, I downloaded the trial for both after effects cc (2014) and media encoder cc (2014) but when the installation is finished, I open after effects cc 2014 and literally as soon as it loads up, it closes, and is not a running process anymore in the task manager...
    Someone please help!!

    GUYS I HAVE FOUND A FIX..... firstly, open the after effects cc render engine found at:
    C:\Users\"user"\Desktop\Adobe After Effects CC 2014
    and open the after effects render engine. If this does not open due to an error, close it, go to:
    C:\Users\"user"\AppData\Roaming\Adobe\After Effects\13.1
    and delete the file "Adobe After Effects 13.1 Win en_US Shortcuts" then, run the render engine again. Then, once the render engine opens successfully, you can now open after effects cc 2014 successfully.
    I am so happy I have found this, and if you find this fix helpful, before sure to like and share to other people

  • Why does my Photoshop CS4 Closed Immediately after I open it?

    I can't figure it out. Photoshop closes about a second after I open it. I would have thought it was my PC, but it was working okay a couple of weeks ago.
    I'm running Windows XP.
    Any ideas?
    Thanks

    Glad to help. 
    (Cha Cha Cha -- I got points!!)

  • How do I make a non-closed figure out of lines (continuous, because corners need to line up) of a certain thickness, and then cut it out?

    Hi guys
    Could you help me with this problem? I suspect it's very simple but I'm a beginner.
    I need to create a continuous shape out of lines 15 pixels thick, and then cut it out. I've tried the line tool, using the shift key to add to endpoints, but then the corners do not end up exactly. I've also tried the path key on the pen tool, but this always closes the shape for me, which is not what I want. The shape IS the line.
    I've attached a picture of a basic sketch of the shape I'd like to produce. Can any of you give me any advice? Thank you.

    Draw a baseline guide to snap the pen tool to where you want the lines to line up If you're using CS6 or later, use the stroke so you can edit the line.

Maybe you are looking for

  • SSRS Parameter Drop downs are greyed out after changes to SSAS cube

    Hi I am facing a weird problem. I have 3 SSRS reports that are based on an SSAS cube. Few days back I deployed some changes to cube and everything works ok on dev environment. When I deployed the same changes to production, SSRS reports don't work. I

  • Product cost by sales order

    Dear FICO Gurus, I come to know that for the above method, production order in company A can be settled to Sales Order item in Company B (with assumption that Company A & Company B are intercompany and assigned to 1 Controlling area. My question, und

  • Intercepting image buffer data

    I'm trying to develop a program which needs some image processing to occur on the stream of data being drawn to the screen as displayed by the camera. I don't actually need to capture the video, just process portions of the screen space. How should I

  • How to set PDF Job option using FDK11?

    Hi, I have a tool to convert Framebook into PDF and this works good. But the generated pdf is not of the same size as it is generated through FrameMaker Save as PDF. With the FrameMaker API, I get a dialog box to choose the different PDF Job options

  • Trouble with get requests

    I'm having trouble with get requests from domain.com to sub.domain.com a normal html page on domain.com works fine with loading images from sub.domain.com its not a crossdomain.xml issue really strange