RFC_FAILURE affects Connection Pool

Using VB.NET (2003) with .Net Connector 2.0.
An intermittent problem causes a RFC Call to fail, and an exception is raised in the .NET code. The Exception message is:
     See RFC trace file or SAP system log for more details
The Trace file shows:
ERROR file opened at 20051115 131423 GMT Standard
     T, SAP-REL 640,0,78 RFC-VER 3 759904 MT-SL
<b>T:2844 Could not send rfc container 0x130
T:2844 <* RfcCall [1] : returns 1:RFC_FAILURE
T:2844 <* RfcCallReceive [1] : returns 1:RFC_FAILURE
>TS> Tue Nov 15 13:14:24 2005
T:2844 <* RfcCleanupContext [1] : returns
          18:RFC_INVALID_HANDLE
T:2844 <* RfcCleanupContext [1] : returns
          18:RFC_INVALID_HANDLE</b>
This error adversely affects the Connection Pool – as calls to other RFCs are now prone to similar intermittent errors…
Is there any way to prevent the problem causing problems with Connection Pool ?
Is there any way of removing a “faulty” connection from the pool ? (NB Close and Dispose on the connection does not help)

The application is a Windows service - so I don't want to lose any connections. I assume that closing the connection (and not returning it) will affect the number of available connections in the pool(?).
I'm using async. RFC call, and the problem is detected in the callback function when the EndRFCCall is performed.
Original code:
Public Sub Execute_RFC(ByVal parameters as string())
' Assign SAP Connection to RFC Proxy
sapRFCProxy.Connection = SAPConnectionPool.GetConnectionFromPool(<i>ConnectString</i>)
Call the SAP RFC - Asynchronously
arAsyncResult = m_sapRFCProxy.BeginRFCCall( params..., AddressOf RFC_CallBack, objAsyncState)
End Sub
Private Sub RFC_CallBack(ByVal ar As IAsyncResult)
Try
    ' Retrieve the SAP RFC Response...
    Call sapRFCProxy.EndRFCCall(ar, <i>param1, param2, etc...</i>)
Catch ex As Exception
    ' Log the Error...
End Try
' Return the Connection
Call SAPConnections.ReturnConnection(sapRFCProxy.Connection)
End Sub
I have changed the code as suggest so that the connection is closed, disposed but <u>not</u> returned. This cleared the RFC_INVALID_HANDLE errors, but the main problem of a corrupted connection persists.
Diagnostics produced by the amended code:
<u>Trace File (Info):</u>
2005-11-16 11:55:46Z     Warning: RfcCleanupContext failed. Closing connection
<u>dev_RFC.trc</u>
ERROR file opened at 20051116 115546 GMT Standard T, SAP-REL 640,0,78 RFC-VER 3 759904 MT-SL
T:3068 ======> CPIC-CALL: 'CMSEND'
ERROR       program state check for conversation 99610798
TIME        Wed Nov 16 11:55:46 2005
RELEASE     640
COMPONENT   CPIC (TCP/IP)
VERSION     3
RC          471
MODULE      r3cpic.c
LINE        2576
DETAIL      called function STSEND in state state=BUFFER_DATA2
COUNTER     1
T:3068 <* RfcCall [20] : returns 1:RFC_FAILURE
T:3068 <* RfcCallReceive [20] : returns 1:RFC_FAILURE
T:3068 <* RfcCleanupContext [20] : returns 1:RFC_FAILURE
Even with the change to the code, a call to a reliable RFC will now fail <u>intermittently</u> with:
T:2876 Could not send rfc container 0x130
T:2876 <* RfcCall [24] : returns 1:RFC_FAILURE
T:2876 <* RfcCallReceive [24] : returns 1:RFC_FAILURE
Thanks

Similar Messages

  • Replace Quotes, Connection Pooling, and Sun Web Server with MySQL, Oracle

    This is code I use to insert data into my MySQL and Oracle databases.
    I takes care of quotes and shows use of context, i.e. when you use Sun Web Server's
    ConnectionPooling. This code works. Feel free to reply if you have questions on how to set up connection pooling using Sun Web Server 6.1SP - it took quite a long time to learn and I couldn't find much information throughout the web, so I hope this helps...
    This is not a question and I am not looking for an answer, but please post comments or suggestions.
    dailysun
    This is in one class where I have a hashtable containing the
    column name / value pairs that I want to enter into my table.
    This class simply creates the SQL string from the values in the
    hashtable. It then passes that hashtable including the database
    name to a class which executes that sql statement (second code
    portion).
    /* Insert data into sf_parts. Create the column strings from
             * the provided hash table. Be sure to parse out hash elements which
             * are used for the createTemplate process
            StringBuffer values = new StringBuffer();
            StringBuffer fields = new StringBuffer();
            Enumeration keys = fieldHash.keys();
            while(keys.hasMoreElements()){
                Object currentKey = keys.nextElement();
                    String fieldValue = (String) fieldHash.get(currentKey);
                    if(values.length() >0){
                        values.append(",");
                    values.append("'"+fieldValue.replaceAll("'","''")+"'"); // Takes care of quotes and various other special characters!
                    if(fields.length() >0){
                        fields.append(",");
                    fields.append(currentKey);
            sql = "INSERT INTO myTable (" + fields.toString() + ") VALUES (" + values.toString() + ");";
            String insertResult = caq.getInsertDelete(sql,"myDatabaseName"); // your database name is defined in web.xml and sun-web.xml when you use Sun Web Server's Connection Pooling.
            returnValue += "<br><br><b>Rows inserted into table(myTable): </b>" + insertResult + "<br>\n";
            And, like I describe above, this method executes the sql statement.
         * Takes care of insert, update and delete requests.
         * Must have set both dbName as well as the sql String.
         * Will return number of rows affected as String.
         * @return String Number of rows affected
         * @exception SQLException
         * @exception Exception
        public String getInsertDelete() {
            checkData(); // this simply checks if the variables dbName and sql are not empty ;-)
            InitialContext initContext = null;
            int rv = 0;
            try{
                // Get connection from configured pool
                initContext = new InitialContext();
                source = (DataSource) initContext.lookup("java:comp/env/jdbc/" + dbName); // I have this set up in web.xml and sun-web.xml (I use Sun Web Server 6.1SP which does connection pooling for me)
                conn = source.getConnection();
                if(conn != null){
                    stmt = conn.createStatement();
                    rv = stmt.executeUpdate(sql);
            }catch (SQLException e){
                // do something
            }catch (Exception e){
                // do something
            }finally{
                try{
                    stmt.close();
                }catch(Exception e){
                    // do something
                try{
                    conn.close();
                }catch(Exception e){
                    // do something
                try{
                    initContext.close();
                }catch(Exception e){
                    // do something
            return rv+"";
        }  

    This is code I use to insert data into my MySQL and
    Oracle databases.
    I takes care of quotes and shows use of context, i.e.
    when you use Sun Web Server's
    ConnectionPooling. This code works. Feel free to
    reply if you have questions on how to set up
    connection pooling using Sun Web Server 6.1SP - it
    took quite a long time to learn and I couldn't find
    much information throughout the web, so I hope this
    helps...
    This is not a question and I am not looking for an
    answer, but please post comments or suggestions.Using prepared statements would mean that you wouldn't have to worry about quotes.
    You should be closing the result set.
    You are handling all fields as strings. That won't work with time fields and might not work for numeric fields.
    Presumably most of your variables are member variables. They should be local variables because that is the scope of the usage.
    You must do something with the exceptions.
    Hashtables although convienent mean that problems with usage can only be resolved at run time rather than compile time.

  • Connection Pooling Questions

    Hi there,
    I was previously using the jferner/node-oracle module with the "generic-pool" (https://github.com/coopernurse/node-pool) module for connection pooling. 
    I'm trying out a setup with connection pooling with node-oracledb and have a few questions:
    * If an execute call fails with a connection i've retrieved from the pool, and I want to destroy that connection and remove it from the pool, how do I do that?  Is it done implicitly for me? 
    * Is there any way to validate a connection before it's used?  Or again, is this done implicitly?  Is there a way to toggle it on and off for perf tuning?
    * Is there any way to tune how frequently Oracle checks for idle connections?  (In generic-pool this was called reapIntervalMillis)
    * Is there any way to turn on any logging of how the connection pool behaves for development debugging?  I just want to make sure my setup is behaving as I think it should be.
    I'm making some good headway on getting the module working and it wasn't too difficult a conversion from node-oracle, either, that's good!
    -Matt

    You should release() bad connections to the pool so the pool can replace them.
    Validating connections is generally not worth it: between validation & use there could be a failure, so your executions need to handle errors anyway.  Why reduce scalability and performance by doing an extra "round trip" for validation? Also you can use FAN which can proactively clean up idle sessions in the session pool that are affected by the DB instance disappearing (due to network glitches etc).
    The client-side pool is handled by Oracle session pooling, so the algorithms are opaque.

  • How to use connection pool of datasource to make applications run faster?

    Hi, erveryone
    I prepare to implement a servlet that access database and do sync with client.
    When I access database, I would like to configure a datasource in weblogic and use connection pool.
    In order to make servlet application run significantly faster, my servet how to use connection poo is much moreresonable?
    For example, my servlet has many times database access. Is it true that geting and close a connection whenever
    one time database access finished?
    If from the servlet begins, the db connection is hold till servlet finalize. Will the solution affect the servlet performance? Is there any official document to introduce connection pool program? I search some documents.
    <The Java EE 6Tutorial> introduce some simple intruduction about connection pool.

    1. Use WebLogic Servers Data Source for Database Connections.
    2. Open and close the connections where you need it. Dont open it in begin and close in finalise. That is bad practice.
    3. Even when you invoke Connection.close () webLogic will not close the connection. it will commit the transaction and return it back to the pool rather than physically closing the DB connection.
    4. You can tune data source for minimum, maximum and increments of connections that you need based on your application requirement.

  • KIMYONG : Applications Database Connection Pool 관련 parameter 설명

    Purpose
    JVM 이 과도한 CPU / Memory를 사용하게 되어 Application Performance에 영향을 미칠때가 있으며 이럴경우 Connection Pool 관련하여 Parameter Tunning을 해야 할때가 있습니다. 이때 사용되는 Parameter들의 의미를 설명하고자 합니다.
    The Applications Database Connection Pool is a pool of JDBC database connections that are shared among java applications. Applications obtain connections from the pool by using the getJDBCConnection(...) methods of AppsContext.
    Essentially, each AppsContext has a single database connection associated with it at all times.
    The AOL/J layer internally borrows and returns this connection to the pool as needed to maintain connection reference that is properly initialized for the current Java tier AOL security context and NLS state.
    FND_MAX_JDBC_CONNECTIONS
    ============================
    The maximum pool size is the maximum allowed sum of the number of available connections and thenumber of locked connections. If the pool reaches the maximum size and all connections are locked, new clients will not be able to borrow a connection until one of the current clients has returned one. The default setting for this parameter is essentially unlimited (about 2 billion).
    FND_JDBC_BUFFER_MIN
    ======================
    The buffer minimum is the minimum number of connections that the pool should try to maintain in the available list. When the buffer size falls below the buffer minimum, the pool maintenance thread will be notified to create new connections. When notified, the thread will immediately attempt to create the number of connections to fill the difference. New connections will not be created if the pool is already at its maximum size. When creating new connections the thread uses the attributes of the most recent client request that resulted in a new connection being created.
    Setting this parameter to "0" will disable maintenance of the buffer minimum.
    However, the buffer maximum will still be maintained.
    Setting this parameter to a number greater than the maximum pool size(FND_MAX_JDBC_CONNECTIONS) will disable all buffer maintenance.
    FND_JDBC_BUFFER_MAX
    ======================
    The buffer maximum is the maximum number of connections that the pool should try to maintain in the available list. During heavy usage, the buffer may exceed this maximum. However, during periods of low usage, the maintenance thread will decrease the buffer size until the buffer maximum is reached.
    If the value of this parameter is an integer, (for example "20") the buffer maximum is static. If the value is a percent (for example, "20%"), the buffer maximum is not constant but instead is calculated dynamically as a percent of total pool size. The buffer minimum is also taken into account when
    determining a dynamic buffer maximum.
    The exact expression used is:
    maximum(t) = buffer minimum + ( (FND_JDBC_BUFFER_MAX/100) * size(t) )
    where maximum(t) and size(t) are the buffer maximum and pool size at some time t.
    The thread is configured to periodically check the buffer size. If the buffer size is greater than the maximum, the thread will remove either the number of available connections specified by FND_JDBC_BUFFER_DECAY_SIZE or the number of connections in excess of the buffer minimum, whichever is smaller. When connections are removed from the available list, the least recently used ones are removed first.
    Setting this parameter to100%, or to a number equal to FND_MAXIMUM_JDBC_CONNECTIONS, or to a number less than or equal to FND_JDBC_BUFFER_MIN will effectively prevent the maintenance thread from ever removing any connections.
    FND_JDBC_BUFFER_DECAY_INTERVAL
    ===================================
    The buffer decay interval specifies how often the connection pool maintenance thread should check the buffer size. The thread will check the buffer size at most once every FND_JDBC_BUFFER_DECAY_INTERVAL seconds. The actual time between consecutive thread cycles will vary somewhat depending on the JVM load.
    This parameter, along with FND_JDBC_BUFFER_DECAY_SIZE, allows the buffer decay rate to be tuned. For example, if the buffer decay size is 2 and the buffer decay interval is one minute, the buffer decay rate will never exceed two connections per minute. When connections are removed, the least recently used ones are removed first.
    FND_JDBC_BUFFER_DECAY_SIZE
    =============================
    The buffer decay size specifies the maximum number of connections that should be removed during any single thread cycle during which the number of available connections is greater than the buffer size. This parameter, along with FND_JDBC_BUFFER_DECAY_INTERVAL, allows the buffer decay rate to be tuned.
    FND_JDBC_MAX_WAIT_TIME
    =========================
    The maximum wait time specifies how much time a client should spend trying to get a connection. The borrow algorithm, used to borrow an object from the pool, contains check points at which the elapsed time is compared to the maximum wait time. If it exceeds the maximum wait time, then a null object will be returned to the client. The pre-configured value for the maximum wait time is
    10 seconds.
    FND_JDBC_SELECTION_POLICY
    ============================
    The selection policy determines how a connection is selected from the list of available connections for a particular client. The connection pool is pre-configured to use a cost-based selection algorithm, which selects the connection that will require the smallest amount of initialization to match the
    client's context.
    FND_JDBC_USABLE_CHECK
    ===========================
    The FND_JDBC_USABLE_CHECK parameter governs whether a pl/sql query is performed before giving a connection to a client. The pool checks whether a connection is usable before handing it to a client. This always involves checking that the connection is not null and is not closed. If FND_JDBC_USABLE_CHECK is set to true, then it also verifies that the connection can be used to perform a simple PL/SQL query. (This parameter may have to be set to "true" in order to clean up
    connections to a database that has been restarted.)
    FND_JDBC_CONTEXT_CHECK
    ==========================
    The FND_JDBC_CONTEXT_CHECK parameter governs whether the AOL security context and NLS state is obtained from the database when the connection is returned to the pool. If FND_JDBC_CONTEXT_CHECK is "true", when the connection is returned to the pool, the AOL security context and NLS state will be obtained from the database. (This is implemented in the DBConnObj.isReusable() method). This check must be done when the connection is returned (rather than when it is borrowed) so that the selection matching algorithm has access to the actual
    session context of the connections in the available list.
    FND_JDBC_PLSQL_RESET
    ========================
    The PL/SQL reset flag, set using the variable FND_JDBC_PLSQL_RESET, governs whether the PL/SQL state associated with a connection should be freed before the pool hands the connection to the client. By default this flag is false.
    If the flag is set by true, by including the line "FND_JDBC_PLSQL_RESET=true" in the .dbc file, each connection to the database will have its PL/SQL state cleared before the pool returns the connection to the client.
    This is how it works. After the pool selects a connection from the available list for a client, it initializes the connection. One of the things initialization does is to set a flag that is later used by SessionManager to determine if the apps initialization routine needs to be performed for the connection. When FND_JDBC_PLSQL_RESET has been set to "true", this flag will always be set to true. After the pool initializes the connection, it also checks whether the connection is usable. In this case, this check will include a call to DBMS_SESSION.RESET_PACKAGE, which frees the PL/SQL state. The table below summaries the affect of FND_JDBC_PLSQL_RESET and the other safety check parameters on borrowing a connection from the pool.
    The FND_JDBC_PLSQL_RESET parameter has been added to only to address the case where production PL/SQL global bugs are known to exist. The performance of the pool is reduced by setting this flag to true.
    Reference : Note 264599.1

    Purpose
    JVM 이 과도한 CPU / Memory를 사용하게 되어 Application Performance에 영향을 미칠때가 있으며 이럴경우 Connection Pool 관련하여 Parameter Tunning을 해야 할때가 있습니다. 이때 사용되는 Parameter들의 의미를 설명하고자 합니다.
    The Applications Database Connection Pool is a pool of JDBC database connections that are shared among java applications. Applications obtain connections from the pool by using the getJDBCConnection(...) methods of AppsContext.
    Essentially, each AppsContext has a single database connection associated with it at all times.
    The AOL/J layer internally borrows and returns this connection to the pool as needed to maintain connection reference that is properly initialized for the current Java tier AOL security context and NLS state.
    FND_MAX_JDBC_CONNECTIONS
    ============================
    The maximum pool size is the maximum allowed sum of the number of available connections and thenumber of locked connections. If the pool reaches the maximum size and all connections are locked, new clients will not be able to borrow a connection until one of the current clients has returned one. The default setting for this parameter is essentially unlimited (about 2 billion).
    FND_JDBC_BUFFER_MIN
    ======================
    The buffer minimum is the minimum number of connections that the pool should try to maintain in the available list. When the buffer size falls below the buffer minimum, the pool maintenance thread will be notified to create new connections. When notified, the thread will immediately attempt to create the number of connections to fill the difference. New connections will not be created if the pool is already at its maximum size. When creating new connections the thread uses the attributes of the most recent client request that resulted in a new connection being created.
    Setting this parameter to "0" will disable maintenance of the buffer minimum.
    However, the buffer maximum will still be maintained.
    Setting this parameter to a number greater than the maximum pool size(FND_MAX_JDBC_CONNECTIONS) will disable all buffer maintenance.
    FND_JDBC_BUFFER_MAX
    ======================
    The buffer maximum is the maximum number of connections that the pool should try to maintain in the available list. During heavy usage, the buffer may exceed this maximum. However, during periods of low usage, the maintenance thread will decrease the buffer size until the buffer maximum is reached.
    If the value of this parameter is an integer, (for example "20") the buffer maximum is static. If the value is a percent (for example, "20%"), the buffer maximum is not constant but instead is calculated dynamically as a percent of total pool size. The buffer minimum is also taken into account when
    determining a dynamic buffer maximum.
    The exact expression used is:
    maximum(t) = buffer minimum + ( (FND_JDBC_BUFFER_MAX/100) * size(t) )
    where maximum(t) and size(t) are the buffer maximum and pool size at some time t.
    The thread is configured to periodically check the buffer size. If the buffer size is greater than the maximum, the thread will remove either the number of available connections specified by FND_JDBC_BUFFER_DECAY_SIZE or the number of connections in excess of the buffer minimum, whichever is smaller. When connections are removed from the available list, the least recently used ones are removed first.
    Setting this parameter to100%, or to a number equal to FND_MAXIMUM_JDBC_CONNECTIONS, or to a number less than or equal to FND_JDBC_BUFFER_MIN will effectively prevent the maintenance thread from ever removing any connections.
    FND_JDBC_BUFFER_DECAY_INTERVAL
    ===================================
    The buffer decay interval specifies how often the connection pool maintenance thread should check the buffer size. The thread will check the buffer size at most once every FND_JDBC_BUFFER_DECAY_INTERVAL seconds. The actual time between consecutive thread cycles will vary somewhat depending on the JVM load.
    This parameter, along with FND_JDBC_BUFFER_DECAY_SIZE, allows the buffer decay rate to be tuned. For example, if the buffer decay size is 2 and the buffer decay interval is one minute, the buffer decay rate will never exceed two connections per minute. When connections are removed, the least recently used ones are removed first.
    FND_JDBC_BUFFER_DECAY_SIZE
    =============================
    The buffer decay size specifies the maximum number of connections that should be removed during any single thread cycle during which the number of available connections is greater than the buffer size. This parameter, along with FND_JDBC_BUFFER_DECAY_INTERVAL, allows the buffer decay rate to be tuned.
    FND_JDBC_MAX_WAIT_TIME
    =========================
    The maximum wait time specifies how much time a client should spend trying to get a connection. The borrow algorithm, used to borrow an object from the pool, contains check points at which the elapsed time is compared to the maximum wait time. If it exceeds the maximum wait time, then a null object will be returned to the client. The pre-configured value for the maximum wait time is
    10 seconds.
    FND_JDBC_SELECTION_POLICY
    ============================
    The selection policy determines how a connection is selected from the list of available connections for a particular client. The connection pool is pre-configured to use a cost-based selection algorithm, which selects the connection that will require the smallest amount of initialization to match the
    client's context.
    FND_JDBC_USABLE_CHECK
    ===========================
    The FND_JDBC_USABLE_CHECK parameter governs whether a pl/sql query is performed before giving a connection to a client. The pool checks whether a connection is usable before handing it to a client. This always involves checking that the connection is not null and is not closed. If FND_JDBC_USABLE_CHECK is set to true, then it also verifies that the connection can be used to perform a simple PL/SQL query. (This parameter may have to be set to "true" in order to clean up
    connections to a database that has been restarted.)
    FND_JDBC_CONTEXT_CHECK
    ==========================
    The FND_JDBC_CONTEXT_CHECK parameter governs whether the AOL security context and NLS state is obtained from the database when the connection is returned to the pool. If FND_JDBC_CONTEXT_CHECK is "true", when the connection is returned to the pool, the AOL security context and NLS state will be obtained from the database. (This is implemented in the DBConnObj.isReusable() method). This check must be done when the connection is returned (rather than when it is borrowed) so that the selection matching algorithm has access to the actual
    session context of the connections in the available list.
    FND_JDBC_PLSQL_RESET
    ========================
    The PL/SQL reset flag, set using the variable FND_JDBC_PLSQL_RESET, governs whether the PL/SQL state associated with a connection should be freed before the pool hands the connection to the client. By default this flag is false.
    If the flag is set by true, by including the line "FND_JDBC_PLSQL_RESET=true" in the .dbc file, each connection to the database will have its PL/SQL state cleared before the pool returns the connection to the client.
    This is how it works. After the pool selects a connection from the available list for a client, it initializes the connection. One of the things initialization does is to set a flag that is later used by SessionManager to determine if the apps initialization routine needs to be performed for the connection. When FND_JDBC_PLSQL_RESET has been set to "true", this flag will always be set to true. After the pool initializes the connection, it also checks whether the connection is usable. In this case, this check will include a call to DBMS_SESSION.RESET_PACKAGE, which frees the PL/SQL state. The table below summaries the affect of FND_JDBC_PLSQL_RESET and the other safety check parameters on borrowing a connection from the pool.
    The FND_JDBC_PLSQL_RESET parameter has been added to only to address the case where production PL/SQL global bugs are known to exist. The performance of the pool is reduced by setting this flag to true.
    Reference : Note 264599.1

  • ORA-22990 ( Cannot span lob... ) while using connection pooling...

    Hi all, I am maintaining a web site that has lots of requests ( about 10 requests a second ) to an Oracle table that has a BLOB field. Those requests create new blobs, updates them and reads them... My program worked fine until I started using connection pooling ( Before that, I used a single connection that was initialized at startup ). Although I had to synchronized the methods that interact with blob field, everything worked great. So now, to optimize my site, I want to use connection pooling so that even if my methods are synchonized on the connection object, there will be more than one connection available so it will not affect performance.
    So once I introduced my connection pooling system with the oracle.jdbc.pool.OracleConnectionCacheImpl class, I started getting ORA-22990 ( Cannot span lob objects... ). I get the error on the flush() method when I try to write the blob to the database. Here is my function that writes a row in the databse.
      private synchronized void writeSession(CapSession pSession) throws Exception
            javax.sql.PooledConnection pc = pool.getPooledConnection();
            Connection conn = pc.getConnection();
            CallableStatement stmt=conn.prepareCall(writeObjSQL);
            stmt.setString(1,pSession.getSessionId()+pSession.getPassword());
            stmt.setLong(2,pSession.getLastAccess());
            stmt.setLong(3,pSession.getTimeout());
            stmt.registerOutParameter(4,java.sql.Types.BLOB);
            stmt.executeUpdate();
            oracle.sql.BLOB blob=(BLOB)stmt.getBlob(4);
            OutputStream os=blob.getBinaryOutputStream();
            ObjectOutputStream oop=new ObjectOutputStream(os);
            oop.writeObject(pSession);
            oop.flush();
            oop.close();
            os.close();
            stmt.close();
            conn.commit();
            conn.close();
            pc.close();
      } If anyone could help me, I would deeply appreciate it!
    Thank you for your time.

    kalle
    Thank you very much for your advice!!!
    Like you said, I started to check whether the connections are fine before giving them from the pool.I am executing a simple "select 'anil' from dual" and if its fine only then I return the connection. So far it seems to be fine. Also I am reopening the connections(closing the old ones and opening new connections) after every 12 hours.
    As far as the JDBC driver is concerned, I already tried with Oracle 8i driver, it gave the same problems. I read that 9i driver might solve this problem, so I changed to the latest 9i driver (classes12_g.zip).
    Sometimes before(before I started checking whether the connection is good )the application used to hang up at the point where I am issuing setAutoCommit(false).It never comes out from that statement.Is this something to do with theconnections being closed?
    What I am afraid is, will the appilation get hung up even after I check the connection with select query and then issue autocommit(false)??
    Or will it hang up while I check with a select query??
    As long as it doesn't hung up, I am fine. Because i am cathching the exceptions.
    Thanks In ADVANCE
    Anil

  • Help to Configure Connection Pool For Jdeveloper

    Hi ,
    I am using Jdeveloper 10.1.2 and Oravle AS 10.1.2.
    Language Used : J2EE,Struts and EJB
    I am portletizing struts application.
    I need help to configure Connection pool. By default it is taking a datasource.xml not the one i had defined. Pls help me out. Affecting the performance due to so many hit to db.
    regards,
    Jayashree Jegan

    Hi John,
    Go through this thread of mine. You will get the required information to setup the connection pool.
    SOAP adapter: WSDL issue
    Also just check in Visual Studio Help .NET Connector for Connection Config class settings. You will see all the relevent parameters related with connection pool.
    Regards.

  • Excessive connection latency... Does Adobe Air support connection pooling on mobile?

    Hello,
    I am developing a mobile app which loads thumbnail images from a remote server. During testing on the Android platform, however, I have discovered that images are very slow to load. By monitoring server logs I have determined that the poor performance is caused by the lack of connection pooling, meaning that each request builds a new connection. Running the sample code below on a mobile device produces 20 requests and 20 connection attempts. By comparison, the same web or desktop app creates 2 connections and reuses those connections for subsequent requests. The substantial overhead and latency associated with generating new connections has a substantial affect on performance, with 20 thumbnails taking approximately 4-5 seconds to load on mobile versus 0.5 - 1 second on a desktop.
    I have included a sample app below to emphasis the performance issue. The image itself is very small (290 bytes) to focus the issue on connection latency. I have confirmed this behavior on numerous Android devices, running 4.1, 4.0, and 2.3. I have also attempted using Loader v. URLLoader v. URLStream and sequential v. simultaneous loading with no change in connection behavior. Attempting to set the connection to 'keep-alive' in the URLRequest also has no affect.
    package
              import flash.display.Loader;
              import flash.display.Sprite;
              import flash.display.StageAlign;
              import flash.display.StageScaleMode;
              import flash.events.Event;
              import flash.net.URLRequest;
              import flash.utils.getTimer;
              public class Main extends Sprite
                        private var _count:int = 0;
                        public function Main()
                                  super();
                                  stage.align = StageAlign.TOP_LEFT;
                                  stage.scaleMode = StageScaleMode.NO_SCALE;
                                  trace("Start time " + getTimer() + " ms");
                                  var loader:Loader;
                                  var url:String = "http://fbcdn-profile-a.akamaihd.net/static-ak/rsrc.php/v2/yo/r/UlIqmHJn-SK.gif";  // 290 bytes
                                  for (var i:int = 0; i < 20; i++) {
                                            loader = this.addChild(new Loader()) as Loader;
                                            loader.contentLoaderInfo.addEventListener(Event.COMPLETE, complete);
                                            loader.load(new URLRequest(url));
                        private function complete(event:Event):void
                                  _count++
                                  trace("Finished " + _count + " at " + getTimer() + " ms");
    So, I have a couple questions:
    1) Is there something that I can do to enable connection reuse?
    2) Is this an inherent limitation with Adobe Air for mobile?
    3) Can someone confirm whether this limitation exists on other mobile platforms (iOS or Blackberry)?
    Any help that you can provide would be greatly appreciated. I am really hoping that this isn't a fundamental limitation of Adobe Air as it causes my app to feel very sluggish.
    Thanks,
    Adam

    Hmm. You were absolutely correct, that's a bit disappointing!
    This is Android recompiled for 3.4 rather than 3.1.
    null
    COMPLETED 50 with 8 loaders in 11327 milliseconds or 226.54 per load.   50           8              11327    226.54
    COMPLETED 50 with 50 loaders in 8899 milliseconds or 177.98 per load.   50           50           8899       177.98
    COMPLETED 50 with 50 loaders in 9280 milliseconds or 185.6 per load.     50           50           9280       185.6
    COMPLETED 50 with 50 loaders in 9513 milliseconds or 190.26 per load.   50           50           9513       190.26
    COMPLETED 50 with 8 loaders in 9744 milliseconds or 194.88 per load.     50           8              9744       194.88
    COMPLETED 50 with 1 loaders in 16383 milliseconds or 327.66 per load.   50           1              16383    327.66
    Versus Apple iPad recompiled for 3.4 rather than 3.1.
    null
    COMPLETED 50 with 8 loaders in 502 milliseconds or 10.04 per load. 50      8        502    10.04
    COMPLETED 50 with 50 loaders in 100 milliseconds or 2 per load.     50      50      100    2
    COMPLETED 50 with 50 loaders in 117 milliseconds or 2.34 per load. 50      50      117    2.34
    COMPLETED 50 with 50 loaders in 93 milliseconds or 1.86 per load.  50      50      93      1.86
    COMPLETED 50 with 8 loaders in 270 milliseconds or 5.4 per load.    50      8        270    5.4
    COMPLETED 50 with 8 loaders in 307 milliseconds or 6.14 per load.  50      8        307    6.14
    COMPLETED 50 with 8 loaders in 316 milliseconds or 6.32 per load.  50      8        316    6.32
    COMPLETED 50 with 4 loaders in 555 milliseconds or 11.1 per load.  50      4        555    11.1
    COMPLETED 50 with 4 loaders in 547 milliseconds or 10.94 per load. 50      4        547    10.94
    COMPLETED 50 with 4 loaders in 535 milliseconds or 10.7 per load.  50      4        535    10.7
    COMPLETED 50 with 2 loaders in 1038 milliseconds or 20.76 per load.        50      2        1038          20.76
    COMPLETED 50 with 2 loaders in 1042 milliseconds or 20.84 per load.        50      2        1042          20.84
    COMPLETED 50 with 1 loaders in 2107 milliseconds or 42.14 per load.        50      1        2107          42.14
    COMPLETED 50 with 1 loaders in 2099 milliseconds or 41.98 per load.        50      1        2099          41.98
    Both are on release compile, which should take out all of the variability. So, yes, it looks as if the 3.4 AIR runtime has lost the connection pooling but ONLY for Android.
    PS: Code I used in my test (which was a conventional View based Mobile app) is below in case you want to include it when you submit a bug report.
    <?xml version="1.0" encoding="utf-8"?>
    <s:View xmlns:fx="http://ns.adobe.com/mxml/2009"
      xmlns:s="library://ns.adobe.com/flex/spark" title="TestLLatency" xmlns:mx="library://ns.adobe.com/flex/mx">
    <fx:Script>
      <![CDATA[
       import mx.events.FlexEvent;
       protected function uicomponent1_creationCompleteHandler(event:FlexEvent):void
        startTest();
       public function startTest():void {
        if(queue) throw new Error("Please wait for previous test to end.");
        queue = new Array();
        _count = 0;
        var loader:Loader;
        var i:int;
        for (i = 0; i < numToQueue; i++) {
         loader = bob.addChild(new Loader()) as Loader;
         loader.x = (i%10)*50;
         loader.y = Math.floor(i/5)*50;
         loader.contentLoaderInfo.addEventListener(Event.COMPLETE, complete);
         queue.push(loader);
        startTime = getTimer();
        for(i=0;i<numLoaders;i++) {
         nextQueue();
       protected var startTime:int;
       protected var endTime:int;
       protected var numToQueue:int = 50;
       protected var numLoaders:int = 8;
       protected var queue:Array;
       private var _count:int;
       private function complete(event:Event):void
        _count++
        nextQueue();
       [Bindable] protected var results:String;
       protected function nextQueue():void {
        var url:String = "http://fbcdn-profile-a.akamaihd.net/static-ak/rsrc.php/v2/yo/r/UlIqmHJn-SK.gif";  // 290 bytes
        if(queue && queue.length) {
         var loader:Loader = queue.pop() as Loader;
         loader.load(new URLRequest(url));
        } else if(_count==numToQueue) {
         endTime = getTimer();
         var elapsed:int = endTime-startTime;
         results += "\n"+("COMPLETED "+numToQueue+" with "+numLoaders+" loaders in "+(elapsed)+" milliseconds or "+(elapsed/numToQueue)+" per load.\t"+[numToQueue,numLoaders,elapsed,elapsed/numToQueue].join("\t"));
         queue = null;
         while(bob.numChildren>5) {
          bob.removeChildAt(bob.numChildren-1);
         bob.getChildAt(0).addEventListener(MouseEvent.CLICK,repeatTest);
         bob.getChildAt(1).addEventListener(MouseEvent.CLICK,repeatTest);
         bob.getChildAt(2).addEventListener(MouseEvent.CLICK,repeatTest);
         bob.getChildAt(3).addEventListener(MouseEvent.CLICK,repeatTest);
         bob.getChildAt(4).addEventListener(MouseEvent.CLICK,repeatTest);
       protected function repeatTest(event:MouseEvent):void {
        var dob:DisplayObject = event.target as DisplayObject;
        var testBehaviour:int = dob.parent.getChildIndex(dob);
        try {
         switch(testBehaviour) {
          case 4 :
           this.numLoaders = this.numToQueue;
           break;
          case 3 :
           this.numLoaders = 8;
           break;
          case 2 :
           this.numLoaders = 4;
           break;
          case 1 :
           this.numLoaders = 2;
           break;
          case 0 :
           this.numLoaders = 1;
           break;
         startTest();
         dob.removeEventListener(MouseEvent.CLICK,repeatTest);
         for(var i:int=0;i<5;i++) bob.removeChildAt(0);
        } catch(e:Error) {
         trace(e.message); 
      ]]>
    </fx:Script>
    <fx:Declarations>
      <!-- Place non-visual elements (e.g., services, value objects) here -->
    </fx:Declarations>
    <s:HGroup width="100%" height="100%">
      <mx:UIComponent id="bob" width="100%" height="100%" creationComplete="uicomponent1_creationCompleteHandler(event)" />
      <s:TextArea text="{results}" width="100%" height="100%" />
    </s:HGroup>
    </s:View>

  • DB connection pooling to remote server, pls help!

    Hi guys,
    I really need help with this and I am not exactly the most experienced developer.
    I have a java application which connects to a remote MS SQL server using the connection pooling object model described in Sun docs at:
    http://java.sun.com/developer/onlineTraining/Programming/JDCBook/conpool.html
    I am Using the 'sun.jdbc.odbc.JdbcOdbcDriver' driver.
    In the client class (DAO) in a      static {  try{} } block I create the JDCConnectionDriver and JDCConnectionPool. Then in the constructor of this class I instantiate the connection object, which I use through out the class.
    This class is instantiated multiple times in the lifetime of the application( thus the static block for the connection pool).
    It all works great if the SQL server is on the same machine. But as soon as I change the ODBC connection to a remote server, my application does not seem to release the connections. After several hundred instantiations of the client DAO class there are so many ports taken (live connections) on my server that it affects other applications.
    Does the garbage collector fail or does it fail when it works with the MS ODBC driver with remote connection?
    I debuged and debuged both with local sql and remote -- the workflow seems the same.
    Has anybody out there faced the same problem? What am I doing wrong? How can I resolve this?
    You help is greatly appriciated!
    Stan

    I am using the datasource very heavely, but I am sure
    the closing/releasing is ok. If the sql server is on
    the same machine, it all works flawlessly. Only when
    sql is remote I see unclosed connections, which pile
    up as I am creating more and more.
    Any suggestion?Your description seems to indicate that you are not actually closing the connections by calling the close() method. Make sure that you close the connection when the task at hand is finished. Closing only makes the connection in the pool available again.
    Also, if you are using datasource heavily, you should be attempting to minimize the lookups. JNDI lookups are relatively slow.

  • Avoiding duplication of Physical Database / Connection Pool during merge

    Is there a way to avoid duplication of physical database during merge (I get something like DB_CONNECTION#1 in addition to my DB_CONNECTION)? Functionality doesn't seem to be affected - but I really don't want to branch into different DBs if the objects are in the same DB.
    I've tried various combination of merge, using this technique http://oraclebizint.wordpress.com/2008/03/24/oracle-bi-ee-101332-merging-repositories-substitute-for-import-from-repository-2-way-merge-with-no-parent-part-2/
    My situation is very basic - merging several additional business models.
    Also, after the merge I have 3 other problems:
    a) all time dimensions loose their chronological keys (easy fix - just tedious)
    b) duplication of security groups and users (with the same #1) - that's also an easy fix - just delete all groups/users from a newer RPD
    Could anyone tell me whether those are 'normal' problems
    Thanks
    Bump!

    When merging repositories, OBIEE compares the original repository with the modified repository and merges into the Current.
    If any object in the modified repository is names identical to the an object in the Current repository, it renames them to #1.
    For your specific case, the connection pool that is being renamed to ..#1, did you check it out from the MUD repository OR did you delete and recreate it ?

  • Connection pool / db failure

    WLS6.0 sp2 / Win2k
    Oracle 8.1.7 / Solaris 8
    problem is if DB fails, the connection pool fails, and will not restart. If I run a java weblogic.Admin EXISTS_POOL command, it says the pool doesnt exist.
    If i run a RESET_POOL, using the system user password, it comes back with:
    Exception in thread "main" javax.naming.AuthenticationException. Root exception is java.lang.Securi
    tyException: Authentication for user guest denied in realm weblogic
    <<no stack trace available>>
    I have test on reserved set (and dual as the table).
    Anyone shed any light on what could be going wrong, because right now, every time the DB fails, we have to restart the **&$"&^ server.... (and that takes around 20mins for all the apps to init)
    tks
    will

    Hi Will,
    When you bring up the server, if the database is down, your connection pools
    will not come up if you have an initial capacity greater than 0. This is a
    known issue and the workaround for this is to set the initial capacity to
    zero so the pool comes up even when the database is down, then make sure you
    set the capacity increment to the value that you like your initial capacity
    to be and have the TestConnectionOnReserve to true.
    hth
    sree
    "Will" <[email protected]> wrote in message
    news:3d13111f$[email protected]..
    WLS6.0 sp2 / Win2k
    Oracle 8.1.7 / Solaris 8
    problem is if DB fails, the connection pool fails, and will not restart.If I run a java weblogic.Admin EXISTS_POOL command, it says the pool doesnt
    exist.
    If i run a RESET_POOL, using the system user password, it comes back with:
    Exception in thread "main" javax.naming.AuthenticationException. Rootexception is java.lang.Securi
    tyException: Authentication for user guest denied in realm weblogic
    <<no stack trace available>>
    I have test on reserved set (and dual as the table).
    Anyone shed any light on what could be going wrong, because right now,every time the DB fails, we have to restart the **&$"&^ server.... (and that
    takes around 20mins for all the apps to init)
    >
    tks
    will

  • RFC_ERROR_SYSTEM_FAILURE: Time limit exceeded. Connection Pool - JCO api

    Hi Everyone
    My Connection  Pool parameters JCO api.
    client=300
    user=SISGERAL_RFC
    passwd=******
    ashost=14.29.3.120
    sysnr=00
    size=10
    I have these parameters on my Connection Pool and sometimes appear these wrongs in my application:
    1.
    2006-01-07 13:20:37,414 ERROR com.tel.webapp.framework.SAPDataSource - ##### Time limit exceeded. LOCALIZED MESSAGE = Time limit exceeded. KEY = RFC_ERROR_SYSTEM_FAILURE GROUP = 104 TOSTRING = com.sap.mw.jco.JCO$Exception: (104) RFC_ERROR_SYSTEM_FAILURE: Time limit exceeded.
    2.
    2006-01-07 14:01:31,007 ERROR com.tel.webapp.framework.SapPoolConnectionManager - Timeout
    I’d like to know if is happening.
    Are there something wrong with my connection pool?
    What can be happening?
    Thanks

    Raghu,
    Thanks for your response.
    Yes, the pool connections are in place according to the sAP note mentioned above.
    Regards,
    Faisal

  • Connection Pool Failure: "No suitable driver"

    Hi,
    Upon server startup, I get the following result:
    <Nov 7, 2001 4:18:32 PM CST> <Error> <JDBC> <Cannot startup connection pool "ora
    cleTrufflePool" No suitable driver>
    I assumed it was a path problem, but in the startWebLogic.cmd script I've set the PATH and CLASSPATH variables to the same as in a separate command window that can successfully dbping the Oracle db.
    One thing I completely don't understand is what the URL value should be for the pool, and I can't see a pattern in the examples and docs I've found on this. Here are my pool settings, at any rate:
    Name: oracleTrufflePool
    URL: myOracleServerName
    Driver Classname: weblogic.jdbc.oci.Driver
    Properties:
    user=user
    password=password
    server=myOracleServerName
    ACLName: user
    Password: password
    As you can see, I also don't understand whether the Oracle user name and password must be duplicated in the Properties section, or should they really only be listed in the ACLName and Password fields (in the Server Console UI)?
    TIA,
    Steve

    Hi. The issue is that the URL you give is not the URL the driver (weblogic.jdbc.oci.Driver)
    wants. The URL should be "jdbc:webLogic:oci". The properties user, password and server
    will be passed to the driver for conenction attempts. The ACL is for who gets to use the
    pool, and the other password entry is only if you need the DBMS password to be encrypted
    in the XML. If so, set that password value, and don't have it in the driver properties.
    Joe
    Steve Clark wrote:
    >
    Hi,
    Upon server startup, I get the following result:
    <Nov 7, 2001 4:18:32 PM CST> <Error> <JDBC> <Cannot startup connection pool "ora
    cleTrufflePool" No suitable driver>
    I assumed it was a path problem, but in the startWebLogic.cmd script I've set the PATH and CLASSPATH variables to the same as in a separate command window that can successfully dbping the Oracle db.
    One thing I completely don't understand is what the URL value should be for the pool, and I can't see a pattern in the examples and docs I've found on this. Here are my pool settings, at any rate:
    Name: oracleTrufflePool
    URL: myOracleServerName
    Driver Classname: weblogic.jdbc.oci.Driver
    Properties:
    user=user
    password=password
    server=myOracleServerName
    ACLName: user
    Password: password
    As you can see, I also don't understand whether the Oracle user name and password must be duplicated in the Properties section, or should they really only be listed in the ACLName and Password fields (in the Server Console UI)?
    TIA,
    Steve

  • Connection Pool Failure

    Hello. I'm using wls 5.1 and Oracle 8i and an unable to make a connection pool. I keep getting the following with the message below. Where and how do I change my path?
    weblogic.common.ResourceException: weblogic.common.ResourceException:
    Could not create pool connection. The DBMS driver exception was:
    java.sql.SQLException: System.loadLibrary threw java.lang.UnsatisfiedLinkError
    'no weblogicoci36 in java.library.path'.
    at weblogic.jdbcbase.oci.Driver.connect(Driver.java:116)

    Hi,
    You need to ensure that the ORACLE_HOME is set and PATH has
    %ORACLE_HOME%\bin;%ORACLE_HOME%\lib;%WL_HOME%\bin\oci816_8 (check verison of
    database) in the server startup script.
    hth
    sree
    "Purvi" <porgie_76@> wrote in message news:3c6306f9$[email protected]..
    Hello. I'm using wls 5.1 and Oracle 8i and an unable to make a connection
    pool. I keep getting the following with the message below. Where and how do
    I change my path?
    weblogic.common.ResourceException: weblogic.common.ResourceException:
    Could not create pool connection. The DBMS driver exception was:
    java.sql.SQLException: System.loadLibrary threw
    java.lang.UnsatisfiedLinkError
    'no weblogicoci36 in java.library.path'.
    at weblogic.jdbcbase.oci.Driver.connect(Driver.java:116)

  • Easy JNDI + Connection Pool Question

    This is an easy question:
    Once I get the object represented by my connection pool from the
    Weblogic JNDI tree, how do I get a connection from the returned object
    of type weblogic.common.internal.ResourceAllocator?
    I keep getting ClassCastExceptions. I have tried
    ConnectionPoolDataSource, Connection, and DataSource.
    String conPool = "weblogic.jdbc.connectionPool.demoPool";
    try {
    Object obj = ctx.lookup(conPool);
    msg(DEBUG,"FROM LOOKUP" + obj.getClass().getName());
    //DataSource ds = (DataSource)ctx.lookup(conPool);
    //con = ds.getConnection();
    } catch (NameNotFoundException e) {
    // binding does not exist
    msg(ERROR,"BINDING DOES NOT EXIST",e);
    } catch (NamingException e) {
    // a failure occurred
    msg(ERROR,"NAMING FAILURE OCCURED",e);
    } catch (Exception e) {
    msg(ERROR,"SOME RANDOM ERROR",e);
    Thanks,
    -Jacob

    "Jacob Meushaw" wrote in message
    Once I get the object represented by my connection pool from the
    Weblogic JNDI tree, how do I get a connection from the returned object
    of type weblogic.common.internal.ResourceAllocator?
    I keep getting ClassCastExceptions.
    DataSource ds = (DataSource)ctx.lookup(conPool);I think, you must use narrow operation:
    Object reference = ctx.lookup(conPool);
    DataSource ds =
    (DataSource) PortableRemoteObject.narrow (ds,DataSource.class);
    I haven't got time to check it, but I hope that works.
    Wojtek

Maybe you are looking for