Connection Pool establishment problem

Hi Experts,
we have one application with JCo mechanism. For this application,
we are using one properties file, which holds ABAP connection information. From this connection information(sapconn.props), we created connection pool and fetching data from the back end. Now my requirement is, instead of this properties file, we want to use one SLD, from this i would like to fetch connection information and establish a connection pool. How can we implement this one...?
Is there any API to read the ABAP connection informaation from visual admin (JCo RFC provider) ?
Thanks
maha

Your question has been answered in this [thread|connection establishment doubt;.
Please read the [rules|https://wiki.sdn.sap.com/wiki/display/HOME/RulesofEngagement], in particular - do not cross post.
-- Vladimir

Similar Messages

  • Intermittent mssql4 Connection Pool Failure problems

    Ocaisionally we are getting the following error:
    weblogic.jdbcbase.mssqlserver4.TdsConnection.registerOutgoingPipeline(TdsConnection.java:414)
    at weblogic.jdbcbase.mssqlserver4.TdsConnection.registerPipeline(TdsConnection.java:430)
    at weblogic.jdbcbase.mssqlserver4.TdsStatement.execute(TdsStatement.java:182)
    at weblogic.jdbcbase.mssqlserver4.TdsStatement.execute(TdsStatement.java:1521)
    at weblogic.jdbcbase.jts.Statement.execute(Statement.java:302)
    at weblogic.jdbc20.rmi.internal.PreparedStatementImpl.execute(PreparedStatementImpl.java:288)
    at weblogic.jdbc20.rmi.SerialPreparedStatement.execute(SerialPreparedStatement.java:398
    Once we get this error the whole connection pool is fried until we restart it.
    We are using the test connection on checkout property of the connection pool,
    so I don't understand why this problem isn't caught at connection checkout time.
    Normally if there is a problem with a connection, the connection is refreshed.
    However, sometimes, this happens.

    What version of our product? What is the whole serverside stacktrace?
    thanks,
    Joe
    Scott wrote:
    >
    Ocaisionally we are getting the following error:
    weblogic.jdbcbase.mssqlserver4.TdsConnection.registerOutgoingPipeline(TdsConnection.java:414)
    at weblogic.jdbcbase.mssqlserver4.TdsConnection.registerPipeline(TdsConnection.java:430)
    at weblogic.jdbcbase.mssqlserver4.TdsStatement.execute(TdsStatement.java:182)
    at weblogic.jdbcbase.mssqlserver4.TdsStatement.execute(TdsStatement.java:1521)
    at weblogic.jdbcbase.jts.Statement.execute(Statement.java:302)
    at weblogic.jdbc20.rmi.internal.PreparedStatementImpl.execute(PreparedStatementImpl.java:288)
    at weblogic.jdbc20.rmi.SerialPreparedStatement.execute(SerialPreparedStatement.java:398
    Once we get this error the whole connection pool is fried until we restart it.
    We are using the test connection on checkout property of the connection pool,
    so I don't understand why this problem isn't caught at connection checkout time.
    Normally if there is a problem with a connection, the connection is refreshed.
    However, sometimes, this happens.

  • MySQL connection pooling (tomcat) problem

    Hi all i just started learning servlets and i want to make a program in order to understand database connection pooling in tomcat.My problem is that when i run the servlet i created i get this error :
    java.lang.NullPointerException org.DB.TestDB2.doGet(TestDB2.java:105) javax.servlet.http.HttpServlet.service(HttpServlet.java:690) javax.servlet.http.HttpServlet.service(HttpServlet.java:803) org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:390)
    And that from tomcat log from netbeans :
    org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC driver of class '' for connect URL 'null' 
    .I configured tomcat server.xml file like this :
    <Context path="/DBTest" docBase="DBTest"         debug="5" reloadable="true" crossContext="true">   <Resource name="jdbc/phonebook_db" auth="Container" type="javax.sql.DataSource"               maxActive="100" maxIdle="30" maxWait="10000"               username="*******" password="********" removeAbandoned="true"               removeAbandonedTimeout="120" driverClassName="com.mysql.jdbc.Driver"               url="jdbc:mysql://localhost:3306/test_phonebook_db?autoReconnect=true"/> </Context>   
    This is the resource reference i have in my web app web.xml file :
    <resource-ref>       <description>DB Connection</description>       <res-ref-name>jdbc/phonebook_db</res-ref-name>       <res-type>javax.sql.DataSource</res-type>       <res-auth>Container</res-auth>   </resource-ref> 
    And this is my servlet class :
    package org.DB;  import javax.servlet.*; import javax.servlet.http.*; import java.io.*; import java.sql.*; import javax.naming.*; import javax.sql.*; public class TestDB2 extends HttpServlet { private Connection conn ; private Statement stat ; private ResultSet rs ; private int counter; private Object rsValue; public void init() {     try {             InitialContext ctx = new InitialContext();             DataSource ds = (DataSource)ctx.lookup("java:comp/env/jdbc/phonebook_db");             conn = ds.getConnection();             }         catch(Exception e) {               e.printStackTrace();         }     }     public void doGet(HttpServletRequest request, HttpServletResponse response)throws ServletException, IOException {         try {           stat = conn.createStatement();           rs = stat.executeQuery("SELECT * FROM phones_table");            } catch (SQLException sqle) {         sqle.printStackTrace();         }      response.setContentType("text/html; charset=utf-8");     PrintWriter out = response.getWriter();         String docType = "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 " + "Transitional//EN\">\n";     out.println(docType +"<HTML>\n" + "<HEAD><TITLE>PhoneBook entries</TITLE></HEAD>\n");         counter = 0;     try {         while (rs.next()) {             out.println("<h4>Entry no. " + (++counter) + "</h4>");             out.println("<table width=\"75%\" border=\"1\">");             out.println("<tr>\n"+ "<td width=\21%\"><b>LastName:</b></td>\n"+ "<td width=\"79%\">");             out.println((((rsValue = rs.getObject("LASTNAME"))==null || rs.wasNull())?                 "":(rsValue.toString())));             out.println("</td>\n</tr>\n" +  "<tr>\n"+                     "<td width=\21%\"><b>FirstName:</b></td>\n"+ "<td width=\"79%\">");             out.println((((rsValue = rs.getObject("FIRSTNAME"))==null || rs.wasNull())?                 "":(rsValue.toString())));             out.println("</td>\n"+ "</tr>\n"+                     "<td width=\21%\"><b>Phone:</b></td>\n"+ "<td width=\"79%\">");             out.println((((rsValue = rs.getObject("PHONE"))==null || rs.wasNull())?                 "":(rsValue.toString())));             out.println("</td>\n" + "</tr>\n" +                     "</table>\n"+ "<br>\n<br>");         }     } catch (SQLException sqle) {         sqle.printStackTrace();     }     out.println("</body>\n"+             "</html>"); } public void destroy() {     try {         rs.close();         stat.close();         conn.close();     } catch (SQLException sqle) {         sqle.printStackTrace();         }     } }{code} Any suggestions?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

    Thank you for your answer.Yes my servlet class is something more worse than horrible(i don't use the database connection correct i don't use the MVC pattern i use out.println() ) but i just tried to take a ready example and try to understand .So i write this servlet myself as a starting point :
    package org.DB;
    import javax.servlet.ServletException;
    import javax.servlet.http.HttpServlet;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    import java.io.*;
    import java.sql.*;
    public class DBServlet extends HttpServlet {
        private Connection conn ;
        private Statement stat ;
        private ResultSet rs ;
        private int counter;
        String driver = "com.mysql.jdbc.Driver";
        String dbURL = "jdbc:mysql://localhost:3306/phonebookdb?user=**********&password=************";
        @Override
    public void init() {
         try {
                Class.forName(driver).newInstance();
                conn = DriverManager.getConnection(dbURL);
         }catch(Exception e) {
                  e.printStackTrace();
                  System.err.print("Unable to make connection ");
        protected void processRequest(HttpServletRequest request, HttpServletResponse response)
        throws ServletException, IOException {
            response.setContentType("text/html;charset=UTF-8");
            PrintWriter out = response.getWriter();
            try {
                out.println("<html>");
                out.println("<head>");
                out.println("<title>Servlet DBServlet</title>"); 
                out.println("</head>");
                out.println("<body>");
                out.println("<h1>Servlet DBServlet at " + request.getContextPath () + "</h1>");
                out.println("<br /><br /><br />");
                if(conn!=null) 
                    out.println("conn object : "+conn);
                out.println("</body>");
                out.println("</html>");
            } catch(Exception sq) {
                System.out.println("Exception" + sq.getMessage());
                out.close();
        @Override
        protected void doGet(HttpServletRequest request, HttpServletResponse response)
        throws ServletException, IOException {
            processRequest(request, response);
        @Override
        protected void doPost(HttpServletRequest request, HttpServletResponse response)
        throws ServletException, IOException {
            processRequest(request, response);
         public void destroy() {
         try {
             conn.close();
         } catch (SQLException sqle) {
             sqle.printStackTrace();
        @Override
        public String getServletInfo() {
            return "A Simple Servlet";
    }And it work for now.
    Edited by: pavlos555 on Oct 21, 2008 10:21 AM

  • Why would connection pooling cause problems with a trigger?

    This is a strange one. We have an app that deletes a row in a database table, and this table has a delete trigger on it. The row gets deleted every time the app is run, yet the trigger only fires intermittently. It's not that the trigger is failiing in some way - it just doesn't get called at all. If I issue the same delete command in PL/SQL developer then the trigger fires every time.
    Several hours later and out of desparation I tried turning off connection pooling via the app's connection string, and found that the trigger now fires every time. Any ideas what might be causing this behaviour? I can reproduce/fix the issue every time simply by setting "Pooling" to true or false!
    We are using Oracle 11g and ODP.Net v4.112.2.0.
    Thanks in advance
    Andrew

    More information: I've now been able to reproduce this issue in a small .Net app, and can make it fail in a more consistent manner (which I'll explain later). While it's still too large to post the entire code here, I can summarise what the app does in pseudo-code:-
    for(int i = 1; i <= 10; i++) // Run the test a number of times
    // Step 1 - Delete rows from the table with the delete query in question
    Execute non-query "delete from test_table";
    Wait 1 second
    // Step 2 - Check that the delete actually happened
    Execute reader "select count(*) from test_table"
    Display the count
    // Step 3 - Check that the delete trigger inserted some rows into a "logging" table. This is my method of "tracing" - I added a basic insert to the start of each trigger section, as mentioned in my previous post.
    Execute reader "select count(*) from my_logging_table"
    Display the count
    // Reinstate the test data
    Execute non-query "<insert rows back into test_table>"
    Wait 1 second
    For info the connection string is fairly basic:- "Data Source=<tns name>;User Id=<foo>;Password=<bar>"
    Some points of interest:-
    - When running the above test app, the trigger successfully fires on the very first iteration (i.e. "Step 3" displays a non-zero count from the logging table). All subsequent iterations fail ("Step 3" displays the same count each time).
    - If I turn off connection pooling (by adding "Pooling=false" to the connection string), the trigger runs on every iteration (i.e. "Step 3" displays an ever-incrementing record count).
    - Regardless of whether it works or fails, the deletion in step 1 does take place (confirmed by "Step 2" displaying a count of zero).
    - I added the waits after the non-query calls to see if that made a difference, but it doesn't. I can change these to 10 seconds or more and it will have no effect on the issue.
    The "Execute non-query" method uses code along these lines:-
    using (var conn = new OracleConnection(ConnString))
    conn.Open();
    using (var cmd = conn.CreateCommand())
    cmd.CommandText = sql;
    cmd.CommandType = CommandType.Text;
    result = cmd.ExecuteNonQuery();
    conn.Close();
    return result;
    While the "Execute reader" method looks like this:-
    var conn = new OracleConnection(ConnString);
    conn.Open();
    var cmd = conn.CreateCommand();
    cmd.CommandText = sql;
    cmd.CommandType = CommandType.Text;
    return cmd.ExecuteReader(CommandBehavior.CloseConnection);
    The calling code in the for loop, wraps the returned reader in a using clause like this:-
    using (var reader = ExecuteReader("<sql>"))
    This will dispose of the reader, which will in turn close/dispose the connection (due to the CommandBehavior.CloseConnection parameter passed to ExecuteReader).
    Interestingly, if the reader isn't disposed of then the problem becomes more intermittent (the trigger will fire perhaps 25% of the time). This is what's happening in our unit test harness. By ensuring the reader/connection is closed and disposed (which common sense would say should improve matters), the trigger only fires on the very first iteration of the loop. The plot thickens.

  • Cannot get a connection, pool error Timeout waiting for idle object

    my connection pool setting is
      maxActive="3" minIdle="2"                maxWait="10000"              removeAbandoed="true" logAbandoned="true"         removeAbandonedTimeout="30"         autoreconnection="true" 
    we have 7 people hitting the group of search functions ,
    about 3 minutes I get
    I got error like
    org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot get a connection, pool error Timeout waiting for idle object         at org.apache.tomcat.dbcp.dbcp.PoolingDataSource.getConnection(PoolingDataSource.java:104)         at org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSource.java:880)         at Deferment.showResult.checStudent(showResult.java:135)         at Deferment.showResult.doPost(showResult.java:99)         at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)         at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)         at org.apache.catalina.servlets.InvokerServlet.serveRequest(InvokerServlet.java:402)         at org.apache.catalina.servlets.InvokerServlet.doPost(InvokerServlet.java:170)         at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)         at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
    I just wonder
    1) Cannot get a connection, pool error Timeout waiting for idle object-> cause by connection pool leaking or other problem.
    2) Setting the maxactive to -1 ( suggestion from Google) , if I set my connection to ulimit , waht should I put on minIdle="2"
    3) How can I test my connection pool have problem or not ? is
    SHOW PROCESSLIST; tolding me someinformation? I use Mysql
    Thank you!

    I try something like ps2 = conn.prepareStatement(target);
                ps2.setString(1, UNumber); // set input parameter
                rs = ps2.executeQuery();
                sendMail = 0;//how many rows we can find.
                while (rs.next()) {
                    sendMail++;
                ps2.close();
                rs.close();
                conn.close();
      if ((count1 == 0) || (count2 == 0)) {
                    conn.rollback();
                } else {
                    conn.commit();
                    conn.setAutoCommit(true);
                ps.close();
                calstat2.close();
                conn.close();
    calstat = (CallableStatement) conn.prepareCall("{call findStudent}");
                calstat.executeQuery();
                calstat.close();
                conn.close();is that enought? what else I should do to make sure I did close all the connection, after I use it ?
    thank you

  • Connection Pool - unable to establish connection for one or more OC4J inst.

    Hi.
    I'm using Oracle JDeveloper 10.1.3.1 to develop some app. Database is Oracle XE 10.2.0. Application server is Oracle Aplication Server 10.1.3.1
    After create a needed code, I' v tried establish Connection Pool. When I' v tested connection, next errors was occurred:
    Unable to establish connection for one or more OC4J instances<<
    Home on admin.FRIEND-6843859F - Failed due to error: "Exception occurred testing connection. Exception: java.sql.SQLException: invalid arguments in call."<<"FRIEND-6843859F " is Computer name where Application server is installed.
    --Database is started.
    --App.server processes are started.
    How can I solve this problem?
    Thanx

    If you are using ADF "BC" Jdev will not support more than one connection
    I've tryied and always gives a errors.

  • Multiple connection pools problem

    Hi,
    Here is the problem. We use several connection pools to access differents
    schema of our database. We also have a connection pool
    opened for Weblogic Commerce which connects to the Commerce schema in our
    database. Here is a sample of our weblogic.properties file:
    #========================================================
    # WeblogicCommerce pool and data source
    #========================================================
    weblogic.jdbc.connectionPool.commercePool=\
    url=jdbc:oracle:thin:@careon_dev:1521:careon,\
    driver=oracle.jdbc.driver.OracleDriver,\
    loginDelaySecs=1,\
    initialCapacity=2,\
    maxCapacity=10,\
    capacityIncrement=1,\
    allowShrinking=true,\
    shrinkPeriodMins=15,\
    testConnsOnReserve=true,\
    props=user=WLCS_TEST;password=WLCS_TEST,\
    testTable=WLCS_IS_ALIVE,\
    refreshMinutes=5
    weblogic.allow.reserve.weblogic.jdbc.connectionPool.commercePool=everyone,
    CareonDev
    weblogic.jdbc.DataSource.weblogic.jdbc.jts.commercePool=commercePool
    #========================================================
    # WeblogicCommerce Document Management pool
    #========================================================
    # This is the pool the beans reference
    weblogic.jdbc.connectionPool.docPool=\
    url=jdbc:beasys:docmgmt:com.beasys.commerce.axiom.document.ref.RefDocumentPr
    ovider,\
    driver=com.beasys.commerce.axiom.document.jdbc.Driver,\
    loginDelaySecs=1,\
    initialCapacity=2,\
    maxCapacity=10,\
    capacityIncrement=1,\
    allowShrinking=true,\
    shrinkPeriodMins=15,\
    refreshMinutes=10,\
    props=jdbc.url=jdbc:weblogic:pool:commercePool;\
    jdbc.isPooled=true;\
    weblogic.t3.waitForConnection=true;\
    weblogic.t3.waitSecondsForConnection=999999999999;\
    docBase=C:/WebLogicCommerce/dmsBase/;\
    schemaXML=C:/WebLogicCommerce/dmsBase/doc-schema.xml
    weblogic.allow.reserve.weblogic.jdbc.connectionPool.docPool=everyone,
    CareonDev
    # Add the show doc servlet
    weblogic.httpd.register.ShowDocServlet=com.beasys.commerce.content.ShowDocSe
    rvlet
    #========================================================
    # Careon's CDRpool and data source
    #========================================================
    weblogic.jdbc.connectionPool.cdrPool=\
    url=jdbc:oracle:thin:@careon_dev:1521:careon,\
    driver=oracle.jdbc.driver.OracleDriver,\
    initialCapacity=2,\
    maxCapacity=10,\
    capacityIncrement=2,\
    allowShrinking=true,\
    shrinkPeriodMins=15,\
    refreshMinutes=10,\
    testTable=dual,\
    props=user=test;password=test
    weblogic.allow.reserve.weblogic.jdbc.connectionPool.cdrPool=everyone,
    CareonDev
    Inpredictably, we obtain the following error:
    java.sql.SQLException: Connection has already been created in this tx
    context for pool named commercePool. Illegal attempt to create connection
    from another pool: cdrPool
    Does anybody have a solution or at least pointers ?
    Many thanks,
    Olivier

    Goh Yew Yap wrote:
    >
    Is there any workaround for this?Yes. In 6.0, presuming you use XA-compliant JDBC drivers
    for the DBMS or DBMSes involved, transactions will be able
    to involve any number of pools/DBMSes in a transaction.
    For 5.1 and/or for DBMSes that do not have an XA-compliant
    JDBC driver, you can write BMP beans that will do their own
    JDBC access to all but one DBMS, using the non-transactional
    pool driver, and you will be fully responsible for any
    transactional state involving this under-the-covers JDBC.
    This is easy to do in cases where a second DBMS is used
    primarily for queries, not updates, so the non-JTS-managed
    JDBC access can't corrupt that DBMS.
    Joe
    >
    "Joseph Weinstein" <[email protected]> wrote in message
    news:[email protected]...
    Olivier Baujard wrote:
    Hi,
    Here is the problem.
    Inpredictably, we obtain the following error:
    java.sql.SQLException: Connection has already been created in this tx
    context for pool named commercePool. Illegal attempt to create connection
    from another pool: cdrPoolHi. This means that within a single JTS/EJB transaction, there weremultiple
    beans and/or JSPs etc that got JDBC connections to do work, but not all ofthese
    routines asked for a connection from the same pool. That's a requirementfor
    5.1 or 4.5. The transaction coordinator and JTS driver cooperate to ensurethat
    only one JDBC connection is really ever used in a given transaction. Ifmultiple
    beans ask for a pool connection within a given tx, we ensure that theyreally get
    the same connection. This is because JDBC drivers typically don'timplement
    2-phase commit, so we must enforse that only one DBMS connection isinvolved so we
    can just commit or roll back on it, and ensure transactional correctness.If a
    bean asks for a connection from a different pool than a previous bean inthe same
    tx, we know we can't give them the already-established connection, so wethrow
    this exception.
    For 6.0, for pools made with XA-compliant JDBC drivers, this will be OK.
    Joe
    We use several connection pools to access differents
    schema of our database. We also have a connection pool
    opened for Weblogic Commerce which connects to the Commerce schema in
    our
    database. Here is a sample of our weblogic.properties file:
    #========================================================
    # WeblogicCommerce pool and data source
    #========================================================
    weblogic.jdbc.connectionPool.commercePool=\
    url=jdbc:oracle:thin:@careon_dev:1521:careon,\
    driver=oracle.jdbc.driver.OracleDriver,\
    loginDelaySecs=1,\
    initialCapacity=2,\
    maxCapacity=10,\
    capacityIncrement=1,\
    allowShrinking=true,\
    shrinkPeriodMins=15,\
    testConnsOnReserve=true,\
    props=user=WLCS_TEST;password=WLCS_TEST,\
    testTable=WLCS_IS_ALIVE,\
    refreshMinutes=5
    weblogic.allow.reserve.weblogic.jdbc.connectionPool.commercePool=everyone,
    CareonDev
    weblogic.jdbc.DataSource.weblogic.jdbc.jts.commercePool=commercePool
    #========================================================
    # WeblogicCommerce Document Management pool
    #========================================================
    # This is the pool the beans reference
    weblogic.jdbc.connectionPool.docPool=\
    url=jdbc:beasys:docmgmt:com.beasys.commerce.axiom.document.ref.RefDocumentPr
    ovider,\
    driver=com.beasys.commerce.axiom.document.jdbc.Driver,\
    loginDelaySecs=1,\
    initialCapacity=2,\
    maxCapacity=10,\
    capacityIncrement=1,\
    allowShrinking=true,\
    shrinkPeriodMins=15,\
    refreshMinutes=10,\
    props=jdbc.url=jdbc:weblogic:pool:commercePool;\
    jdbc.isPooled=true;\
    weblogic.t3.waitForConnection=true;\
    weblogic.t3.waitSecondsForConnection=999999999999;\
    docBase=C:/WebLogicCommerce/dmsBase/;\
    schemaXML=C:/WebLogicCommerce/dmsBase/doc-schema.xml
    weblogic.allow.reserve.weblogic.jdbc.connectionPool.docPool=everyone,
    CareonDev
    # Add the show doc servlet
    weblogic.httpd.register.ShowDocServlet=com.beasys.commerce.content.ShowDocSe
    rvlet
    #========================================================
    # Careon's CDRpool and data source
    #========================================================
    weblogic.jdbc.connectionPool.cdrPool=\
    url=jdbc:oracle:thin:@careon_dev:1521:careon,\
    driver=oracle.jdbc.driver.OracleDriver,\
    initialCapacity=2,\
    maxCapacity=10,\
    capacityIncrement=2,\
    allowShrinking=true,\
    shrinkPeriodMins=15,\
    refreshMinutes=10,\
    testTable=dual,\
    props=user=test;password=test
    weblogic.allow.reserve.weblogic.jdbc.connectionPool.cdrPool=everyone,
    CareonDev
    Inpredictably, we obtain the following error:
    java.sql.SQLException: Connection has already been created in this tx
    context for pool named commercePool. Illegal attempt to createconnection
    from another pool: cdrPool
    Does anybody have a solution or at least pointers ?
    Many thanks,
    Olivier--
    PS: Folks: BEA WebLogic is in S.F. with both entry and advanced positionsfor
    people who want to work with Java and E-Commerce infrastructure products.Send
    resumes to [email protected]
    The Weblogic Application Server from BEA
    JavaWorld Editor's Choice Award: Best Web Application Server
    Java Developer's Journal Editor's Choice Award: Best Web ApplicationServer
    Crossroads A-List Award: Rapid Application Development Tools for Java
    Intelligent Enterprise RealWare: Best Application Using a ComponentArchitecture
    http://www.bea.com/press/awards_weblogic.html
    PS: Folks: BEA WebLogic is in S.F. with both entry and advanced positions for
    people who want to work with Java and E-Commerce infrastructure products. Send
    resumes to [email protected]
    The Weblogic Application Server from BEA
    JavaWorld Editor's Choice Award: Best Web Application Server
    Java Developer's Journal Editor's Choice Award: Best Web Application Server
    Crossroads A-List Award: Rapid Application Development Tools for Java
    Intelligent Enterprise RealWare: Best Application Using a Component Architecture
    http://www.bea.com/press/awards_weblogic.html

  • Problems using connection pooling

    I'm having problems configuring connection pooling in oc4j. Have specified my datasource/connection pool in my data-sources.xml. I always get the following error when I try to access it with an instance of OracleConnectionPoolDataSource within my apps. The app server dosen't seem to create the connections when started 'cos its not displayed within Oracle dba studio. Can anyone tell what I need to do pls.
    regards!
    dyzke
    //-- error displayed
    Exception in thread "main" java.sql.SQLException: Io exception: The Network Adap
    ter could not establish the connection
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:168)
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:210)
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:323)
    at oracle.jdbc.driver.OracleConnection.<init>(OracleConnection.java:260)
    at oracle.jdbc.driver.OracleDriver.getConnectionInstance(OracleDriver.ja
    va:365)
    at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:260)
    at java.sql.DriverManager.getConnection(Unknown Source)
    at java.sql.DriverManager.getConnection(Unknown Source)
    at oracle.jdbc.pool.OracleDataSource.getConnection(OracleDataSource.java
    :111)
    // -- extract
    <data-source
              class="com.evermind.sql.DriverManagerDataSource"
    name="MYDS"
              location="jdbc/XXX"      
    xa-location="jdbc/xa/OracleXADS"
              ejb-location="jdbc/OracleDS"
    pooled-location="xxx/xxxx"
              max-connections="10"
              min-connections="3"                    
              connection-driver="oracle.jdbc.driver.OracleDriver"
              username="admin"
              password="admin"
              url="jdbc:oracle:thin:@localhost:xxx"
              inactivity-timeout="30"
         />

    see my answer in the other newsgroup.
    please don't cross post.
    "M. Hammer" <[email protected]> wrote in message
    news:[email protected]..
    Hi,
    We have problems using connection pooling in a WLS 5.1.x - Cluster. Is it
    possible to use CP in such a cluster at all ? The problem is, connections
    will be opened and never been closed. How can I configure a cluster forCP?
    >
    I have a WLS-Cluster with 2 instances and my webApp uses connectionpooling.
    By the way I get a connection on Instance 1, Instance 2 gets a connection
    also, but never releases it.
    In my opinion, the reference to the connection in the partner-instancewill
    be lost.
    How do I have to configure my cluster to work well with that stuff ?
    Thank a lot,
    Markus.

  • Problem when creating connection pool for Informix

    Hi all,
    could you please help me to create a connection pool for informix?
    I use a com.informix.jdbcx.IfxXADataSource driver and here are the properties
    user=informix
    password=informix
    url=jdbc:informix-sqli://TW010766:1526/vka:informixserver=TW010766
    dataSourceName=TestEntityPool2
    portNumber=1526
    databaseName=vka
    ifxIFXHOST=TW010766
    serverName=vka
    Here is the error message :
    Error during Data Source creation: weblogic.common.ResourceException: DataSource(TestEntity)
    can't be created with non-existent Pool (connection or multi) (TestEntityPool2)
         at weblogic.jdbc.common.internal.JdbcInfo.validateConnectionPool(JdbcInfo.java:127)
         at weblogic.jdbc.common.internal.JdbcInfo.startDataSource(JdbcInfo.java:189)
         at weblogic.jdbc.common.internal.JDBCService.addDeploymentx(JDBCService.java:293)
         at weblogic.jdbc.common.internal.JDBCService.addDeployment(JDBCService.java:270)
         at weblogic.management.mbeans.custom.DeploymentTarget.addDeployment(DeploymentTarget.java:375)
         at weblogic.management.mbeans.custom.DeploymentTarget.addDeployments(DeploymentTarget.java:303)
         at weblogic.management.mbeans.custom.DeploymentTarget.updateServerDeployments(DeploymentTarget.java:256)
         at weblogic.management.mbeans.custom.DeploymentTarget.updateDeployments(DeploymentTarget.java:207)
    Could you please tell me what's wrong with the configuration?
    Many thanks in advance.
    Hoang

    Hoang Nguyen wrote:
    For JBuilder :
    URL : jdbc:informix-sqli://tra019746:1526/vka:informixserver=vka
    Driver : com.informix.jdbcx.IfxXADataSource
    username : informix; password : informix
    For WebLogic :
    URL : jdbc:informix-sqli://tra019746:1526/vka:informixserver=vka
    Driver : com.informix.jdbcx.IfxXADataSource
    Properties : password=informix
    user=informixOk. The problem may have to do with your reiterating all the properties below.
    url=jdbc:informix-sqli://tra019746:1526/vka:informixserver=vka
    portNumber=1526
    databaseName=vka
    serverName=vka
    ifxIFXHOST=tra019746All these above are implicit in the URL you give to jBuilder and weblogic.
    Try defining the pool with only the user and password as properties.
    >
    >
    Error:
    Error during Data Source creation: weblogic.common.ResourceException:
    DataSource(TestEntity)
    can't be created with non-existent Pool (connection or multi) (TestEntityPool2)
    at weblogic.jdbc.common.internal.JdbcInfo.validateConnectionPool(JdbcInfo.java:127)
    at weblogic.jdbc.common.internal.JdbcInfo.startDataSource(JdbcInfo.java:189)
    at weblogic.jdbc.common.internal.JDBCService.addDeploymentx(JDBCService.java:293)
    at weblogic.jdbc.common.internal.JDBCService.addDeployment(JDBCService.java:270)
    at weblogic.management.mbeans.custom.DeploymentTarget.addDeployment(DeploymentTarget.java:375)
    Thanks Joe
    Hoang Nguyen wrote:
    Joseph,
    The driver that I use comes from informix.
    I've tried with JBuilder and no problem. JBuilder can connect to informixand
    I can see the tables from JBuilder.
    There's something wrong in the configuration with Weblogic.
    Many thanks for your help.I understand that there's something wrong with the configuration with
    weblogic,
    but the problem is due to a mistake in the input you gave to the pool
    definition,
    and I want to solve that. Please show me the URL, driver name and properties
    you give to JBuilder to make Informix connections. Also, show me the
    first few lines
    that get printend out when you run the weblogic start script. I want
    to see the
    line that prints out the classpath used in the script for starting the
    server.
    thanks,
    Joe
    Joseph Weinstein <[email protected]> wrote:
    Ok, I would like you to download Informix's driver from them, and
    run one of their example programs, just to prove you can connect to
    informix, using their driver, with no weblogic in the picture. We
    have
    to establish that, because that's all weblogic will be doing anyway.
    Once
    we know how to connect to informix via JDBC, we can do weblogic stuff.
    Joe
    Hoang Nguyen wrote:
    Hi,
    I forgot to mention that I'm working with Weblogic server 7 and
    Informix 2000 9.20.
    For the configuration, I followed the example given by Weblogic
    http://edocs.bea.com/wls/docs70/jdbc/thirdparty.html#thirdparty001,
    table 5.2
    Here is the example given by weblogic :
    user=username
    url=jdbc:informix-sqli://dbserver_name_or_ip:port_num/dbname:informixserver=dbserver_name_or_ip
    password=password
    portNumber =port_num;
    databaseName=dbname
    serverName=dbserver_name
    ifxIFXHOST=dbserver_name_or_ip
    If you take a look at the link, you'll see a note :
    "In the Properties string, there is a space between portNumber and=". I've tried
    that but it seems that this bug had been resolved. When I put the
    space,
    I've
    an number exception.
    Thanks for your help.
    Hoang
    Joseph Weinstein <[email protected]> wrote:
    Nguyen Hoang wrote:
    Hi all,
    could you please help me to create a connection pool for informix?
    I use a com.informix.jdbcx.IfxXADataSource driver and here are
    the
    properties
    user=informix
    password=informix
    url=jdbc:informix-sqli://TW010766:1526/vka:informixserver=TW010766
    dataSourceName=TestEntityPool2
    portNumber=1526
    databaseName=vka
    ifxIFXHOST=TW010766
    serverName=vka
    Here is the error message :
    Error during Data Source creation: weblogic.common.ResourceException:DataSource(TestEntity)
    can't be created with non-existent Pool (connection or multi)
    (TestEntityPool2)
    This means the pool was unable to make an informix connection withthe
    properties
    you gave. Please show me the few lines from an informix driver
    example
    program
    that makes a successful JDBC connection to the DBMS you want, andI will
    show
    you how to define a pool for weblogic to do the same.
    Joe
    at weblogic.jdbc.common.internal.JdbcInfo.validateConnectionPool(JdbcInfo.java:127)
    at weblogic.jdbc.common.internal.JdbcInfo.startDataSource(JdbcInfo.java:189)
    at weblogic.jdbc.common.internal.JDBCService.addDeploymentx(JDBCService.java:293)
    at weblogic.jdbc.common.internal.JDBCService.addDeployment(JDBCService.java:270)
    at weblogic.management.mbeans.custom.DeploymentTarget.addDeployment(DeploymentTarget.java:375)
    at weblogic.management.mbeans.custom.DeploymentTarget.addDeployments(DeploymentTarget.java:303)
    at weblogic.management.mbeans.custom.DeploymentTarget.updateServerDeployments(DeploymentTarget.java:256)
    at weblogic.management.mbeans.custom.DeploymentTarget.updateDeployments(DeploymentTarget.java:207)
    Could you please tell me what's wrong with the configuration?
    Many thanks in advance.
    Hoang

  • Connection Pooling : Network Adapter could not establish the connection

    Hi,
    We have a client-server application wherein the server has a pooled connection to an Oracle 10i database. The application is developed in Java and we are using Oracle OracleConnectionCacheImpl API to manage the connection pooling( DYNAMIC pooling with a pool size of 5 and we are using ojdbc14.jar)
    On certain occasions when activity is extremely high, the server attemtps to retrieve around 2 million datasets/records. The connection pool runs out of connections and we get the following error :
    com.indigo.utils.DBEngineException: java.sql.SQLException: Io exception: The Network Adapter could not establish the connection
    at com.indigo.zclasses.DBTradingSource.getConnection(DBTradingSource.java:136)
    at com.indigo.zclasses.DBTradingSource.getTicketMessages(DBTradingSource.java:8033)
    at sun.reflect.GeneratedMethodAccessor749.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at com.indigo.basketserver.ServerSideUtil.ConfigUtil(ServerSideUtil.java:88)
    at com.indigo.basketserver.RemoteServerImpl.ConfigUtil(RemoteServerImpl.java:543)
    at sun.reflect.GeneratedMethodAccessor17.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:294)
    at sun.rmi.transport.Transport$1.run(Transport.java:153)
    at java.security.AccessController.doPrivileged(Native Method)
    at sun.rmi.transport.Transport.serviceCall(Transport.java:149)
    at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:466)
    at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:707)
    at java.lang.Thread.run(Thread.java:595)
    Caused by: java.sql.SQLException: Io exception: The Network Adapter could not establish the connection
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:179)
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:334)
    at oracle.jdbc.driver.OracleConnection.<init>(OracleConnection.java:418)
    at oracle.jdbc.driver.OracleDriver.getConnectionInstance(OracleDriver.java:521)
    at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:325)
    at java.sql.DriverManager.getConnection(DriverManager.java:525)
    at java.sql.DriverManager.getConnection(DriverManager.java:140)
    at oracle.jdbc.pool.OracleDataSource.getConnection(OracleDataSource.java:171)
    at oracle.jdbc.pool.OracleConnectionPoolDataSource.getPhysicalConnection(OracleConnectionPoolDataSource.java:149)
    at oracle.jdbc.pool.OracleConnectionPoolDataSource.getPooledConnection(OracleConnectionPoolDataSource.java:95)
    at oracle.jdbc.pool.OracleConnectionPoolDataSource.getPooledConnection(OracleConnectionPoolDataSource.java:63)
    at oracle.jdbc.pool.OracleConnectionCacheImpl.getNewPoolOrXAConnection(OracleConnectionCacheImpl.java:547)
    at oracle.jdbc.pool.OracleConnectionCacheImpl.getPooledConnection(OracleConnectionCacheImpl.java:404)
    at oracle.jdbc.pool.OracleConnectionCacheImpl.getConnection(OracleConnectionCacheImpl.java:298)
    at oracle.jdbc.pool.OracleConnectionCacheImpl.getConnection(OracleConnectionCacheImpl.java:268)
    at com.indigo.zclasses.DBTradingSource.getConnection(DBTradingSource.java:127)
    This is happens in Production and despite our exhaustive efforts,we have been unable to reproduce it in our Testing environment so far.
    A large number of login attempts are seen in the Oracle login monitoring table, around 50,000 but we dont think that should be an issue. At the time, when this problem occurs, there are other processes making connection to the DB without any issues. Also, after sometime, the connection is restored and no exceptions are thrown.
    Any insight into how we could simulate,resolve or monitor this issue would be greatly appreciated.
    Thanks,
    Zuber

    Hi. This a long-known issue, and is caused by the DBMS listener's incoming
    request buffer becoming overloaded by many simultaneous connection
    requests. It will fail some of them. I have seen this with a simple java
    program that calls Driver.connect() identically 20 times in a tight loop.
    Some of the calls will fail in this way, while others will succeed. The
    solution BEA's pool has, is to have a delay option to have the thread
    sleep a bit (half-second to a secod or so) between successive connection
    requests. After that, don't close connections until they're broken. Keep
    them and re-use them.
    HTH,
    Joe Weinstein at BEA Systems

  • Serious connection pool problem on Tomcat

    Hi,
    We are deploying our JSF creator-made app onto Tomcat 1.5. We set up our JNDI datasource on Tomcat (using the i-net driver ).
    Initially the pages load ok but after a short period of time we are getting these errors:
    Initialization Failure: javax.faces.FacesException: org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot get a connection, pool exhaustedWe believe that somehow the Creator-generated code is NOT freeing up connections in the connection pool.
    We think that when the afterRenderResponse() methods in the beans call rowset.close() this is NOT returning the connections to the pool. Can someone, hopefully a Sun Engineer confirm that the rowset.close() code in afterRenderResponse() returns the connection behind the rowset to the connection pool.
    Could this be a driver issue? We are using the i-net driver not the DataDirect one, but this should implement the full API.
    This is a very serious problem for us.
    regards,
    john

    do you have any example code you could post? I have a Spring/JSC tutorial on this forum. Just search for Spring and you should find it. It you need something more, I'll try to give you some help...time provided.
    am i
    right in thinking that you use the forms designer to
    lay out your pages and just put your own stuff in the
    bean constructor?Close...but not everything goes in the constructor.
    >
    One thing that may have caused a problem is we have
    just noticed that in one of our most commonly hit
    pages this line:
    dataTable1Model.setDataCacheKey("com.sun.datacache.my_
    page.my_rowset");
    featured the WRONG "my_page" jsp page but the correct
    rowset name "my_rowset". The page DID load correctly
    and run correctly, though. Could this cause problems
    with connection pooling? Anyone?I wouldn't think so, but it depends on how Creator builds the code.

  • Oracle connection pool problem (dbcp binded with  jtom)

    Hi,
    my webserver is Tomcat5.0.18, I want to offer the connection pool and transaction management
    in my currently system
    I know in Tomcat5.0 version, we can use the DBCP to offer the database connection pool
    service, to apply the transaction management in my system, I adapt the JTOM
    now, my problem is
    to use DBCP, I setup the datasource factory to be
    org.apache.commons.dbcp.BasicDataSourceFactory, the connection pool is ok, but
    the transaction management offerred by JTOM will failure
    to make the tranaction management of JTOM succeed, I have to setup the datasource factory to be
    org.objectweb.jndi.DataSourceFactory, but the connection pool offerred by Tomcat will failure now
    it seems that these two datasource factory has conflict
    How can I do?, I don't want to use the connection pool offerred in JTOM
    Anyone can help me??
    Thanks in advance

    Hi,
    I don't know the solution for JOTM, but you could try this JTA and its connection pools:
    http://www.atomikos.com ships a JTA that integrates with Tomcat and also provides JDBC connection pooling. There is a GUI control panel so that you don't have to know the XML details for Tomcat's config files.
    Best,
    Guy

  • Problem with JCo Connection Pool

    Hi,
    I have a problem with using an RFC Model in my WebApplication. So sometimes the access to the function block works, and sometimes it doesn't work. Now I know, that there is a problem with the connection pool. Look at this message:
    com.sap.mw.jco.JCO$Exception: (106) JCO_ERROR_RESOURCE: Connection pool WD_X24_MODELDATA_DEST_CPIC_REKTO_DE_useDefinedUser is exhausted. The current pool size limit (max connections) is 10 connections.
    So it looks like a problem with closing the JCo Connections after using. Do know where the problem is? Because I'm using many other function blocks with no problems.

    Hello,
    You need to increase the pool size via Visual Administrator.
    Server 0 -> Services -> JCO RFC Connections.
    Change the pool size from there. I believe a restart is in order.
    Regards,
    Jan

  • Connection pool not re-establishing connections, throwing exception instead

    Hello,
    I've just set up a connection pool on the sun java system application server 8 for a MySQL database using the official mysql-connector/j 5.0. Everything is working great, except when the connections timeout (or i kill them all manually from the database server) and then request a page that needs to use the DataSource object, the following exception is thrown:
    Exception thrown: com.mysql.jdbc.CommunicationsException -- Communications link failure due to underlying exception:
    ** BEGIN NESTED EXCEPTION **
    java.io.EOFException
    STACKTRACE:
    java.io.EOFException
         at com.mysql.jdbc.MysqlIO.readFully(MysqlIO.java:1913)
         at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:2304)
         at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2803)
         at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1573)
         at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1665)
         at com.mysql.jdbc.Connection.execSQL(Connection.java:3118)
         at com.mysql.jdbc.Connection.execSQL(Connection.java:3047)
         at com.mysql.jdbc.Statement.executeQuery(Statement.java:1166)
         at com.mysql.jdbc.jdbc2.optional.StatementWrapper.executeQuery(StatementWrapper.java:705)
         at beans.MySessionBean.businessMethod(MySessionBean.java:73)
         at org.apache.jsp.index_jsp._jspService(index_jsp.java:70)
         at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:105)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:860)
         at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:336)
         at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:301)
         at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:251)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:860)
         at sun.reflect.GeneratedMethodAccessor98.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:249)
         at java.security.AccessController.doPrivileged(Native Method)
         at javax.security.auth.Subject.doAsPrivileged(Subject.java:517)
         at org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:282)
         at org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:165)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:257)
         at org.apache.catalina.core.ApplicationFilterChain.access$000(ApplicationFilterChain.java:55)
         at org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChain.java:161)
         at java.security.AccessController.doPrivileged(Native Method)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:263)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:551)
         at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:225)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:173)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:551)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:161)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:551)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:132)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:551)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:933)
         at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:185)
         at com.sun.enterprise.web.connector.grizzly.ProcessorTask.process(ProcessorTask.java:653)
         at com.sun.enterprise.web.connector.grizzly.ProcessorTask.process(ProcessorTask.java:534)
         at com.sun.enterprise.web.connector.grizzly.ProcessorTask.doTask(ProcessorTask.java:403)
         at com.sun.enterprise.web.connector.grizzly.WorkerThread.run(WorkerThread.java:55)
    ** END NESTED EXCEPTION **
    Last packet sent to the server was 16 ms ago.What could be wrong?
    Thank you.

    The code is here:
        public String businessMethod() {
            //TODO implement businessMethod
            try
                InitialContext ic = new InitialContext();
                Object obj = ic.lookup("jdbc/MyDS");
                System.out.println("Object is: " + obj + " | Class is: " + obj.getClass().getName());
                DataSource ds = (DataSource)obj;
                Connection conn = ds.getConnection();
                Statement stmt = conn.createStatement();
                ResultSet rs = stmt.executeQuery("SELECT a,b FROM test");
                String ret = "";
                while(rs.next())
                    ret += rs.getString(1) + " - " + rs.getString(2) + "<br/>";
                conn.close();
                return ret;
            catch(Exception e)
                return "Exception thrown: " + e.getClass().getName() + " -- " + e.getMessage();
        }On the server, it is set up as XADataSource. I don't really have a big need for distributed transactions, but does it hurt badly to use it anyways? Could it be causing this problem?

  • Problem in DBCP Connection Pooling with BLOB in Tomcat

    Hi All,
    I am using the DBCP connection pooling in tomcat server version 6.0.18.
    I have session table which maintains the session details of the user in BLOB column. Recently I am facing a problem. When a user logs in, I am storing the session details in the DB. It throws an exception like this. When I restart the tomcat, it just works fine. But after some days it is again throwing the same exception.
    Code:
    2009-01-27 06:03:13,789 DEBUG [org.springframework.jdbc.core.JdbcTemplate] - Executing prepared SQL statement [INSERT INTO SESSION (SESSION_CODE,LAST_ACCESS,VALID_SESSION,SESSION_DATA) VALUES(?,?,?,?)]
    2009-01-27 06:03:13,789 DEBUG [org.springframework.transaction.support.TransactionSynchronizationManager] - Retrieved value [org.springframework.jdbc.datasource.ConnectionHolder@154136a] for key [org.apache.commons.dbcp.BasicDataSource@bdec44] bound to thread [http-8443-6]
    2009-01-27 06:03:13,789 DEBUG [org.springframework.jdbc.core.StatementCreatorUtils] - Setting SQL statement parameter value: column index 1, parameter value [c2896a488efb7fe15430fab10d502577], value class [java.lang.String], SQL type unknown
    2009-01-27 06:03:13,789 DEBUG [org.springframework.jdbc.core.StatementCreatorUtils] - Setting SQL statement parameter value: column index 2, parameter value [1233064993], value class [java.lang.Long], SQL type unknown
    2009-01-27 06:03:13,789 DEBUG [org.springframework.jdbc.core.StatementCreatorUtils] - Setting SQL statement parameter value: column index 3, parameter value [1], value class [java.lang.Integer], SQL type unknown
    2009-01-27 06:03:13,789 DEBUG [org.springframework.jdbc.core.StatementCreatorUtils] - Setting SQL statement parameter value: column index 4, parameter value [org.springframework.jdbc.core.support.SqlLobValue@18af32e], value class [org.springframework.jdbc.core.support.SqlLobValue], SQL type 2004
    2009-01-27 06:03:13,789 DEBUG [org.springframework.jdbc.support.lob.DefaultLobHandler] - Set bytes for BLOB with length 390
    2009-01-27 06:03:13,789 DEBUG [org.springframework.transaction.support.TransactionSynchronizationManager] - Retrieved value [org.springframework.jdbc.datasource.ConnectionHolder@154136a] for key [org.apache.commons.dbcp.BasicDataSource@bdec44] bound to thread [http-8443-6]
    2009-01-27 06:03:13,790 DEBUG [org.springframework.transaction.support.TransactionSynchronizationManager] - Retrieved value [org.springframework.jdbc.datasource.ConnectionHolder@154136a] for key [org.apache.commons.dbcp.BasicDataSource@bdec44] bound to thread [http-8443-6]
    2009-01-27 06:03:13,790 DEBUG [org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator] - Unable to translate SQLException with Error code '17410', will now try the fallback translator
    2009-01-27 06:03:13,790 INFO [web.controller.LoginController] - Caught Exception while creating sesion in DB
    2009-01-27 06:03:13,790 DEBUG [org.springframework.jdbc.datasource.DataSourceTransactionManager] - Triggering beforeCompletion synchronization
    2009-01-27 06:03:13,790 DEBUG [org.springframework.jdbc.datasource.DataSourceTransactionManager] - Initiating transaction rollback
    2009-01-27 06:03:13,790 DEBUG [org.springframework.jdbc.datasource.DataSourceTransactionManager] - Rolling back JDBC transaction on Connection [jdbc:oracle:thin:@stagedb1c:2115:WEB1C, UserName=WEBAPP, Oracle JDBC driver]
    2009-01-27 06:03:13,791 DEBUG [org.springframework.jdbc.datasource.DataSourceTransactionManager] - Triggering afterCompletion synchronization
    2009-01-27 06:03:13,791 DEBUG [org.springframework.transaction.support.TransactionSynchronizationManager] - Clearing transaction synchronization
    2009-01-27 06:03:13,791 DEBUG [org.springframework.transaction.support.TransactionSynchronizationManager] - Removed value [org.springframework.jdbc.datasource.ConnectionHolder@154136a] for key [org.apache.commons.dbcp.BasicDataSource@bdec44] from thread [http-8443-6]
    2009-01-27 06:03:13,791 DEBUG [org.springframework.jdbc.datasource.DataSourceTransactionManager] - Releasing JDBC Connection [connection is closed] after transaction
    2009-01-27 06:03:13,791 DEBUG [org.springframework.jdbc.datasource.DataSourceUtils] - Returning JDBC Connection to DataSource
    2009-01-27 06:03:13,791 DEBUG [org.springframework.jdbc.datasource.DataSourceUtils] - Could not close JDBC Connection
    java.sql.SQLException: Already closed.
    at org.apache.commons.dbcp.PoolableConnection.close(PoolableConnection.java:84)
    at org.apache.commons.dbcp.PoolingDataSource$PoolGuardConnectionWrapper.close(PoolingDataSource.java:181)
    at org.springframework.jdbc.datasource.DataSourceUtils.doReleaseConnection(DataSourceUtils.java:313)
    at org.springframework.jdbc.datasource.DataSourceUtils.releaseConnection(DataSourceUtils.java:274)
    at org.springframework.jdbc.datasource.DataSourceTransactionManager.doCleanupAfterCompletion(DataSourceTransactionManager.java:316)
    at org.springframework.transaction.support.AbstractPlatformTransactionManager.cleanupAfterCompletion(AbstractPlatformTransactionManager.java:966)
    at org.springframework.transaction.support.AbstractPlatformTransactionManager.processRollback(AbstractPlatformTransactionManager.java:832)
    at org.springframework.transaction.support.AbstractPlatformTransactionManager.rollback(AbstractPlatformTransactionManager.java:777)
    at web.controller.LoginController.onSubmit(LoginController.java:109)
    at org.springframework.web.servlet.mvc.SimpleFormController.processFormSubmission(SimpleFormController.java:267)
    at org.springframework.web.servlet.mvc.AbstractFormController.handleRequestInternal(AbstractFormController.java:265)
    at org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:153)
    at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:48)
    at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:875)
    at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:809)
    at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:571)
    at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:511)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)
    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
    at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
    at java.lang.Thread.run(Thread.java:595)
    My Session table has the following structure:
    Code:
    Name Null? Type
    SESSION_CODE NOT NULL VARCHAR2(100)
    LAST_ACCESS NOT NULL NUMBER
    VALID_SESSION NOT NULL NUMBER
    SESSION_DATA NOT NULL BLOB
    I have the following in the Spring context file :
    Code:
    <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
    <property name="driverClassName" value="${jdbc.driverClassName}"/>
    <property name="url" value="${jdbc.url}"/>
    <property name="username" value="${jdbc.username}"/>
    <property name="password" value="${jdbc.password}"/>
    <property name="initialSize" value="5"/>
    <property name="maxActive" value="5"/>
    <property name="minIdle" value="2"/>
    <property name="poolPreparedStatements" value="true"/>
    <property name="defaultAutoCommit" value="false"/>
    </bean>
    I am using the oracle.jdbc.driver.OracleDriver as jdbc driver. And also using the commons-dbcp-1.2.2.jar and ojdbc14.jar.
    Can some one help me out to solve this issue?
    Thanks in Advance.

    I am also facing the same problem, please let me know if there any suggestions,
    DEBUG|2010-05-07 16:41:25,866|main|(SQLErrorCodeSQLExceptionTranslator.java:266)|org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator|Unable to translate SQLException with Error code '17410', will now try the fallback translator
    DEBUG|2010-05-07 16:41:25,866|main|(SQLStateSQLExceptionTranslator.java:94)|org.springframework.jdbc.support.SQLStateSQLExceptionTranslator|Extracted SQL state class '08' from value '08000'
    thanks
    sundaravel n

Maybe you are looking for