Disadvantages of using REFCURSORs from JDBC

Hi,
Normally I write my SQL statements from inside Java (eg PreparedStatements).
I am investigating on creating PL/SQL Packages, supplying procedures and methods, which I can call from Java using CallableStatements. I understand the advantages of having a layer/API on the database side.
For example: retrieve some records from a table. (the PL/SQL function getCustomers returns a REFCURSOR)
- PreparedStatement (select ... from ... where ...) -> executeQuery -> loop ResultSet
- CallableStatement ("begin ? := getCustomers(); end;") -> cast getObject() to ResultSet -> loop ResultSet
What are the disadvantages of using the CallableStatement (REFCURSOR)?
Thanks, regards, Stephan

While that article may be a good intro for someone not familiar with JDBC it has some misinformation in it that can be misleading at best and cause performance and memory issues at worst.
Row-prefetching - there is little benefit to using a large value for this setting. As with most things extremes are to be avoided.
It is important to know how the data is going to be used. What is the point of bringing ALL the data from the DB in one call if you are going to write it to the file system. File I/O is generally the slowest part of an application.
It is also important that the code be scaleable. Apps should be written so that future modifications will impact existing functionality as little as possible. If you eat up the memory for one table or statement that limits the memory available for other uses. Worse, when things go wrong and you need to reduce the fetch setting you may now have problems everywhere because the testing you originally performed may have relied on that larger fetch setting.
If the data fetching is not done in its own thread then using a very large value can actually make an application appear to 'freeze' while it waits for the data fetch to complete.
A large fetch size can also waste significant amounts of memory; essentially allocating it but never using it and never allowing any other process to use it. This is because for a fetch size of 'n' Oracle has to allocate space for 'n' rows that are each of maximum size.
This wasted is most often due to the common VARCHAR2 datatype. Consider a single column defined as VARCHAR2(100). In the DB this column is stored as variable length. But Oracle will allocate 100 characters (could be multi-byte characters) in order to be able to hold a maximum length value.
If the actual data values never exceed 30 bytes then 70 bytes in each row are totally wasted. The more rows that are prefetched the more memory that is wasted simply in anticipation of a maximum length value that never occurs or only occurs rarely.
I've never used a prefetch/fetch size greater than one thousand and that was for tables with small records (no more than 10 or 20 columns).
And the Oracle docs don't even recommend a setting that high. See the JDBC Dev Guide
http://docs.oracle.com/cd/B19306_01/java.102/b14355/oraperf.htm#i1043756
>
Oracle Row-Prefetching Limitations
There is no maximum prefetch setting, but empirical evidence suggests that 10 is effective. Oracle has never observed a performance benefit to setting prefetch higher than 50. If you do not set the default row-prefetch value for a connection, then 10 is the default.

Similar Messages

  • How to use ANYDATASET from jdbc (11g)

    Hi, the jdbc dev. guide for 11g doesn't even mention the word ANYDATASET.
    However this data type is listed within the set of 11g jdbc new features.
    I will much appreciate any example about using it, e.i. assuming a schema defines a type containing a ANYDATASET attribute to be managed on the jdbc side.
    Thanks.

    Hi ...
    Yeah BPEL connect from the back end rather than using weblogic, but to change it ... we need to change the code from BPEL side to connect from the weblogic JDBC services.

  • URGENT: index not used from jdbc

    Hi,
    This is for java app and sybase database.
    I have a 'select' query for which index is properly created. If I use plain jdbc connection, index is used and result comes pretty fast. but if I use connection from my app, it does not use index and takes long time.
    I am using PreparedStatement in both cases. I have compared all connection properties for both cases and they are exactly same. also, if I run that query using any sql tool like isql, result comes out pretty fast.
    Am I missing any other parameter related to connection?

    akshay_crest wrote:
    I have a 'select' query for which index is properly created. If I use plain jdbc connection, index is used and result comes pretty fast. but if I use connection from my app, it does not use index and takes long time."Plain" meaning like a little test application that runs the same query?
    Most likely reasons.
    1. If the answer to the above is yes, then you probably are not running the same query.
    2. You are not timing them in the same way and something else is slowing it down.
    3. Network problem.
    4. Not connecting to the same database/table.

  • Populate collection from function using refcursor

    Hello,
    I have a question about table functions.
    I'm looking to develop a table function that populates a collection based on a select query. The idea is that the user can pass 1+ variable to a select query in the table function and return a collection of data dependent on the variables they choose, as:
    create type a1 is object (col1 varchar2(1000), col2 varchar2(1000), col3 varchar2(1000));
    --varchar2(1000) used for simplicity
    create type a2 is table of a1;
    create or replace
    function a3(p in varchar2)
    return a2
    is
    mycollection a2:= a2();
    myparam varchar2(10):= p;
    begin
    select a1(topic,null,info)
    bulk collect into mycollection
    from help
    where topic = myparam;
    return mycollection;
    end;
    This executes fine using
    select * from table(a3('ACCEPT'));
    but when I try to write this using a ref cursor instead (even though it might be less efficient) I can't work out how to return multiple columns in a function. I appreciate this is hopelessly wrong, and suspect I'm nowhere near populating type mycollection a2, but:
    create or replace function a4(p in varchar2)
    return a2
    is
    mycollection a2:=a2();
    myparam varchar2(10):=p;
    c_cursor sys_Refcursor;
    begin
    open c_cursor for select seq,info,topic from help where topic = myparam;
    loop
    fetch c_cursor into mycollection;
    exit when c_cursor%notfound;
    end loop;
    close c_cursor;
    return mycollection;
    end;
    This does not execute using
    select * from table(a4('ACCEPT'));
    and returns
    ORA-06504: PL/SQL: Return types of Result Set variables or query do not match
    ORA-06512: at "SYSTEM.A4", line 14
    06504. 00000 -  "PL/SQL: Return types of Result Set variables or query do not match"
    *Cause:    Number and/or types of columns in a query does not match declared
               return type of a result set  variable, or declared types of two Result
               Set variables do not match.
    *Action:   Change the program statement or declaration. Verify what query the variable
               actually refers to during execution.
    Could anyone show me how me how to populate a collection using a refcursor instead of bulk collect? Am using 11GR2.
    Thanks,
    TP,

    I'm looking to develop a table function that populates a collection based on a select query.
    That is pretty much the definition of a PIPELINED function.
    -- type to match emp record
    create or replace type emp_scalar_type as object
      (EMPNO NUMBER(4) ,
       ENAME VARCHAR2(10),
       JOB VARCHAR2(9),
       MGR NUMBER(4),
       HIREDATE DATE,
       SAL NUMBER(7, 2),
       COMM NUMBER(7, 2),
       DEPTNO NUMBER(2)
    -- table of emp records
    create or replace type emp_table_type as table of emp_scalar_type
    -- pipelined function
    create or replace function get_emp( p_deptno in number )
      return emp_table_type
      PIPELINED
      as
       TYPE EmpCurTyp IS REF CURSOR RETURN emp%ROWTYPE;
        emp_cv EmpCurTyp;
        l_rec  emp%rowtype;
      begin
        open emp_cv for select * from emp where deptno = p_deptno;
        loop
          fetch emp_cv into l_rec;
          exit when (emp_cv%notfound);
          pipe row( emp_scalar_type( l_rec.empno, LOWER(l_rec.ename),
              l_rec.job, l_rec.mgr, l_rec.hiredate, l_rec.sal, l_rec.comm, l_rec.deptno ) );
        end loop;
        return;
      end;
    select * from table(get_emp(20))
    In this example the user would provide a 'DEPTNO' value and the query (at the end) would return the rows of the EMP table for that value.
    You can use your own TYPEs and add other parameters as needed.
    See 'Using Pipelined and Parallel Table Functions in the Data Cartridge Dev Guide
    http://docs.oracle.com/cd/B28359_01/appdev.111/b28425/pipe_paral_tbl.htm
    And see all of the sections dealing with Pipelined functions in the PL/SQL dev guide
    http://docs.oracle.com/cd/B28359_01/appdev.111/b28370/tuning.htm#sthref1525

  • Connection from jdbc or sqlj using operating system authentication

    Is it possible to use the operating system authentication to connect to oracle which is on the same box from jdbc or sqlj??
    Any help is appreciated

    You can logon using external credentials with the oci driver by passing in null's as username and password.

  • How  to use  refcursor in a package

    i want to use refcursor in a package
    but when i am trying to declare a refcursor variable ,
    I get no error but the refcursor does not return anything .
    why is this happenning ?
    I also read that we cannot define cursor variables in a paclage .
    Then how to go about it ?
    regards
    shubhajit

    Since Oracle 7.3 REF CURSORS have been available which allow recordsets to be returned from stored procedures, functions and packages. The example below uses a ref cursor to return a subset of the records in the EMP table.
    First, a package definition is needed to hold the ref cursor type:
    CREATE OR REPLACE PACKAGE Types AS
    TYPE cursor_type IS REF CURSOR;
    END Types;
    Note. In Oracle9i the SYS_REFCURSOR type has been added making this first step unnecessary. If you are using Oracle9i or later simply ignore this first package and replace any references to Types.cursor_type with SYS_REFCURSOR.
    Next a procedure is defined to use the ref cursor:
    CREATE OR REPLACE
    PROCEDURE GetEmpRS (p_deptno IN emp.deptno%TYPE,
    p_recordset OUT Types.cursor_type) AS
    BEGIN
    OPEN p_recordset FOR
    SELECT ename,
    empno,
    deptno
    FROM emp
    WHERE deptno = p_deptno
    ORDER BY ename;
    END GetEmpRS;
    The resulting cursor can be referenced from PL/SQL as follows:
    SET SERVEROUTPUT ON SIZE 1000000
    DECLARE
    v_cursor Types.cursor_type;
    v_ename emp.ename%TYPE;
    v_empno emp.empno%TYPE;
    v_deptno emp.deptno%TYPE;
    BEGIN
    GetEmpRS (p_deptno => 30,
    p_recordset => v_cursor);
    LOOP
    FETCH v_cursor
    INTO v_ename, v_empno, v_deptno;
    EXIT WHEN v_cursor%NOTFOUND;
    DBMS_OUTPUT.PUT_LINE(v_ename || ' | ' || v_empno || ' | ' || v_deptno);
    END LOOP;
    CLOSE v_cursor;
    END;
    In addition the cursor can be used as an ADO Recordset:
    Dim conn, cmd, rs
    Set conn = Server.CreateObject("adodb.connection")
    conn.Open "DSN=TSH1;UID=scott;PWD=tiger"
    Set cmd = Server.CreateObject ("ADODB.Command")
    Set cmd.ActiveConnection = conn
    cmd.CommandText = "GetEmpRS"
    cmd.CommandType = 4 'adCmdStoredProc
    Dim param1
    Set param1 = cmd.CreateParameter ("deptno", adInteger, adParamInput)
    cmd.Parameters.Append param1
    param1.Value = 30
    Set rs = cmd.Execute
    Do Until rs.BOF Or rs.EOF
    -- Do something
    rs.MoveNext
    Loop
    rs.Close
    conn.Close
    Set rs = nothing
    Set param1 = nothing
    Set cmd = nothing
    Set conn = nothing
    The cursor can also be referenced as a Java ResultSet:
    import java.sql.*;
    import oracle.jdbc.*;
    public class TestResultSet {
    public TestResultSet() {
    try {
    DriverManager.registerDriver (new oracle.jdbc.OracleDriver());
    Connection conn = DriverManager.getConnection("jdbc:oracle:oci:@w2k1", "scott", "tiger");
    CallableStatement stmt = conn.prepareCall("BEGIN GetEmpRS(?, ?); END;");
    stmt.setInt(1, 30); // DEPTNO
    stmt.registerOutParameter(2, OracleTypes.CURSOR); //REF CURSOR
    stmt.execute();
    ResultSet rs = ((OracleCallableStatement)stmt).getCursor(2);
    while (rs.next()) {
    System.out.println(rs.getString("ename") + ":" + rs.getString("empno") + ":" + rs.getString("deptno"));
    rs.close();
    rs = null;
    stmt.close();
    stmt = null;
    conn.close();
    conn = null;
    catch (SQLException e) {
    System.out.println(e.getLocalizedMessage());
    public static void main (String[] args) {
    new TestResultSet();
    Hope this helps. Regards
    Srini

  • Func returns Cursor problems from JDBC

    I'm wanting to hide implementation behind a function and call from JDBC / SQL
    select a,b,c from tbl where d in ( myFunc ( ? ) )
    My function is:
    FUNCTION F_GET_DEPTS
      ( sup_cuid IN varchar2 )
      RETURN  sys_refcursor IS
    my_depts sys_refcursor;
    BEGIN
        open my_depts for select dept_id from department where lead_cuid = sup_cuid;
        return my_depts;
    END;I test from sql navigator:
    select * from f_get_depts( 'mm9546' )
    or
    select f_get_depts( 'mm9546' ) from dual
    both fail with different error messages.
    Thanks for help
    curt

    Procedure Ref_Types_Getall (p_recordset     OUT          PKG.cursor_type,
    p_error_code      OUT      Number) is
    Begin
    p_error_code:=ERR_OK;
    If Not p_recordset%ISOPEN then
         open p_recordset for Select * from COM_ASS_REFERENCE_TYPES_TAB where Upper(user_edit)='Y' order by description;
    End if;
    Exception when others then
    p_error_code:=ERR_ORA;
    End Ref_types_getall;
    the above procedure returns a ref cursors, if u need to use this in SQL plus
    u should declare a variable like this..
    var c refcursor,
    var ecode number;
    and then execute like this
    exec Ref_types_getall(:c,:ecode)
    after it executes, type
    print c
    the above print stmt will print the resultset
    print ecode
    this will print the error code if any has been set
    HTH
    Srini

  • Error while creating a report that uses Oracle OCI JDBC connectivity

    Please let me know why my CR and LF characters are removed from my forum posting *****
    Hi,
    I was trying to create a report that uses Oracle OCI JDBC connectivity. I am using Eclipse3.4 download from "cr4e-all-in-one-win_2.0.2.zip".  I have successfully created a JDBC OCI connection.
    The connection parameters are given below:
    URL: jdbc:oracle:oci8:@xe
    Database: xe
    username: <userName>
    password: <password>
    I have tested the above connection in Data source Explorer and it works fine!!!
    But I am getting the following error when I drag-and-drop a table from the list of tables. Not sure what I am missing here?  Any help is highly appreciated.
    com.businessobjects.reports.jdbinterface.common.DBException: InvalidURLOrClassName
         at com.crystaldecisions.reports.queryengine.driverImpl.jdbc.JDBCConnection.Open(Unknown Source)
         at com.crystaldecisions.reports.queryengine.JDBConnectionWrapper.Open(SourceFile:123)
         at com.crystaldecisions.reports.queryengine.Connection.br(SourceFile:1771)
         at com.crystaldecisions.reports.queryengine.Connection.bs(SourceFile:491)
         at com.crystaldecisions.reports.queryengine.Connection.t1(SourceFile:2979)
         at com.crystaldecisions.reports.queryengine.Table.u7(SourceFile:2408)
         at com.crystaldecisions.reports.dataengine.datafoundation.AddDatabaseTableCommand.new(SourceFile:529)
         at com.crystaldecisions.reports.common.CommandManager.a(SourceFile:71)
         at com.crystaldecisions.reports.common.Document.a(SourceFile:203)
         at com.businessobjects.reports.sdk.requesthandler.f.a(SourceFile:175)
         at com.businessobjects.reports.sdk.requesthandler.DatabaseRequestHandler.byte(SourceFile:1079)
         at com.businessobjects.reports.sdk.JRCCommunicationAdapter.do(SourceFile:1163)
         at com.businessobjects.reports.sdk.JRCCommunicationAdapter.if(SourceFile:657)
         at com.businessobjects.reports.sdk.JRCCommunicationAdapter.a(SourceFile:163)
         at com.businessobjects.reports.sdk.JRCCommunicationAdapter$2.a(SourceFile:525)
         at com.businessobjects.reports.sdk.JRCCommunicationAdapter$2.call(SourceFile:523)
         at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
         at java.util.concurrent.FutureTask.run(Unknown Source)
         at com.businessobjects.crystalreports.designer.core.util.thread.ExecutorWithIdleProcessing$3.doWork(ExecutorWithIdleProcessing.java:182)
         at com.businessobjects.crystalreports.designer.core.util.thread.AbstractCancellableRunnable.run(AbstractCancellableRunnable.java:69)
         at com.businessobjects.crystalreports.designer.core.util.thread.PriorityTask.run(PriorityTask.java:75)
         at com.businessobjects.crystalreports.designer.core.util.thread.PriorityCompoundCancellableRunnable.runSubtask(PriorityCompoundCancellableRunnable.java:187)
         at com.businessobjects.crystalreports.designer.core.util.thread.PriorityProgressAwareRunnable.runSubtask(PriorityProgressAwareRunnable.java:90)
         at com.businessobjects.crystalreports.designer.core.util.thread.PriorityCompoundCancellableRunnable.doWork(PriorityCompoundCancellableRunnable.java:144)
         at com.businessobjects.crystalreports.designer.core.util.thread.AbstractCancellableRunnable.run(AbstractCancellableRunnable.java:69)
         at com.businessobjects.crystalreports.designer.core.util.thread.ExecutorWithIdleProcessing$IdleTask.run(ExecutorWithIdleProcessing.java:320)
         at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
         at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
         at java.lang.Thread.run(Unknown Source)
    Thanks
    Karthik
    Edited by: KARTHIK1 on Oct 14, 2009 9:38 PM

    Hi Ted,
    Thanks for the feedback. I was able to create a report in Creystal Reports Designer 2008 using OCI.  It is not allowing only in the Eclipse plugin. In our environment we are not allowed to user Oracle thin connections and ONLY OCI is allowed.
    1) Can you please let me know if there is a way to do this? 
    2) Will it allow data sources using native database driver?
    3) If so, can I use JRC to create these reports from a desktop java program?
    Thanks & Regards
    Karthik
    Edited by: KARTHIK1 on Oct 15, 2009 4:38 PM

  • How can i use the weblogic jdbc driver for sqlserver?

    hello
    i have downloaded and installed the weblogic on my windows2000 server,then i want to use the weblogic jdbc driver for sqlserver2000 outside of the weblogic,as follow:
    1 add following string to my classpath environment of the wndows2000: E:\bea\wlserver6.1\lib\mssqlserver4v65.jar
    2 then i write a test program as:
    import weblogic.jdbc.mssqlserver4.Driver;
    import java.sql.*;
    public class test{
    public static void main(String argv[]){
    try{ Class.forName("weblogic.jdbc.mssqlserver4.Driver");
    Connection
    conn=DriverManager.getConnection"jdbc:weblogic:mssqlserver4:localhost:1433","sa",""); }catch(Exception e){ System.out.println(e.getMessage()); }
    4 when i execute it,it throw a exception:
    Exception in thread "main" java.lang.NoClassDefFoundError: weblogic/version at weblogic.jdbc.mssqlserver4.TdsStatement.getLicenseStr(TdsStatement.java:2665) at weblogic.jdbc.mssqlserver4.TdsStatement.microsoftLogin(TdsStatement.java:2474) at weblogic.jdbc.mssqlserver4.MicrosoftConnection.beginLogin(MicrosoftConnection.java:42) at weblogic.jdbc.mssqlserver4.TdsConnection.login(TdsConnection.java:57) at weblogic.jdbc.mssqlserver4.MicrosoftConnection.login(MicrosoftConnection.java:53) at weblogic.jdbc.mssqlserver4.BaseConnection.prepareConnection(BaseConnection.java:187) at weblogic.jdbc.mssqlserver4.Driver.newConnection(Driver.java:34) at weblogic.jdbc.mssqlserver4.ConnectDriver.connect(ConnectDriver.java:151) at java.sql.DriverManager.getConnection(DriverManager.java:517) at java.sql.DriverManager.getConnection(DriverManager.java:177) at test.main(test.java:7)
    who can help me?thank you!

    Hi,
    Mail me the jar file as I am using Weblogic 6.1 to my email id [email protected]
    Else tell me the site from where u have downloaded and i will do the same.
    I will test the same and let you know.
    Thanks,
    Seetesh

  • Disadvantages of using "0" zero as first value in a generated sequence

    Does anyone have any experience with the benefits/disadvantages of using a value of 0 "zero" as the first value generated in a sequence that is also populated in a table. My past experience has always used the values of 1 "one" as the first generated value from a sequence.
    Thanks

    Benefit: You get use one "more" number from the list of values that can possibly be generated by the sequence. If you are start from '1', you have missed out on '0' :-)
    Disadvantages: If any of the queries have predicate like "sequence_generated_column_value > 0" and that your sequence starts from zero, the record with sequence_generated_column_value=0 will not appear in result set for that query (assuming it satisfies other conditions).
    May be there are many mores benefits/disadvantages to add to this list :-)

  • Using workflow from jsf pages...

    We have built a simple JSF page on OC4J app server..
    We want to call our workflow program from this page.
    How should I use the CREATE PROCESS() AND START PROCESS() inside the JSF page?
    We are using 10.1.2. application server. And We SSO connection between
    OC4J 10 1. 3.2
    we deploy our java application to this OC4J..
    But we when we call workflow functions we get get_remote_user error.
    Can we call direct PL/SQL API over JDBC connection without using OWF Java API.
    Or we need (must) use Java aPI to supply this.
    Thanks...

    We see that we can call CREATE PROCESS() OR START PROCESS() inside the JSF page..
    But the problem are about notifications which needs authentication now
    How can we use notifications from java...
    Can we call direct PL/SQL API over JDBC connection without using OWF Java API.
    Or we need (must) use Java aPI to supply this.
    Thanks...

  • How to use payload from standard RFC MessageType in a RFC Lookup function

    Hello
    We have a DB sender to call an BAPI. The DB receiver gets the BAPI response.
    It is an easy scenario with one mapping.
    But the RFC Mapping Lookup is very awful. You have to rebuild all open and close tags to get the RFC payload. A lot of concat functions are a must. The error search in such a mapping is not easy and seems like EAI developing 1990 (Hand am Arm).
    Ok, it is better as a BPM, but it is not well for first level support person and release changes and trouble shooting.
    How can I use a XML payload from first mapping in my RFC Mapping lookup (second mapping)? There must be a way with two mappings and an easy RFC lookup.
    Currently (one mapping):
    DB sender format -> ( RFC lookup self-made RFC XML structure) DB receiver format
    My dream (two mappings):
    DB sender format -> RFC SAP XI standard Format ->(RFC lookup by using Payload from first mapping) DB receiver format
    I hope someone can help me with an example.
    Daniel

    Hi Daniel,
    If i understood correctly, urs is a 'Asynch' scenario JDBC to JDBC with a RFC lookup in Mapping.
    If its so, then i think wat u r expecting can be done. In Interface Mapping, u can add more than one message mappings.
    So first do a Mapping for DB sender format - RFC input standard format,
    then another one for RFC sender Format - RFC receiver format, (look up code goes in this mapping).
    Then third one from RFC receiver format to DB receiver format.
    The order n which u add in Interface Mapping is also important. This is a suggestion, i havent tried this, but still i think u can give it a try.
    Regards,
    P.Venkat

  • Stored procedure call with REF CURSOR from JDBC

    How can I call a SP with a REF CURSOR OUT parameter from JDBC?

    This is a breeze.
    CallableStatement oraCall = oraConn.prepareCall("BEGIN PKG_SOMETHING.RETURNS_A_SP(?);END;");
    oraCall.registerOutParameter(1,oracle.jdbc.driver.OracleTypes.CURSOR);
    oraCall.execute();
    ResultSet rsServList = (ResultSet) oraCall.getObject(1);
    ... use ResultSet ...
    rsServList.close();
    oraCall.close();
    slag

  • Performance problem with slow VIEW from JDBC (fast from SQL Developer)

    Hi all,
    I'm experiencing following problem and would like to know if someone else also hit this one before and has a suggestion how to solve it:
    I have a pretty complicated SELECT statement that per definition returns only a few rows (~30). With no further optimization it takes ~20 seconds to return the full dataset in Oracle SQL Developer. If you add the */+ PUSH_PRED(name_of_some_inner_view) /* hint (hint is correct, stars got eaten by the OTN-forum syntax), the statement takes less than 0.5s to execute (still in SQL Developer). I saved the statement with the hint as VIEW. Selecting from the VIEW in SQL Developer is also fast.
    Now if I call the statement from JDBC (Tomcat webapp), I can see from the server console that the statement is 1:1 100% the same as the one I execute in SQL Developer. Nevertheless it takes about 20 seconds to complete.
    Here my details:
    SELECT banner FROM v$version;
    BANNER                                                                        
    Oracle Database 11g Express Edition Release 11.2.0.2.0 - Production             
    PL/SQL Release 11.2.0.2.0 - Production                                          
    CORE     11.2.0.2.0     Production                                                        
    TNS for 32-bit Windows: Version 11.2.0.2.0 - Production                         
    NLSRTL Version 11.2.0.2.0 - Production                                          
    JDBC Driver used: some old odbc14.jar as well as current odbc6.jar for 11.2.0.2.0 from http://www.oracle.com/technetwork/da...10-090769.html
    SQL Developer: current version 3.2.20.09From my reading this could go wrong:
    - JDBC doesn't know the VIEW's column data types and Oracle behaves mysterious because of this (=there must be more to the SELECT than just the string, some meta-information)
    - For some reason the hint inside the VIEW is not used (unlikely)
    I also tried a Table Function/Pipelined table and selected from it as a workaround, but the result is the same: Selecting from Function is fast from SQL Developer, but slow from JDBC. All other statements that come from JDBC are as fast as they should be. I really don't know what to think of this and where the error might be.
    Is there some setting that tells Oracle not to use hints when called from JDBC?
    Thank you & Best regards,
    Blama

    Hi Bawer,
    that's what I'm thinking. Unfortunately I can't post it, as it is library code (not my lib). But in the debug-output I can see the SQL-String sent to the DB (which does include the hint).
    But I find the 2nd option you mention more likely anyway: Even if I put the hint into a VIEW and select from the view, the time-difference is there (it's even there if I use Table Functions/Pipelined table and select from the function).
    So I'd think it is more likely that something else is happening (e.g. Oracle is configured in a way that it does not use hints when called from JDBC or similar. Or the library sets some session options in order to prevent the usage of hints). But I don't know if there is even the possibility of doing so.
    Does the Oracle JDBC driver have the option to set these options?
    Does the Oracle DB have the option to set sth. like "ALTER SESSION SET dontUseHints = 'Y';"

  • Use of Remote JDBC  SQL Database External Resource

    Does anybody here uses a Remote JDBC External Resource to connect to a database? If so, can you tell me if had any impediment with this approach?
    I'm asking this because our company has a lot of tools to monitor a lot of weblogic assets (such as jdbc connection pools and datasources) and We'd like to monitor all BPM-to-database connections usage and pool health. Other feature that we'd like to give to BPM application is the weblogic's capability to use an Multi-DataSource (one logical DS that represents more than one phisical DS).
    Thanks and Best Regards,
    Luiz Rocha

    Hi,
    We are facing connection leak in our application .We have defined External resouce as Remote JDBC which is defined in weblogic config.Xml. If any body could explain is there is anyway to handle closing connections manually as we do in J2ee conn.close() in ALBPM ??? . I found runtime configuration in oracle implementation type when defining external resource (i.e supported type:oracle database) an attribute
    "*Connection idle time* (mins): The connection is closed after the defined time"
    But i dont find any equivalent entry in my config.xml as we do our implementation of type Remote JDBC.....
    Any advice on this and how connection closing happens in Normal scenarios within ALBPM will be very useful.
    Our connection pool attributes reads like.....(Note *the values of few attributes deleted)
    <JDBCConnectionPool AddOracleFlagToXAResource="true"
    CountOfTestFailuresTillFlush="1"
    DriverName=""
    InitialCapacity="150" KeepXAConnTillTxComplete="true"
    MaxCapacity="200" Name=""
    PasswordEncrypted=""
    Properties="user=" ShrinkingEnabled="false"
    SupportsLocalTransaction="true" Targets=""
    TestConnectionsOnCreate="false" TestConnectionsOnRelease="false"
    TestConnectionsOnReserve="true"
    TestTableName="SQL SELECT 1 FROM DUAL"
    URL=""
    XARetryDurationSeconds="300" XASetTransactionTimeout="true" XATransactionTimeout="420"/>
    .Advice us can the below attribute can be added in Connection pool properties or anything else......
    **{[(*Inactive Connection Timeout The number of inactive seconds on a reserved connection before WebLogic Server reclaims the connection and releases it back into the connection pool.***
    ***You can use the Inactive Connection Timeout feature to reclaim leaked connections - connections that were not explicitly closed by the application. Note that this feature is not intended to be used in place of properly closing connections.***
    ***When set to 0, the feature is disabled*.)}]**

Maybe you are looking for

  • Creating ABAP server proxy

    Hi, When trying to create an ABAP Proxy in transaction SPROXY my Interface does not contain the method EXECUTE_SYNCHRONOUS. Instead it contains a method of the same name as my Interface. Does anyone know how to fix that? Thanks, Regards, Morten

  • Function Previous() does not retrieve good values

    Hello Forum, I'm using BO XIR2, Desktop Intelligence. I'm displaying some quantities and turnover by month and I try to compute the % of increase/decrease between a month and the previous month. The report looks like that : .........................J

  • Relinking media question

    Hi everyone, I am using CS3 I have a question about relinking media. I have some MXF files, which are quite long (going on for 2 hours) (these were captured on a Sony EX3 camera). There are 4 mono audio tracks associated with each video file. Althoug

  • Acrobat v9 JavaScript Alert Box - any way to add space or line break after each array item?

    I have a Document level Javascript used to identify blank required fields and is triggered on document actions, Print and Save. The script identifies the blank required fields, counts them, and outputs to an Alert box indicating the number of require

  • Importing Development Configurations in NWDS

    Hi All,         I am using NWDS for ESS Development. I need to import the development configurations to my local installation. When I choose the remote option and tried to connect to the JDI DC pool link. All the preferences settings for J2EE and JDI