OracleConnectionCacheImpl recycle unused connections?

Hi all,
Does anyone know if the OracleConnectioCacheImpl has any sort of mechanism that recycles unused connections when traffic decreases?
From my tests, it seems to create connections fine up to the maximum, or past it depending on the cache scheme used, but it doesn't seem to recycle back down to the minimum or anything.

My own experience and I understand from Metalink there is a known bug (internal) with the 8.1.7 driver that causes setMaxLimit to be a real hard limit even if you use the DYNAMIC scheme.
ie no connections are made above the limit and it therefore will never reduce back down.
Discovered after pulling my hair out as to why our apps performance sucked big time... try running 700 users on a pool with 3 connections :-))
<BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Derek Wichmann:
When you say "take them down to the cache size that you specified," I take it that this is the limit specified with OracleConnectionCacheImpl.setMaxLimit()?<HR></BLOCKQUOTE>
null

Similar Messages

  • OracleConnectionCacheImpl opens more connections than its max!

    Hi there, I have an application that uses lots of connections... I have a pool of connections that I implement with the Oracle class: OracleConnectionCacheImpl. I set the maximum number of connections to 50, and for some reason, sometimes it reaches the 50 connections and ever more! It reached 60 connections at some point... So my question is, what are the reasons that a pool implemented with a OracleConnectionCacheImpl object reaches its maximum connections and more? How can I fix this?
    Thanks!

    It's probably a little bit too late to answer but it may serve someone else:
    By default, when the maximum number of PooledConnection objects exists in the cache, and no free connection instance is available for a request, the cache will create another PooledConnection object, therefore exceeding the specified limit. Choosing a connection cache scheme can alter this behavior. There are three connection caching schemes available in the Oracle connection caching implementation.
    �     Dynamic
    �     Fixed Wait
    �     Fixed with no Wait
    The connection cache scheme is set using the setCacheScheme() method by passing in one of three constant values, DYNAMIC_SCHEME, FIXED_WAIT_SCHEME or FIXED_RETURN_NULL_SCHEME.

  • LDAP - Free unused Connections

    Hi,
    I am very new to work with Active Directory. I have got a PL/SQL script from net to communicate with LDAP and it is working fine.
    My task is to check the user names against the LDAP.
    But am getting "DBMS_LDAP: Cannot open more than 63 LDAP connections" error.
    I have gone through so many sites to resolve this issue. Everyone is suggesting to close the connection after the executing the script.
    I already have a closing statement in my script.
    "l_retval := DBMS_LDAP.unbind_s(l_session); "
    Please help me to resolve this issue.
    Thanks,
    Rajesh.B

    Here is the script.
    create or replace
    FUNCTION GET_LDAP_STATUS 
    (acct in varchar2)
    RETURN number AS
    BEGIN
    DECLARE
      -- Adjust as necessary.
      output PLS_INTEGER;
      l_ldap_host VARCHAR2(256) := ;
      l_ldap_port VARCHAR2(256) := ;
      l_ldap_user VARCHAR2(256) := ;
      l_ldap_passwd VARCHAR2(256) := ;
      l_ldap_base VARCHAR2(256) :=;
      l_retval       PLS_INTEGER;
      l_session      DBMS_LDAP.session;
      l_attrs        DBMS_LDAP.string_collection;
      l_message      DBMS_LDAP.message;
      l_entry        DBMS_LDAP.message;
      l_attr_name    VARCHAR2(256);
      l_ber_element  DBMS_LDAP.ber_element;
      l_vals         DBMS_LDAP.string_collection;
    BEGIN
      -- Choose to raise exceptions.
      DBMS_LDAP.USE_EXCEPTION := TRUE;
      -- Connect to the LDAP server.
      l_session := DBMS_LDAP.init(hostname => l_ldap_host,
                                  portnum  => l_ldap_port);
      l_retval := DBMS_LDAP.simple_bind_s(ld     => l_session,
                                          dn     => l_ldap_user,
                                          passwd => l_ldap_passwd);
      -- Get all attributes
      l_attrs(1) := 'sAMAccountName'; -- retrieve all attributes
      l_retval := DBMS_LDAP.search_s(ld       => l_session,
                                     base     => l_ldap_base,
                                     scope    => DBMS_LDAP.SCOPE_SUBTREE,
                                     filter   => 'sAMAccountName='||acct,
                                     attrs    => l_attrs,
                                     attronly => 0,
                                     res      => l_message);
      IF DBMS_LDAP.count_entries(ld => l_session, msg => l_message) > 0 THEN
        -- Get all the entries returned by our search.
        l_entry := DBMS_LDAP.first_entry(ld  => l_session,
                                         msg => l_message);
        << entry_loop >>
        WHILE l_entry IS NOT NULL LOOP
          -- Get all the attributes for this entry.
          DBMS_OUTPUT.PUT_LINE('---------------------------------------');
          l_attr_name := DBMS_LDAP.first_attribute(ld        => l_session,
                                                   ldapentry => l_entry,
                                                   ber_elem  => l_ber_element);
          << attributes_loop >>
          WHILE l_attr_name IS NOT NULL LOOP
            -- Get all the values for this attribute.
            l_vals := DBMS_LDAP.get_values (ld        => l_session,
                                            ldapentry => l_entry,
                                            attr      => l_attr_name);
            << values_loop >>
            FOR i IN l_vals.FIRST .. l_vals.LAST LOOP
              DBMS_OUTPUT.PUT_LINE('ATTIBUTE_NAME: ' || l_attr_name || ' = ' || SUBSTR(l_vals(i),1,200));
              l_retval := l_retval+1;
            END LOOP values_loop;
            l_attr_name := DBMS_LDAP.next_attribute(ld        => l_session,
                                                    ldapentry => l_entry,
                                                    ber_elem  => l_ber_element);
          END LOOP attibutes_loop;
          l_entry := DBMS_LDAP.next_entry(ld  => l_session,
                                          msg => l_entry);
        END LOOP entry_loop;   
      END IF;
      -- Disconnect from the LDAP server. 
      DBMS_OUTPUT.PUT_LINE('L_RETVAL: ' || l_retval);
      return l_retval;
      l_retval := DBMS_LDAP.unbind_s(l_session); 
    END;
    END GET_LDAP_STATUS;Edited by: BluShadow on 05-Jan-2012 14:15
    added {noformat}{noformat} tags for readability of the code. Please read: {message:id=9360002} and learn to do this yourself.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • 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.

  • Difference between connection = null and connection.close()

    is it correct
    connection = null means connection object is eligible for garbage collection and does not return to connection pool
    and f or
    connection.close() means the connection object return to the
    connection pool
    is there any other difference between this ....?????

    "connection = null;" is just like any other similar Java statement, it removes that reference to the object. If that was the last reference to the object, then it becomes eligible for finalization and garbage collection, with no guarantee that either will actually occur. However, normal connection pool implementation will have a seperate reference to the connection and if the connection has not been returned, will most likely consider the connection to be "leaked" - allocated but never returned, and unusable.
    connection.close(); is a normal JDBC connection method; it (usually) closes the associated objects and releases the connection; it's not uncommon to explicitly close statements and resultsets instead of depending on connection.close(). A connection pooling implementation that works by extending the Connection class MIGHT change the meaning of close() and instead of actually closing, return it to the pool instead. Personally, I would consider such an implementation to be evil and a blight on good programming practices; changing the action of such standard methods is bound to cause trouble, IMHO. More normally, if you were using connection pooling, you would NOT close the connection, but rather call some special method to return the connection to the pool.

  • Freeing connections in a connection pool

    I am using WLS8.1.2 on IA64 with jrockit 8.1.2.
    I have created a connection pool using Microsoft's type 4 non-xa jdbc driver fpr
    SQLServer2000.
    My application performs a number of db operations, then using the retrieved information,
    makes a call to a mainframe and finally makes an insert into the SQLServer. As
    the mainframe call takes a long time, 5-6s and I have many (~1,000) concurrent
    clients, I explicitly close the db connection prior to the call and then re-open
    it for the final insert operation.
    As the initial sql requests take less than 1s, I expected that this approach would
    significantly reduce the number of open connections in the pool, since whilst
    one thread is waiting for 5 seconds, others will be able to use the connection.
    However, from the connection pool monitor, I see that closing the db connection
    has no effect. I have as many open connections as I have threads in the execute
    queue.
    For the connection pool configuration I have enabled shrinking and the "Remove
    Infected Connections Enabled" box is not "ticked".
    Is there anything else that I should do that will return unused connections back
    to the pool?
    Thanks in advance for any advice.
    jez wain

    jez wain wrote:
    Joe Weinstein <[email protected]> wrote:
    Let me see your code. Attached below, with appliction-specific, non-jdbc code removed.Ok. The code looks safe. I assume the DataSource you're accessing is not a
    weblogic transactional DataSource, correct? For instance, if you run this
    code, and before setting autoCommit(false), could you call getAutoCommit()
    and verify that it returns true?
    The reason I ask, is that you are controlling a JDBC transaction on your
    own, just as if you got a plain JDBC connection directly from the DBMS
    driver. However, if you are getting a connection from a transaction-aware
    DataSource, and if this thread is running in the context of a UserTransaction,
    such as in or under a a TX_REQUIRED EJB, then the connection will already be
    autoCommit(false) when you get it, and *when you close or commit the connection
    the connection will cheerfully ignore you until the transaction coordinator
    tells the connection that the tx is really done. If this is the case, then
    you would not be releasing the connection as you thought half-way along
    Joe
    PS: The only suggestion I would have for the code, is that whenever you close
    a JDBC object, you set it to null. And at the end, in the finally, do this:
    // in separate try blocks so a failure in one won't make us skip the next
    if (rs != null) try {rs.close();} catch (Exception ignore){}
    if (ps != null) try {ps.close();} catch (Exception ignore){}
    if (con != null) try {con.close();} catch (Exception ignore){}
    >
    >
    It should be obtaining, using and closing
    a pool connection all within one user invoke. The connection object
    should be a method-level variable so every thread gets it's own.That's what I've done.
    The server has a fixed number of execute threads, so however many
    users are logged in, the server will only be processing that fixed
    number of users at any instant. When one thread is done with a user,
    it closes it's pool connection making it available for the next user
    this thread works for.I understand that. But in my application each thread creates a jdbc connection,
    executes 500ms worth of sql queries, explicitely closes the jdbc connection and
    then effectively sleeps for 5 or 6 seconds waiting for the mainframe. When the
    mainframe replies, it re-opens the jdbc connection, performs another 500ms of
    jdbc updates and then exits.
    My point is that during the 5s waiting for the mainframe, with the jdbc connection
    closed, approx. 5 other threads could use the same connection to perform their
    operations. I would therefore expect that the number of open connections in the
    connection pool to be a little more than one fifth of the number of active threads
    in execute queue. But what I observe is that the number of open connection pool
    connection follows one-for-one the number of active threads.
    Here's the code:
    public class AddItemImpl implements AddItem {
    private static DataSource ds = null;
    private static InitialContext ic = null;
    static {
    try {
    System.out.println("AddItemImpl v1.0");
    ic = new InitialContext();
    ds = (DataSource) ic.lookup(Syetem.getProperty("XXX.datasource"));
    } catch (Exception ex) {
    Syetem.err.println("AddItemImpl Exception: " + ex.getMessage());
    public AddItemResponse addItem(AddItems parameters) {
    AddItemResponse response = null;
    Connection con = null;
    PreparedStatement ps = null;
    ResultSet rs = null;
    try {
    con = ds.getConnection();
    con.setAutoCommit(false);
    AddItemData inputData = parameters.getAddItemData();
    * Check tx id.
    String txId= inputData.getTxId();
    java.sql.Date txDate = null;
    double balance = 0;
    String txState = null;
    ps =
    con.prepareStatement(
    "select balance, state, date from transactions where tx_id= ? ");
    ps.setString(1, txId);
    rs = ps.executeQuery();
    if (!rs.next()) {
    logger.warning("Transaction not found: " + txId);
    con.rollback();
    } else {
    balance = rs.getDouble(1);
    txState = rs.getString(2);
    txDate = rs.getDate(3);
    rs.close();
    ps.close();
    // check data valiidity using with 4
    // more "select" prepared statements
    // in the same style as above
    // checkpoint the state
    int n = 0;
    ps = con.prepareStatement(
    "insert into status tx_id,tx_type,client_id,date,client_data,op_id)
    "+
    "values(?, ?, ?, ?, ?, ?) ");
    ps.setString(1, txId);
    ps.setString(2, txType);
    ps.setInt(3, cleintId);
    ps.setDate(4, currentDate);
    ps.setString(5, clientData);
    ps.setBigDecimal(6, operationId);
    // the operationId poses some uniquenes pb
    // track any errors here
    try {
    n = ps.executeUpdate();
    } catch (SQLException ex) {
    System.err.println(ex.getMessage());
    System.err.println("operationId: " + operationId+ " 0x"+Long.toHexString(operationId));
    ps.close();
    if (n == 0) {
    logger.error("Problem updating status");
    con.rollback();
    } else {
    // commit and close the connection before calling mainframe
    // the mainframe request takes several seconds. Others
    // can use our connection in the meantime
    con.commit();
    con.close();
    Stock stock = getStockFromMainframe(/* mainframe req i/p params */);
    con = ds.getConnection();
    con.setAutoCommit(false);
    // update local instance variables
    // then update tables
    ps = con.prepareStatement(
    "update transactions set balance = ? where tx_id= ? ");
    ps.setDouble(1, balance);
    ps.setString(2, txId);
    n = ps.executeUpdate();
    if (n == 0) {
    logger.error("Problem updating transactions");
    con.rollback();
    } else {
    ps.close();
    ps=con.prepareStatement("update operations set ops_1=ops_1+1,ops_2=ops_2+1"+
    " where tx_id = ? and cod_tx = ? ");
    ps.setString(1, txId);
    ps.setString(2, txType);
    n = ps.executeUpdate();
    if (n == 0) {
    logger.error("Problem updating operations");
    con.rollback();
    } else {
    ps.close();
    // more updates/inserts using the same model as above
    con.commit();
    response = new AddItemResponse(/* AddItemResp constructor params
    }catch (SQLException ex) {
    logger.error("AddItemImpl: " + ex.getMessage());
    ex.printStackTrace(System.err);
    } finally {
    try {
    if (con != null) con.close();
    if (ps != null) ps.close();
    if (rs != null) rs.close();
    } catch (SQLException se) {
    logger.error("AddItemImpl: execption tidying up: " + se.getMessage());
    return response;

  • Does anyone know if a cable exists that would connect Airport Express to a Sony DMport connection?

    I have a Sony home cinema amp and the only unused connection is a DMport. I have googled, but can't seem to get a definative answer. Can anyone help?

    The DMPort is for a special Sony manufacturered iPod adapter or other Sony product only.
    The port will not work with an AirPort Express, even if you could figure out how to manufacture the cable and plugs at both ends.

  • ORA-31223: DBMS_LDAP: cannot open more than 63 LDAP server connections

    I get this when I use the function wwv_flow_ldap.is_member
    which is a HTMLDB package.
    I use this function on every page for authorisation but after a while i get this error.
    Metalink says to close the unused connections, but unfortunately it doesn't say how to do this.
    I tried asking the HTMLDB people how and why this function opens connections without closing them but before I end up hoping for a patch I'd like to know if there is a quick fix to close unused connections with a procedure....

    You need a handle to the LDAP session to close the connection, so it really needs to be done by the entity that opened it.
    If you have access to the LDAP session, then you could close it if you have some sort of "end of request cleanup processing routine". This is what the standard Portal code does. Since yours is a HTMLDB-specific issue, you may need a fix from them.

  • When is it appropriate to use DataSource (or Connection pooling)?

    Hello all,
    I'm having some design issues with my application and I'm starting to think that maybe using Connection pooling is not suited for my application. I'm using Tomcat 5.5.12 if it's any relevant..
    The architecture of our application looks like this:
    Servlets -> App Helper classes -> DB/Accessor classes
    looks like the three-tier architecture described in this document: http://www.subrahmanyam.com/articles/servlets/ServletIssues.html
    I have read on the Tomcat docs that said that using DataSource is good practice and improves efficiency since it recycles database connections. However, if the accessor/DB classes are not servlets, how can I use the DataSource facility that interacts with Tomcat?
    I would like to know whether it is a good idea to use DataSource in my case and if so, how? (since they are not servlets)
    Thanks in advance :)

    Hi. Thank you for replying.
    In the examples that I've seen that use JNDI for Database access, it seems that DataSource is always used--in other words, JNDI and DataSource always seem to be used together (in Servlets). I have not found a case where JNDI is used by itself to access the Database--perhaps I'm not looking in the right place. Could you point me to some documentation maybe?
    Thanks a lot!

  • How Many Connections Created???

    We have a customer running WLS 5.1 on Solaris vs. Oracle 8.1.6. Here is the configuration
    for the connection pool:
    weblogic.jdbc.connectionPool.ewDBConnectionPool=\
    url=jdbc:weblogic:oracle,\
    driver=com.manu.es.db.ESWeblogicDriver,\
    loginDelaySecs=1,\
    initialCapacity=4,\
    maxCapacity=10,\
    capacityIncrement=2,\
    allowShrinking=true,\
    shrinkPeriodMins=15,\
    refreshMinutes=10,\
    testTable=dual,\
    Note that com.manu.es.db.ESWeblogicDriver just extends weblogic.jdbc.oci.Driver
    with some static properties to allow the driver to find our license.
    Given the small maximum number of connections, how do we explain this excerpt
    from the weblogic log:
    Wed Feb 27 19:39:32 CET 2002:<I> <JDBC Pool> Connection for pool "ewDBConnectionPool"
    created.
    Wed Feb 27 19:39:33 CET 2002:<I> <JDBC Pool> Connection for pool "ewDBConnectionPool"
    created.
    Wed Feb 27 19:39:34 CET 2002:<I> <JDBC Pool> Connection for pool "ewDBConnectionPool"
    created.
    Wed Feb 27 19:39:35 CET 2002:<I> <JDBC Pool> Connection for pool "ewDBConnectionPool"
    created.
    Wed Feb 27 19:39:36 CET 2002:<I> <JDBC Pool> Connection for pool "ewDBConnectionPool"
    created.
    Wed Feb 27 19:39:37 CET 2002:<I> <JDBC Pool> Connection for pool "ewDBConnectionPool"
    created.
    Wed Feb 27 19:39:38 CET 2002:<I> <JDBC Pool> Connection for pool "ewDBConnectionPool"
    created.
    Wed Feb 27 19:39:39 CET 2002:<I> <JDBC Pool> Connection for pool "ewDBConnectionPool"
    created.
    Wed Feb 27 19:39:40 CET 2002:<I> <JDBC Pool> Connection for pool "ewDBConnectionPool"
    created.
    Wed Feb 27 19:39:41 CET 2002:<I> <JDBC Pool> Connection for pool "ewDBConnectionPool"
    created.
    Wed Feb 27 19:39:42 CET 2002:<I> <JDBC Pool> Connection for pool "ewDBConnectionPool"
    created.
    Wed Feb 27 19:39:43 CET 2002:<I> <JDBC Pool> Connection for pool "ewDBConnectionPool"
    created.
    Wed Feb 27 19:39:45 CET 2002:<I> <JDBC Pool> Connection for pool "ewDBConnectionPool"
    created.
    Wed Feb 27 19:39:46 CET 2002:<I> <JDBC Pool> Connection for pool "ewDBConnectionPool"
    created.
    Wed Feb 27 19:39:47 CET 2002:<I> <JDBC Pool> Connection for pool "ewDBConnectionPool"
    created.
    Wed Feb 27 19:39:48 CET 2002:<I> <JDBC Pool> Connection for pool "ewDBConnectionPool"
    created.
    Wed Feb 27 19:39:49 CET 2002:<I> <JDBC Pool> Connection for pool "ewDBConnectionPool"
    created.
    Wed Feb 27 19:39:50 CET 2002:<I> <JDBC Pool> Connection for pool "ewDBConnectionPool"
    created.
    Wed Feb 27 19:39:51 CET 2002:<I> <JDBC Pool> Connection for pool "ewDBConnectionPool"
    created.
    Wed Feb 27 19:39:52 CET 2002:<I> <JDBC Pool> Connection for pool "ewDBConnectionPool"
    created.
    Wed Feb 27 19:39:53 CET 2002:<I> <JDBC Pool> Connection for pool "ewDBConnectionPool"
    created.
    Wed Feb 27 19:39:54 CET 2002:<I> <JDBC Pool> Connection for pool "ewDBConnectionPool"
    created.
    Wed Feb 27 19:39:55 CET 2002:<I> <JDBC Pool> Connection for pool "ewDBConnectionPool"
    created.
    Wed Feb 27 19:39:56 CET 2002:<I> <JDBC Pool> Connection for pool "ewDBConnectionPool"
    created.
    Wed Feb 27 19:39:58 CET 2002:<I> <JDBC Pool> Connection for pool "ewDBConnectionPool"
    created.
    Wed Feb 27 19:39:59 CET 2002:<I> <JDBC Pool> Connection for pool "ewDBConnectionPool"
    created.
    Wed Feb 27 19:40:00 CET 2002:<I> <JDBC Pool> Connection for pool "ewDBConnectionPool"
    created.
    Wed Feb 27 19:40:01 CET 2002:<I> <JDBC Pool> Connection for pool "ewDBConnectionPool"
    created.
    Wed Feb 27 19:40:02 CET 2002:<I> <JDBC Pool> Connection for pool "ewDBConnectionPool"
    created.
    Wed Feb 27 19:40:03 CET 2002:<I> <JDBC Pool> Connection for pool "ewDBConnectionPool"
    created.
    Wed Feb 27 19:51:05 CET 2002:<I> <JDBC Pool> Connection for pool "ewDBConnectionPool"
    created.
    Wed Feb 27 19:51:06 CET 2002:<I> <JDBC Pool> Connection for pool "ewDBConnectionPool"
    created.
    ..and it continues on from there...
    Thanks in advance for any enlightenment.
    Mark

    Mark Shaffer wrote:
    We have a customer running WLS 5.1 on Solaris vs. Oracle 8.1.6. Here is the configuration
    for the connection pool:Hi. Odd. My guess is that multiple user threads all hit the pool at the same time when it had none
    available, so each thread simultaneously created 2 more connections. In other words, it may be a
    synchronization bug in the pool to allow this. Another factor may be that if the refresh testing
    is going on at that time, it may have temporarily reserved all the unused connections, causing the
    need for more. For stability and performance I recommend having the pool make all it's connections
    at startup (init=max), and not shrink, and to have testConnsOnReserve true, and to effectively turn
    off refresh by setting the time to 9999999.
    Joe
    >
    >
    weblogic.jdbc.connectionPool.ewDBConnectionPool=\
    url=jdbc:weblogic:oracle,\
    driver=com.manu.es.db.ESWeblogicDriver,\
    loginDelaySecs=1,\
    initialCapacity=4,\
    maxCapacity=10,\
    capacityIncrement=2,\
    allowShrinking=true,\
    shrinkPeriodMins=15,\
    refreshMinutes=10,\
    testTable=dual,\
    Note that com.manu.es.db.ESWeblogicDriver just extends weblogic.jdbc.oci.Driver
    with some static properties to allow the driver to find our license.
    Given the small maximum number of connections, how do we explain this excerpt
    from the weblogic log:
    Wed Feb 27 19:39:32 CET 2002:<I> <JDBC Pool> Connection for pool "ewDBConnectionPool"
    created.
    Wed Feb 27 19:39:33 CET 2002:<I> <JDBC Pool> Connection for pool "ewDBConnectionPool"
    created.
    Wed Feb 27 19:39:34 CET 2002:<I> <JDBC Pool> Connection for pool "ewDBConnectionPool"
    created.
    Wed Feb 27 19:39:35 CET 2002:<I> <JDBC Pool> Connection for pool "ewDBConnectionPool"
    created.
    Wed Feb 27 19:39:36 CET 2002:<I> <JDBC Pool> Connection for pool "ewDBConnectionPool"
    created.
    Wed Feb 27 19:39:37 CET 2002:<I> <JDBC Pool> Connection for pool "ewDBConnectionPool"
    created.
    Wed Feb 27 19:39:38 CET 2002:<I> <JDBC Pool> Connection for pool "ewDBConnectionPool"
    created.
    Wed Feb 27 19:39:39 CET 2002:<I> <JDBC Pool> Connection for pool "ewDBConnectionPool"
    created.
    Wed Feb 27 19:39:40 CET 2002:<I> <JDBC Pool> Connection for pool "ewDBConnectionPool"
    created.
    Wed Feb 27 19:39:41 CET 2002:<I> <JDBC Pool> Connection for pool "ewDBConnectionPool"
    created.
    Wed Feb 27 19:39:42 CET 2002:<I> <JDBC Pool> Connection for pool "ewDBConnectionPool"
    created.
    Wed Feb 27 19:39:43 CET 2002:<I> <JDBC Pool> Connection for pool "ewDBConnectionPool"
    created.
    Wed Feb 27 19:39:45 CET 2002:<I> <JDBC Pool> Connection for pool "ewDBConnectionPool"
    created.
    Wed Feb 27 19:39:46 CET 2002:<I> <JDBC Pool> Connection for pool "ewDBConnectionPool"
    created.
    Wed Feb 27 19:39:47 CET 2002:<I> <JDBC Pool> Connection for pool "ewDBConnectionPool"
    created.
    Wed Feb 27 19:39:48 CET 2002:<I> <JDBC Pool> Connection for pool "ewDBConnectionPool"
    created.
    Wed Feb 27 19:39:49 CET 2002:<I> <JDBC Pool> Connection for pool "ewDBConnectionPool"
    created.
    Wed Feb 27 19:39:50 CET 2002:<I> <JDBC Pool> Connection for pool "ewDBConnectionPool"
    created.
    Wed Feb 27 19:39:51 CET 2002:<I> <JDBC Pool> Connection for pool "ewDBConnectionPool"
    created.
    Wed Feb 27 19:39:52 CET 2002:<I> <JDBC Pool> Connection for pool "ewDBConnectionPool"
    created.
    Wed Feb 27 19:39:53 CET 2002:<I> <JDBC Pool> Connection for pool "ewDBConnectionPool"
    created.
    Wed Feb 27 19:39:54 CET 2002:<I> <JDBC Pool> Connection for pool "ewDBConnectionPool"
    created.
    Wed Feb 27 19:39:55 CET 2002:<I> <JDBC Pool> Connection for pool "ewDBConnectionPool"
    created.
    Wed Feb 27 19:39:56 CET 2002:<I> <JDBC Pool> Connection for pool "ewDBConnectionPool"
    created.
    Wed Feb 27 19:39:58 CET 2002:<I> <JDBC Pool> Connection for pool "ewDBConnectionPool"
    created.
    Wed Feb 27 19:39:59 CET 2002:<I> <JDBC Pool> Connection for pool "ewDBConnectionPool"
    created.
    Wed Feb 27 19:40:00 CET 2002:<I> <JDBC Pool> Connection for pool "ewDBConnectionPool"
    created.
    Wed Feb 27 19:40:01 CET 2002:<I> <JDBC Pool> Connection for pool "ewDBConnectionPool"
    created.
    Wed Feb 27 19:40:02 CET 2002:<I> <JDBC Pool> Connection for pool "ewDBConnectionPool"
    created.
    Wed Feb 27 19:40:03 CET 2002:<I> <JDBC Pool> Connection for pool "ewDBConnectionPool"
    created.
    Wed Feb 27 19:51:05 CET 2002:<I> <JDBC Pool> Connection for pool "ewDBConnectionPool"
    created.
    Wed Feb 27 19:51:06 CET 2002:<I> <JDBC Pool> Connection for pool "ewDBConnectionPool"
    created.
    ..and it continues on from there...
    Thanks in advance for any enlightenment.
    Mark

  • Too many open connections from Tomcat to MySQL?

    <?xml version='1.0' encoding='utf-8'?>
    <Context>
    <WatchedResource>WEB-INF/web.xml</WatchedResource>
    <Resource
    name="jdbc/RealmDB" auth="Container" type="javax.sql.DataSource"
    username="root" password="password" driverClassName="com.mysql.jdbc.Driver"
    url="jdbc:mysql://localhost:3306/monk"
    maxActive="-1" maxIdle="5" maxWait="5000"
    removeAbandoned="true" removeAbandonedTimeout="60"
    testWhileIdle="true" timeBetweenEvictionRunsMillis="180000"/>
    <Realm
    className="org.apache.catalina.realm.DataSourceRealm"
    dataSourceName="jdbc/RealmDB" localDataSource="true"
    digest="MD5"
    userTable="user" userNameCol="user_name" userCredCol="password"
    userRoleTable="tcrole" roleNameCol="role_name" />
    </Context>
    Is there a way in here to auto close inactive connections after say 10 seconds? Is that the removeAbandonedTimeout or the Eviction section? Would this be better off posted on the tomcat user listing?
    Edited by: TheWhiteKnight on Oct 29, 2009 8:00 PM

    Actually BalusC, I like this. This seems to define the entire cycle quite nicely and CLEAN. This will be very helpful when phase II rolls out. Right now I need to just patch the thing and get it running "well".
    I've also had to implement some new methods to clean up some of the junk that is left open. I have found RS's that are closed, but no corresponding connection / statement's are being closed. So when I have a return statement like:
    return ConnectionPool.getConnection().createStatement().executeQuery(sqlStatement);
    {code]
    that is called from the presentation layer, logically (to me) the only place to close the connection / statement associated with that RS is in the presentation layer.  As of right now.  This will change on phase II.  If I am wrong please correct me in this.
    Something that is happening now though since I have started explicitly closing the connections and statements.  It seems that my ConnectionPool is running out of connections. I can increase the size of the pool, but it worked just fine before with the amount of connections I have set.  When I call .close() on the connection, does that "recycle" the connection back to the pool?  I know there has to be resources bleeding someplace, however, this has only started happening (more often) since I have been closing things where I find them.
    Any ideas on this?
    Also will converting the basic generic queries to stored procedures help in the performance?  I know that I'll still have to have a connection, but if I can have less java coded sql statements and more SP's would that help in efficiency between MySQL and Tomcat?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • OAS 10.1 3.1 0 OC4J JDBC Connection/Timeout settings

    I am fairly new to OAS, and am trying to resolve a intermitent issue,
    I have an OAS 10.1.3.1.0 with a deployed EAR file I was provided by a supplier containing mainly PL/SQL based logic, which configured the OAS to ask a middle tier for a an external to pass data to it via Stored Procedure and then usiing the deployed package connect to an external Oracle DB and insert the data.
    Oas is running on a Windows 2003 platform that has no problems or connectivity problems, how ever intermittenlt the OAS stops uploading data to the external Oracle DB. Some custom external logging details this as a communication at the time it occurs, how ever there are no comms issues. A quick restart of the OAS windows service resolves the issue.
    Apart from upgrading OAS to patch set 5, the only other thing I considered could be causing the issue is how OAS is handling the session timeout or connection pool.
    I can see the following settings for the JDBC connection I am using, I wondered if anyone could advise anything that could be changed? I am not sure the implications on setting the validate connection to True and also not sure why maximum number of connections is set to -1?
    Connections
    Initial size of Connection Cache
    Minimum Number of Connections
    Maximum Number of Connections
    Connection Retry Interval (seconds)
    Maximum Connection Attempts
    Maximum Number of Statements Cached
    Lower Threshold Limit On Pool (%)
    Defaults to 20% of max connections.
    Validate Connection FalseTrue
    Timeouts
    Inactivity Timeout (seconds)
    Time that an unused connection is inactive before it is removed from the pool.
    Wait For Used Connection Timeout (seconds)
    Maximum time to wait for a used connection to be released.
    Max Active Time for a Used Connection (seconds)
    Maximum time a used connection may be active.
    Abandoned Connection Timeout (seconds)
    Enforce Timeout Limits Interval (seconds)
    Any help would be appreciated

    Hi,
    Along with Priya's suggestions, please refer the link below for the details on the parameters.
    http://download.oracle.com/docs/cd/B32110_01/web.1013/b28958/datasrc.htm#CHDCFCHB
    Hope this will help understand all the parameters.
    Also refer,
    What Should Be My Maximum Connection Pool Size? [ID 1061155.1]
    http://www.oracle.com/technology/tech/java/sqlj_jdbc/htdocs/jdbc_faq.html
    Regards,
    Mithun

  • How does weblogic maintain idle JDBC connection

    I see weblogic maintaining connections even when they are idle. (unless we explicity mention to remove)
    How does weblogic maintain the socket on DB under idle condition? Does webogic do ping kind of activity to maintain/renew the socket for all idle connections in the pool.

    The test-frequency-seconds property specifies the number of seconds between tests of unused connections. WebLogic Server tests unused connection and reopens any faulty connections. You must also set the Test Table Name.
    The seconds-to-trust-an-idle-pool-connection property specifies the number of seconds within a connection use that WebLogic Server trusts that the connection is still viable and will skip the connection test during the periodic connection testing process.

  • OC4J connection polling don't work

    Application Server version is Oracle Enterprise Manager 10g Application Server Control 9.0.4.0.0
    Operating System is Sun Solaris 9
    data-source.xml configuration file is
    <?xml version = '1.0' standalone = 'yes'?>
    <!DOCTYPE data-sources PUBLIC "Orion data-sources" "http://xmlns.oracle.com/ias/dtds/data-sources-9_04.dtd">
    <data-sources>
    <data-source location="jdbc/pool/JCheckSuiteDS"
    class="oracle.jdbc.pool.OracleConnectionCacheImpl"
    password="ckmgr"
    connection-driver="oracle.jdbc.driver.OracleDriver"
    username="ckmgr"
    url="jdbc:oracle:thin:@localhost:1521:JHECK"
    inactivity-timeout="30"
    name="JCheckSuiteDS"
    min-connections="1"
    max-connections="10">
         <property name="cacheScheme" value="1"/>
    </data-source>
    </data-sources>
    connection pooling don't work !!!
    thanks for help
    Aldo

    Hi Steve,
    I solved the problem,
    Reading the article
    http://www.oracle.com/technology/products/jdev/tips/muench/ampooling/index.html
    I tried to check the 'Disconnect Application Module Upon Release' in the configuration panel of an ApplicationModule who sets the parameter "jbo.doconnectionpooling=true" in bc4j.xcfg,
    Now the Application does not open one connection for every ApplicationModule and for every Http Session,
    but only one for every simultaneous request, having a total number of connections small.
    Despite of this, I had to restore original configuration parameters in bc4j.xcfg,
    because using this approach there where problems with View Objects that I assumes as pre-filter in some pages
    and that now seems to be 'clear' (I.E. wrong paging or 'Not all variables bound' error on parametrized query..)
    Thanks anyway...
    Aldo

  • Java Connection Pooling

    I want to know what is the procedure of getting oracle's jdbc connection pooling api(class files and java doc).
    I also want to know whether it is free or not

    ftp://javaexchange.com/javaexchange/DbConnectionBroker1.0.13.tar
    from http://javaexchange.com/ by Mark Mnich
    Initialise the pool in a startupservlet, place a reference to it in the servlet context (ServletContext.setAttribute(String name, Object myDbPool))
    This one is really easy to use and very efficient indeed (endorsed by author David Harms).
    It doesn't support multiple databases.
    Maybe two pools would be just as effective? The whole point of a connection pool is that the connections within it are constantly open... so you would still have (for example) 25 connections to one database and 25 to the other - constantly. Making unused connections disconnect and connect to the other database would defeat the point, each servlet instance may as well establish its own connection So why not have two pools???
    Bamkin

Maybe you are looking for

  • Upgraded to 10.8.3 on Mac mini and things have gone wrong

    Ok I am using a late 2009 mac mini 4 gig computer and been on Mountain Lion 10.8.2 for some time with nothing going wrong with my computer at all. I decided to update to the new 10.8.3 and have left it a few days but nothing is resolving. Things have

  • Can't open PSE 7

    I can't open photoshop elements, I keep getting the following error messages: Adobe Photoshop Elements(Editor) has stop working And then it says: A problem caused the program to stop working correctly. Windows will close the program and notify you if

  • Read keywords from file but not develop settings?

    Is there any way to read IPTC Core metadata, but not develop settings, from a file? I'm still figuring out my Lightroom workflow and made some errors that I'd like to recover from. Here's the situation: In Lightroom 2.x I selected images, gave them s

  • Magic Bullet Instant HD Advance Is Tanking forever to render

    Don't know if it normally takes this long to render in Adobe After Effects CS4. I have a 64-bit sytem and I hardly got anything on my pc just a few music and music videos so its probably not the computer. I must of done somthig wrong.Heres what I did

  • HT4972 How to back up ipad

    I have an ipad2 and don't know how to access the cloud nor update my operating system. There is no software update in my general settings. how do I back up my iPad ?