OracleConnectionCacheImpl vs OracleConnectionPoolDataSource

I'm a little confused as to the division of labor between these two classes... What does the cache give me that the regular ConnectionPoolDataSource doesn't?

HI,
The very basic difference between OracleConnectionCacheImpl and OracleConnectionPoolDataSource is that
OracleConnectionCacheImpl cann connect only to one database and schema while using OracleConnectionPoolDataSource you get the flexibility of connection to different schemas.
Since ConnCache can connect to only one schema, it stores connection metadata,state....and lot of stuff so that its very efficient than OracleConnectionPoolDataSource.
But if you need the flexibility of connecting to different schemas, we prefer OracleConnectionPoolDataSource.
In OracleConnectionCacheImpl we have different conn cache schemes, Dynamic, Fixed wait and Fixed with no wait.
Going deeper, OracleConnectionPoolDataSource is Oracle's implementation of javax.sql.ConnectionPoolDataSource interface, while
OracleConnectionCacheImpl is a sample implementation of interface OracleConnectionCache. Anybody can implement there own version of OracleConnectionCache and handle the ConnectionEvents generated.
Hope this helps
Elango.

Similar Messages

  • DataSource-class pool-JNDI-bind-lookup

    Hi,
    I am a beginner in this subject and it is confused. I read that
    the best way to use the connections is from a DataSource. There
    are 2 ways to configure it:
    1- From the data-source.xml file
    2- Or using InitialContext, Context and bind method from a java
    program loaded in the startup.
    If so, which one is better?
    On the other hand, there are some classes I can use, for
    instance:
    1- OracleConnectionCacheImpl
    2- OracleConnectionPoolDataSource
    etc.
    which one is better?
    Thank you very much for any comment.
    Andres.

    Hi:
    upon further research, i find that the data
    that was used in State class at binding does not change on any update,
    like via foll -
    State s = (State)ic.lookup(JNDINAME);
    s.addHashtableEntry (key, val); or
    s.setDesc ("new desc");
    next time i lookup State class the hashtable entry is missing and desc is
    old and not "new desc".
    any help appreciated.
    thanks
    rajans
    Rajan Sadasivan wrote:
    Hi:
    I am using jdk1.3, weblogic6.0
    I am binding a state class like ->
    public class State implements Serializable {
    private String desc;
    private Hashtable sessions;
    onto the JNDI tree. Binding is done like initialCxt.bind (name,
    _state);
    and state's sessions has one entry in it and state's desc is set.
    I then use another client to do _initialCxt.lookup (name) on same
    weblogic JVM.
    The _state object is returned with correct value of desc; but the
    sessions
    hashtable is empty and the single entry is gone. I do see also the the
    State's finialize () method is called.
    Can anyone explain why i am losing hashtable information ?
    How do I make this work in weblogic jndi with hashtable info ?
    thanks
    rajans

  • Setting roles on connection pools

    Hi,
    using OracleConnectionCacheImpl and OracleConnectionPoolDataSource,
    how can I set a role on the pooled connections since the creation of the physical
    connection is out of my hands ? Ideally, I would like to set the role only once
    so that when I call getConnection() to get the logical connection I do not have
    to set it again and again ...
    We are using exclusively stored procedures which one can execute according to its role.
    Typically, my client has a role and uses a well known ConnectionCache which should
    set the role accordingly.
    Is the only solution to set the role on each request ?
    I hope not.
    Is anybody using roles in their applications ?
    Cheers
    Arnaud

    Hi,
    using OracleConnectionCacheImpl and OracleConnectionPoolDataSource,
    how can I set a role on the pooled connections since the creation of the physical
    connection is out of my hands ? Ideally, I would like to set the role only once
    so that when I call getConnection() to get the logical connection I do not have
    to set it again and again ...
    We are using exclusively stored procedures which one can execute according to its role.
    Typically, my client has a role and uses a well known ConnectionCache which should
    set the role accordingly.
    Is the only solution to set the role on each request ?
    I hope not.
    Is anybody using roles in their applications ?
    Cheers
    Arnaud

  • Cache_scheme and OracleConnectionPoolDataSource

    Hi guys.
    I am implementing Oracle's OracleConnectionPoolDataSource to provide Connection Pooling. So far, so good. However, I also wanted to introduce the use of cache_scheme for optimising once we reach the max connections limit. Do I need to use OracleConnectionCacheImpl instead of OracleConnectionPoolDataSource in order to utilise cache_scheme ? Or does OracleConnectionPoolDataSource make use of this within it's own implementation ?
    Thanks.
    Steve.

    Hi Dmitry,
         The behavior of the near cache depends on the invalidation startegy used. You can choose invalidation strategy by adding <invalidation-strategy> element to your <near-scheme> definition, and choosing one of the following four options:
         none -- typically used with the size and/or time limited front cache. The cache will not use events to evict items from the front cache.
         present -- a separate cache listener will be registered for each item in the front cache. That way front cache only receives the events for the items it cares about.
         all -- a single cache listener is registered that notifies front cache of any changes to the back cache. That means that it receives the events for all cache items, including those it doesn't care about (i.e. does not contain). On the other hand it helps keep the number of cache listeners low.
         auto -- currently same as all and default value if <invalidation-strategy> element is not specified.
         What you have to keep in mind when working with the near cache is that the front cache is only updated on gets, not on puts, unless invalidation strategy is set to none. If that wasn't the case, bulk load through the near cache would be problematic from the performance standpoint because of the large number of listener registrations (present) or the large number of events received (all).
         So, if you use time/size based expiration you can set invalidation strategy to none and items will be cached on the client side (front cache) on inserts. Otherwise, you should simply keep this difference in behavior in mind when working with the near cache.
         Finally, you should also be aware that queries against the near cache are simply passed through to the back cache and the results of the queries are not cached on the client side -- only subsequent gets will cache individual items.
         HTH,
         Aleks
         Message was edited by: aseovic

  • OracleConnectionPoolDataSource and JNDI

    I am attempting to use the OracleConnectionPoolDataSource via JNDI.
    I have defined two <data-source> items in the data-sources.xml file; one is for a non-pooled javax.sql.DataSource object, the other is for a pooled oracle.jdbc.pool.OracleConnectionPoolDataSource.
    data-sources.xml:
    <!-- Standard JDBC+JNDI -->
    <data-source
    class="javax.sql.DataSource"
    name="jdbc/myDS"
    location="jdbc/myDS"
    url="jdbc:oracle:thin:@nn.nnn.nnn.nnn:1521:MYSID"
    username="xxx"
    password="yyy"
    />
    <!-- Oracle Pool -->
    <data-source
    class="oracle.jdbc.pool.OracleConnectionPoolDataSource"
    name="jdbc/pool/myDS"
    location="jdbc/pool/myDS"
    url=" jdbc:oracle:thin:@nn.nnn.nnn.nnn:1521:MYSID "
    username="xxx"
    password="yyy"
    />
    I can get a non-pooled DataSource, however, when I attempt to obtain a pooled DataSource, OC4J (via JDeveloper 10g) throws an exception:
    Error instantiating web-app JNDI-context: Unknown resource type: oracle.jdbc.pool.OracleConnectionPoolDataSource
    Why can't OC4J recognize this object?

    ok man you shell set teh class12.jar in you server class path , try it

  • OracleConnectionCacheImpl setter values for instance properties

    Hi!
    I'm using OracleConnectionCacheImpl to cache my connections to the Oracle 8i (8.1.7.4)
    The JDBC driver that I'm using is 9.2.x
    I've read through the SQLJ/JDBC documentation and learned that it is possible to use certain properties for controlling the behaviour of connection cache.
    Only thing is that the documentation does not specify whether the values for the properties should be milliseconds, seconds, minutes or something else. The long type of the parameter value would indicate milliseconds but according my minimal testing at least some of the values propably are not milliseconds. Help is greatly appreciated. Below is the list of the properties I'm interested in:
              // Controls how often cache thread check whether a physical connection has become available
    /*ods.setThreadWakeUpInterval(threadWakeUpInterval);
    // How long the logical connection can be used before forced back to the cache pool and all
    // resources are freed.
    ods.setCacheTimeToLiveTimeout(cacheTimeToLiveTimeout);
    // How long the physical connection can be unused before it is closed and all the resources are freed.
    ods.setCacheInactivityTimeout(cacheInactivityTimeout);
    // How long the connection request will be waiting before EOJ_FIXED_WAIT_TIMEOUT is thrown.
    ods.setCacheFixedWaitTimeout(cacheFixedWaitTimeout);
    // How long the cache waits before polling for an available connection
    ods.setCacheFixedWaitIdleTime(cacheFixedWaitIdleTime); */
    Best Regards:
         Aapo Romu

    Hello Radhakrishna D S,
    The note you provided did not fit our problem. The bootstrap.maxheapsize in the instance.properties file is already 128MB. Thanks anyway!

  • OracleConnectionCacheImpl - "Setting the user name and passwwdd"

    Does anyone know how to disable (or suppress, or redirect) the message...
    "Setting the user name and passwwdd"
    ... when using OracleConnectionCacheImpl?
    null

    This is bug 1317673
    null

  • Does OracleConnectionCacheImpl cache physical or logical db connections?

    Hello -
    Can anyone tell me if the "cache" in oracle.jdbc.pool.OracleConnectionCacheImpl is of logical or physical database connections?
    (My app selectively enables roles (depending on end user) on the connections it gets - trying to determine if I can use OracleConnectionCacheImpl as a data source...)
    -- Thanks

    Logical connection

  • NullPointerException with OracleConnectionCacheImpl

    I get the following exception from the OracleConnectionCacheImpl.getConnection() method when a number of threads are using the Cache:
    java.lang.NullPointerException
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java, Compiled Code)
    at oracle.jdbc.driver.OracleConnection.setAutoCommit(OracleConnection.java, Compiled Code)
    at oracle.jdbc.driver.OracleConnection.<init>(OracleConnection.java, Compiled Code)
    at oracle.jdbc.pool.OraclePooledConnection.getConnection(OraclePooledConnection.java, Compiled Code)
    at oracle.jdbc.pool.OracleConnectionCacheImpl.getConnection(OracleConnectionCacheImpl.java, Compiled Code)
    at oracle.jdbc.pool.OracleConnectionCacheImpl.getConnection(OracleConnectionCacheImpl.java, Compiled Code)
    Why is this happening. I thought the OracleConnectionCacheImpl etc. was thread safe.
    Any help would be greatly appreciated.
    null

    What is Interface?? Its hard to run the prog w/o that...

  • OracleConnectionPoolDataSource creates inactive sessions

    Hi,
    My customer uses OracleConnectionPoolDataSource and finds that the pooled connection had created a huge number of inactive sessions on the database side.
    Any idea why this happens?
    Thanks in advance.
    Regards,
    Sindhiya V.

    Hi Hamdy,
    The inactivity timeout was configured through the Oracle Enterprise Manager.
    We created a Data Source and specified the following attributes on the page.
    JNDI Locations
    Location: jdbc/USPSTFPDADefaultDS
    XA Location: jdbc/xa/USPSTFPDAXADS
    EJB Location: jdbc/USPSTFPDADS
    Connection Attributes
    Connection Retry Interval: 5
    Max Connection Attempts: 3
    Cached Connection Inactivity Timeout: 300
    Maximum Open Connections: 10
    Minimum Open Connections: 1
    Wait For Free Connection Timeout: 5
    Hope you could help me in resolving this issue.
    Thanks & Regards,
    Sindhiya V.

  • Setting connectionProperties on OracleConnectionPoolDataSource

    Hi all,
    we are using on our project the SAP Netweaver 2004, Java 1.4 and the Oracle database with the JDBC driver 10.2.0.4. Netweaver as application server supports the use of JNDI datasources.
    The configuration is as follows:
    Factory: oracle.jdbc.pool.OracleDataSourceFactory
    DataSource Type: ConnectionPoolDataSource
    CPDS Classname: oracle.jdbc.pool.OracleConnectionPoolDataSource
    Due to the huge amount of data, we need to set different parameters to optimize the connection performance.
    connectionProperties     {packetSize=8192, defaultRowPrefetch=100}
    If we set the properties like the user or the password the connectionProperties parameter will be ignored. I read in the JDBC documentation that the class OracleConnectionPoolDataSource extends the OracleDataSource, so the class supports the parameters. For me it looks like that the OracleDataSourceFactory doesn't pass the parameters to the OracleConnectionPoolDataSource instance, therefore the parameters are not set on the connection.
    Now I have the following questions:
    Is it possible to set the connection parameters?
    Is there any reason why the parameters aren't passed to the datasource?
    What others possibilities do we have?
    Thanks in advance
    Detlef

    Change this:
    $users = get-aduser -filter {createTimeStamp -gt $date} -Properties * | select samaccountname
    To this:
    $users = get-aduser -filter {createTimeStamp -gt $date} -Properties * | select -expandproperty samaccountname
    Also, you're creating an access rule that only applies to the folder itself (not to the subfolders and files). If that's what you're after, then leave it as is. If you want to apply to subfolders and files, though, change this:
    $permission = "$_","FullControl","Allow"
    to this:
    $permission = "$_","FullControl","ContainerInherit,ObjectInherit","None","Allow"
    Let me know if that works (there's a chance you're going to have some issues with Set-Acl, but we'll see about that later)

  • Statement cache bug in OracleConnectionCacheImpl

    Hi,
    Did you guys ever try setStmtCacheSize() in OracleConnectionCacheImpl? When I enable statement cache in connection cache, I always get "close connection error". It seems connection.close() did not clean up the statement associating with this conneciton.
    This is my code piece:
    //occ is object of OracleConnectionCacheImpl
    Conection conn1 = occ.getConnection();
    doSomeDBWork(conn1);
    conn1.close();
    Connection conn2 = occ.getConnection();
    doSomeDBWork(conn2); <-- SQLException
    Thank you
    Jason

    I found out the problem. The JDBC team should set the stmtCacheSize 0 before reusePooledConnection. This is the only way we can do without phsically close the connection.

  • OracleConnectionPoolDataSource Problem

    I'm Trying to connect a JSP tomcat-based application to Oracle using
    OracleConnectionPoolDataSource and related classes. I have used
    javax.sql.DataSource an it did work fine. I have made changes I need for using
    that classes and when I get the DataSource it throws exception
    "javax.naming.NamingException: Cannot create resource instance".
    I'm using Apache Tomcat 5.5.23 for windows, Java JDK 1.5.0_05 and Oracle 9i
    Release 2 (9.2.0.1.0). All for windows.
    Changes I have made are these:
    In context.xml:
    <Context path="/test" docBase="test" debug="0"
    reloadable="true" >
    <Resource
    name="jdbc/test" auth="Container"
    type="oracle.jdbc.pool.OracleConnectionPoolDataSource"
    maxActive="0" maxIdle="-1" maxWait="-1"
    removeAbandoned="true" removeAbandonedTimeout="60" logAbandoned="true"
    username="test" password="test"
    driverClassName="oracle.jdbc.pool.OracleConnectionPoolDataSource"
    url="jdbc:oracle:thin:@192.168.1.109:1521:GLOBALDB" />
    </Context>
    In web.xml (only resource-ref):
    <resource-ref>
    <res-ref-name>jdbc/test</res-ref-name>
    <res-type>oracle.jdbc.pool.OracleConnectionPoolDataSource</res-type>
    <res-auth>Container</res-auth>
    </resource-ref>
    Code that creates connection:
    initCtx = new InitialContext();
    ctx = (Context) initCtx.lookup("java:/comp/env");
    ds = (OracleConnectionPoolDataSource) ctx.lookup("/jdbc/test");
    PooledConnection pc = ds.getPooledConnection();
    con = pc.getConnection();
    I have searched in google and found some examples that use
    oracle.jdbc.driver.OracleDriver in driverClassName. I have also tried this
    option with the same results. I suppose bug is elsewhere.
    I have tried to create DataSource instance in the code instead of get it from
    resource. Doing this it drops no error and page works, but I don't know how can
    I control maximun number of pooled connections. This is the code I have used for
    that:
    initCtx = new InitialContext();
    OracleConnectionPoolDataSource ds = new OracleConnectionPoolDataSource();
    ds.setDataSourceName("oracle.jdbc.pool.OracleConnectionPoolDataSource");
    ds.setURL(dbURL);
    ds.setDescription(DS);
    ds.setUser(dbUsuario);
    ds.setPassword(dbPassword);
    initCtx.rebind(DS, ds);
    pc = ds.getPooledConnection();
    But it creates only one connection and doesn't allow two users to log in at the
    same time.
    Please. I need help.

    how can
    I control maximun number of pooled connections.
    Maximum number of dB connections in pool are set using the maxActive parameter.
    <parameter>
    <name>maxActive</name>
    <value>100</value>
    </parameter>
    Maximum number of idle dB connections to retain in pool are set using the maxIdle parameter.
    <parameter>
    <name>maxIdle</name>
    <value>30</value>
    </parameter>

  • ORA-01858: a non-numeric at OracleConnectionPoolDataSource

    I have OracleConnectionPoolDataSource. When I run my JSP , I am getting error
    java.sql.SQLException: ORA-01858: a non-numeric character was found where a numeric was expected
    Error line is showing at OracleConnectionPoolDataSource ocpds = new OracleConnectionPoolDataSource();
    What could be the reason?
    Thanks in advance

    select to_date('ERROR')
    ERROR at line 1:
    ORA-01858: a non-numeric character was found where a numeric was expectedPlease see (OERR: ORA 1858 "a non-numeric character was found where a numeric was expected" [ID 19182.1]).
    Thanks,
    Hussein

  • OracleConnectionCacheImpl violating MAX_LIMIT

    Hi,
    I am using OracleConnectionCacheImpl for conection pooling in my application. I have set the Min and Max limits as 30 and 100 respectively. I am using DYNAMIC_SCHEME for connection pooling.
    But whenever there is heavy load on my application the number of conections is exceeding the MAX_LIMIT of 100. So in a way the OracleConnectionCacheImpl does not seem to be taking care of the MAX limit on the number of conections.
    And the application reaches to a point where it does n't seem to recover the unused connections. Is it anything to do with the scheme that we are using?
    Please help. Thanks in advance ..:-)

    JDBC (on a JSP for instance) will usually do the query and close the connection when the command close() is called. However, this doesn't mean that the connection is closed at the database. Since there's no wait, or no resources being used anymore by the connection, the connection goes to INACTIVE state.
    If you are inside Oracle's intranet, take a look at this:
    http://bigbird.us.oracle.com:7777/dbadmin/session_test.jsp
    This page queries the sessions table on a database (using a cached connection). Each time you refresh the page, you see a new inactive session (used to generate the previews page), and a new ACTIVE session used to generate the current page. You'd think the cached connection (bean) would always use the same connection. But it doesn't. Hit REFRESH on the browser 20 times and you will see 20 INACTVE connections from LUCIO @ bigbird.
    The MAX limit is set to 150. But since those 20 inactive sessions have no jobs waiting, before you get to 150 sessions on the list, a bunch of them will suddenly disappear, as they are automatically released so the Database can allocate resources to new sessions.
    If you are getting the MAX sessions reached error, make sure you issue the close() function from your Connection object in every JDBC application that creates a new session. If you don't, they will accumulate as active sessions and won't be released.

Maybe you are looking for

  • Installation problem with CS4 on Windows 7

    I have been trying to install CS4 to a new HDD. It is from the (licensed) disk. It stops at the Initializing phase: "Checking System Profile", getting stuck at 90%. Here is the screen message: I have turned off any antivirus scanning, even turned off

  • Simple button AS help

    I'm learning Action Script. I adapted the graphics from premade Flash script from Flashkit.com. I'm trying to write the script to made the buttons active and get a URL. It uses a rotating graphic with six buttons positioned like on the spokes of a fe

  • Cracked Touch Pad on Officejet Pro 8500 Premier

    I have an HP Officejet Pro 8500 Premier Wireless All-in-one printer (#A909n). The touch pad is cracked and I'm wondering if it can be replaced. I can't find the part in the online listing. The printer is functioning (by computer and buttons), but it

  • Bank account set-up

    Hi I have been tasked with setting up a new bank account for our company to seperate certain income from our standard reciepting account. this income will be received in to SAP through our income management system and will posted through our abap pro

  • HT4743 when I rent a movie on my computer from itunes store why can I not find it on my Apple tv for playback?

    When I rent a movie from itunes library on my desktop it is not showing up under rented on my Apple tv? This has not happened before?. Can I rent or buy directly from Apple TV? I hope someone can answer this silly question. Carol