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.

Similar Messages

  • JDBC connection pool failures when used by JMS stores

              We are using WebLogic 6.1 sp2. We defined a separate connection pool for use by
              a JMS Store.
              <JDBCConnectionPool Name="sybaseJMSPool"
              Targets="cluster00"
              InitialCapacity="2"
              MaxCapacity="10"
              DriverName="com.sybase.jdbc2.jdbc.SybDriver"
              Properties="[email protected]@;[email protected]@;charset=utf8"
              URL="jdbc:sybase:Tds:@jms.db.host@/@jms.db.name@"/>
              (note that the @xxx@ string are replaced by actual values).
              We are using Sybase Jconnect 5.5 to a Sybase ASE 12.5 database.
              We deployed this configuration on a number of environments (testing, staging,
              ..). The actual hardware and network configuration is different for the different
              system, but the WebLogic domain stays the same regarding this issue.
              On the test system we frequently get the following exceptions:
              <Aug 13, 2002 1:56:04 PM CEST> <Alert> <JMS> <www00-test> <node00>
              <ExecuteThread: '6' for queue: 'JMS.TimerClientPool'> <> <> <040048>
              <JMSServer "JMSServer00", store failure while writing message for topic
              OrderChangeTopic, java.io.IOException: JMS JDBC store, connection pool =
              <sybaseJMSPool>, prefix = <JMS00>: write failed
              java.sql.SQLException: JZ006: Caught IOException:
              com.sybase.jdbc2.jdbc.SybConnectionDeadException: JZ0C0: Connection is already
              closed.
              at com.sybase.jdbc2.jdbc.ErrorMessage.raiseErrorCheckDead
              (ErrorMessage.java:715)
              at com.sybase.jdbc2.tds.Tds.handleIOE(Tds.java:3124)
              at com.sybase.jdbc2.tds.Tds.cancel(Tds.java:1412)
              at com.sybase.jdbc2.tds.Tds.cancel(Tds.java:1341)
              at com.sybase.jdbc2.jdbc.SybStatement.doCancel(SybStatement.java:564)
              at com.sybase.jdbc2.jdbc.SybStatement.updateLoop(SybStatement.java:1672)
              at com.sybase.jdbc2.jdbc.SybStatement.executeUpdate
              (SybStatement.java:1625)
              at com.sybase.jdbc2.jdbc.SybPreparedStatement.executeUpdate
              (SybPreparedStatement.java:91)
              at com.p6spy.engine.logging.P6LogPreparedStatement.executeUpdate
              (P6LogPreparedStatement.java:179)
              at weblogic.jdbc.pool.Statement.executeUpdate(Statement.java:293)
              at weblogic.jms.store.JDBCIOStream.write(JDBCIOStream.java:1246)
              at weblogic.jms.store.StoreRequest.doTheIO(StoreRequest.java:250)
              at weblogic.jms.store.JMSStore.execute(JMSStore.java:182)
              at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
              at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
              .>
              java.io.IOException: JMS JDBC store, connection pool = <sybaseJMSPool>, prefix
              = <JMS00>: write failed
              java.sql.SQLException: JZ006: Caught IOException:
              com.sybase.jdbc2.jdbc.SybConnectionDeadException: JZ0C0: Connection is already
              closed.
              at com.sybase.jdbc2.jdbc.ErrorMessage.raiseErrorCheckDead
              (ErrorMessage.java:715)
              at com.sybase.jdbc2.tds.Tds.handleIOE(Tds.java:3124)
              at com.sybase.jdbc2.tds.Tds.cancel(Tds.java:1412)
              at com.sybase.jdbc2.tds.Tds.cancel(Tds.java:1341)
              at com.sybase.jdbc2.jdbc.SybStatement.doCancel(SybStatement.java:564)
              at com.sybase.jdbc2.jdbc.SybStatement.updateLoop(SybStatement.java:1672)
              at com.sybase.jdbc2.jdbc.SybStatement.executeUpdate
              (SybStatement.java:1625)
              at com.sybase.jdbc2.jdbc.SybPreparedStatement.executeUpdate
              (SybPreparedStatement.java:91)
              at com.p6spy.engine.logging.P6LogPreparedStatement.executeUpdate
              (P6LogPreparedStatement.java:179)
              at weblogic.jdbc.pool.Statement.executeUpdate(Statement.java:293)
              at weblogic.jms.store.JDBCIOStream.write(JDBCIOStream.java:1246)
              at weblogic.jms.store.StoreRequest.doTheIO(StoreRequest.java:250)
              at weblogic.jms.store.JMSStore.execute(JMSStore.java:182)
              at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
              at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
              at weblogic.jms.store.JDBCIOStream.throwIOException
              (JDBCIOStream.java:1213)
              at weblogic.jms.store.JDBCIOStream.write(JDBCIOStream.java:1256)
              at weblogic.jms.store.StoreRequest.doTheIO(StoreRequest.java:250)
              at weblogic.jms.store.JMSStore.execute(JMSStore.java:182)
              at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
              at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
              Before that this message appeared:
              <Aug 13, 2002 11:31:16 AM CEST> <Error> <ConnectionManager> <www00-test>
              <node00> <ExecuteThread: '26' for queue: 'default'> <> <> <000000>
              <Closing: 'weblogic.rjvm.t3.T3JVMConnection@795af6' because of: 'Server
              received a message over an uninitialized connection: 'JVMMessage from: 'null'
              to: '-4555218188801970213S:192.168.13.1:[7001,7001,7002,7002,7001,7002,-
              1]:ADIS:node00' cmd: 'CMD_REQUEST', QOS: '101', responseId: '1',
              invokableId: '287', flags: 'JVMIDs Not Sent, TX Context Not Sent', abbrev
              offset: '34'''>
              This problem did not occur on another system which was used during a 2 day stress
              testing session.
              It seems that the problem occurs after a period in which no user request where
              made. The user requests trigger EJB's that start sending JMS messages.
              When the problem occurs, the JMS messaging systems seems to lock up as no messages
              are received anymore by the different listeners (MDBs).
              Undeploying and redeploying the JBDC connection pool solves the problem. This
              solution is unacceptable in case of a production system.
              A similarly defined connection pool, which is used by the EJBs to make database
              connection, does not manifest this problem.
              <JDBCConnectionPool Name="sybasePool"
              Targets="cluster00"
              InitialCapacity="10"
              CapacityIncrement="5"
              MaxCapacity="50"
              PreparedStatementCacheSize="150"
              DriverName="com.sybase.jdbc2.jdbc.SybDriver"
              Properties="[email protected]@;[email protected]@;JCONNECT_VERSION=6;charset=utf8"
              URL="jdbc:sybase:Tds:@db.host@/@db.name@"/>
              The JDBC connection pool is used as follows by the JDBC store
              <JMSJDBCStore ConnectionPool="sybaseJMSPool" Name="JDBCStore00" PrefixName="JMS00"/>
              <JMSServer Name="JMSServer00" Store="JDBCStore00" Targets="node00">
              <JMSTopic JNDIName="ADIS.JMSError" JNDINameReplicated="false" Name="ErrorTopic"/>
              <JMSTopic JNDIName="ADIS.Status"
              Name="StatusTopic" RedeliveryDelayOverride="300000"/>
              <JMSTopic JNDIName="ADIS.OrderChange" JNDINameReplicated="false"
              Name="OrderChangeTopic" RedeliveryLimit="3"/>
              </JMSServer>
              Turning on the "Test Reserved Connection" with a appropriate test table does not
              help.
              Some sources on the internet tell us that JZ0C0 errors in the Jconnect driver
              can be related to network problems. Nevertheless the connection pool should be
              able to cope with this.
              Can you provide any solution for this ? Or give us hints what can cause the problem
              

    Zhenhao Qi wrote:
    thanks! Joe.
    The SQL statement itself can no longer be simplified, the long excuation time is due to the database size and complicated Select criteria. I can easily reproduce the problem by using this SQL. I tried "BEA's Oracle driver (Type 4): Version 8.1.7,9.0.1,9.2.0". the question can be dissect into 2 pieces:
    1) why the jdbc connection (using oracle.jdbc.OracleDriver) won't return anything if the SQL execution time > 5min, that is probably the Oracle's problem
    2) why the occupied connection pool won't release even I set "Statementtimeout=600", this is Weblogic's problem.
    ZhenhaoHi. Yes, (1) is oracle's problem. (2) may also be. The JDBC spec has very few
    allowances for one thread to interrupt a second thread's JDBC call. If we
    transmit your timeout request by calling setQueryTimeout() on the oracle
    statement, and if you have a weblogic-controlled transaction we call
    Statement.cancel() on any ongoing statement, we end up relying on whether
    the Oracle driver implements and responds to those calls.
    Are you doing weblogic-controlled transactions? Are you/can you
    call Statement.setQueryTimeout() on your statements, or are these
    generated JDBC queries?
    If you can duplicate the problem using the weblogic.jdbc.oracle.OracleDriver
    we have some other debug avenues. This would be good even if you really
    want to use the thin driver, because we will do the same JDBC calls to
    either driver, and the debug would prove (if) we set up a query timeout
    and if we call cancel(). If we do, then we can know that it is the Oracle
    driver failing in these regards.
    Joe

  • Oracle Connection Pool failure in COM+

    I am having some trouble trying to get a specific database to work with an application that makes use of a COM+ Application. When we point the application at the UAT database everything seems fine, but when we point it to the production database after a few successful calls it ends up failing at the COM+ application recycles. The event viewer provides the following information:
    Event Type:     Error
    Event Source:     COM+
    Event Category:     Unknown
    Event ID:     4786
    Date:          8/5/2007
    Time:          12:54:46 PM
    User:          N/A
    Computer:     APPL_SERVER
    Description:
    The system has called a custom component and that component has failed and generated an exception. This indicates a problem with the custom component. Notify the developer of this component that a failure has occurred and provide them with the information below.
    Component Prog ID: Oracle Connection Pool - tnsnames_alias
    Method Name: IDispenserDriver::CreateResource
    Server Application ID: {30A93CB3-25EB-4258-8C88-5AE103B7B86F}
    Server Application Instance ID:
    {A57C513E-519F-45BD-B46D-DC54B285F534}
    Server Application Name: COM+ Application Name
    The serious nature of this error has caused the process to terminate.
    Exception: C0000005
    Address: 0x7C8327F9
    Call Stack:
    + 0x7c8327f9
    ntdll!RtlFindActivationContextSectionGuid + 0x7d2
    ntdll!RtlInitializeSListHead + 0x175
    ntdll!RtlFindActivationContextSectionGuid + 0x1b7
    msvcrt!malloc + 0x6c
    oracommon9!sktsfMalloc + 0x14
    orageneric9!kpummapg + 0x58
    orageneric9!kghalo + 0xabb
    orageneric9!kghalf + 0x102
    orageneric9!kopo2cpc + 0x61
    orageneric9!kopeini + 0x1d
    orageneric9!kopo2cpc + 0xd2
    orageneric9!kopopgi + 0x117
    OraClient9!koudpnp + 0x712
    OraClient9!koudpnp + 0x101
    OraClient9!kpuinit0 + 0xb19
    OraClient9!kpuinit + 0x38
    OraClient9!OCIEnvInit + 0x1c
    oramts!kpntsrvr::kpntsrvr(class kpntdbid *) + 0x80
    oramts!kpntdbid::allocNewSrvr(struct SIDAND_ATTRIBUTES *) + 0x138
    oramts!kpntdbid::GetSrvr(class kpntsvrl * *,unsigned long) + 0x7df
    oramts!kpntdisp::getNet8conn(class kpntsvrl * *,unsigned long) + 0x41
    oramts!kpntsess::initOCI(void) + 0xec
    oramts!kpntsess::sessionBegin(void) + 0x17b
    oramts!kpntdisp::CreateResource(unsigned long,unsigned long *,long *) + 0xc4
    COMSVCS!DispManGetContext + 0xa3d
    COMSVCS!DispManGetContext + 0x1fee
    oramts!kpntdisp::allocateConnection(class kpntsess * *,unsigned long,class kpntrtyp *) + 0x3c4
    oramts!_kpntsvcgetex + 0x183
    oramts!_kpntsvcget + 0x25
    oramts!kpntctra::getConnectionAndHandles(class kpntrtyp *,struct OCISvcCtx * *,struct OCITrans * *,struct OCIError * *) + 0x87
    oramts!kpntctra::abortBranch(struct xid_t &,class kpntbrnch *,struct BOID *,int,struct BOID *) + 0x15a
    oramts!kpntctra::doAbort(struct BOID *,int,struct BOID *) + 0x454
    oramts!kpntajob::doJob(void) + 0x27
    oramts!kpntjobq::serviceRequest(class kpntjob *) + 0x3e
    oramts!workerThread(void *) + 0xd0
    msvcrt!_endthreadex + 0xa3
    kernel32!GetModuleFileNameA + 0xeb
    Not being an expert in Oracle, I have been able to dig up a little bit of information that might be of use ...
    a) Our tnsnames.ora indicates that the connections are to be DEDICATED and running Toad bares this out -- dllhost ends up with a single connection.
    b) most of the database initial set of parameters seem to be very similar. The only difference I noticed was that the archive log mode and db_cache_advice are ON for production.
    c) We have little control over how the connection strings are being created internally in this COM+ application, but however they are created it works for UAT and doesn't for PROD.
    d) When we go into our web application and hit a page that makes use of the COM+ component to render, it will work the first time but when I do a simple browser refresh it will usually fail on the 2nd or 3rd time. Almost like it is trying to expand the connection pool size and the oracle server is throwing up.
    If I didn't mention earlier the two database instances run on different servers but the application server is exactly the same. We only change the alias we are using for the database (both are defined in tnsnames) and the password used to make its connection.
    Does anyone have any clues on this one? I am really spinning my wheels trying to figure out what could cause this type of situation. Anything at all would be very helpful.

    It appeared to us that the problem was with the Oracle server and that it might have been failing when we were trying to expand our application connection pool size or basically obtain more connections.
    The biggest indicator of this is that we run the same application code against two different databases and one works and one does not work. Having said this, I suppose the problem could be rooted in a data error instead of an oracle server error ...
    Is there a specific trace file on the oracle server that would help me point to any error that is truly an oracle server error? Sorry I am very new to Oracle.

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

  • 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

  • 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

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

  • HELP - DB2 v9 & App Server PE 9.0 - PING Connection Pool Failure - HELP

    I've been playing around with Studio Creator and DB2 v9 without any issues.
    So I figured I would installed App Server PE 9 and use this as my production server that I would deploy to from studio creator.
    However, in my efforts to set up db2/v9 I have been trying to ping a connection pool without any luck. I get the following message:
    Operation 'pingConnectionPool' failed in 'resources' Config Mbean. Target exception message: Connection could not be allocated because: [sunm][DB2 JDBC Driver]Resource Limits Reached( ALLOCATE MEMORY FOR NEW SQLSTT FAILED ). Diagnostic Info: FUNCTION ID = 0049 , PROBE POINT = 0400 , TRACE POINT = 0030 , SUBCODE1 = 8B0F0000, SUBCODE2 = 78A68A98, SUBCODE3 = 00000000, ERROR MSG = Parser: Memory allocation error.
    My datasource class name is com.sun.sql.jdbcx.db2.DB2DataSource.
    And my resource type is javax.sql.datasource
    I have copied smbase.jar, smdb2.jar and smutil.jar into c:\sun\appserver\lib
    and I have all of the properties (serverName, portNumber, databaseName, user, password) created and set accordingly.
    Any help would be greatly appreciated.

    Here is how I got the DB2 Express-C and Sun PE 9.0 to work. ( at least base connectivity wise )
    1. ) You have to have at least the DB2 Client installed on the system that will be communicating to the DB2 instance.
    2.) The following jars will be needed ( depending on the driver type used) . db2java.zip, db2jcc.jar, and db2jcc_license_cu.jar and use them in the App Server ->JVM settings -> Path Settings -> Classpath Suffix
    3.) The next setup is dependent on the Type driver you use
    I used the Type 4 and this is the resource setup I used.
    Connection Pool:
    Name: DB2TestPool
    Datasource Classname: com.ibm.db2.jcc.DB2SimpleDataSource
    Resource Type: javax.sql.ConnectionPoolDataSource
    Properties:
    user: xxxxxx
    password: xxxxxx
    databaseName: TEST
    serverName: <hostname of machine>
    portnumber: 50000
    driverType: 4
    URL: jdbc:db2://<hostname>:<port>/<database>
    JDBC Resource:
    JNDI Name: jdbc/TEST
    Pool Name: DB2TestPool
    With this configuration I was able to ping the database as well as connect to create an entity bean from a table. This should give you a starting point.
    I have yet to deploy my application, but should be doing that sometime today to verify that a connection can be made and used from within the application.

  • Create and Apply new connection pool failure

    Hi all,
    I am trying to creat a new connection pool by the examples Console with WebServer
    6.0
    Name: testingPool
    URL: jdbc:cloudscape:demo or jdbc:dbc:cloudscape:Test (where Test is a new DB
    in cloudscape)
    Driver Name:COM.cloudscape.core.JDBCDriver
    Property:
    user=none
    password=none
    server=none
    Then create a Datasource which using the new created testingPool and the Target
    is the "exampleServer"
    However when I start the server,it keeps on complaining that the "testingPool
    is not exist".
    Any setting that I 've missed when using a new connection pool??
    I only know the workaround is using the demoPool which is already exist in the
    example.
    Any help will be very appreciate!!
    Thanks !
    Regards,
    u0p1

    HI,
    I've already set the Target Server to be the Example Server,
    is it wrong?
    "Sree Bodapati" <[email protected]> wrote:
    Check if you have set a target server for the connection pool.
    sree
    "u0p1" <[email protected]> wrote in message
    news:3bb3bc32$[email protected]..
    Hi all,
    I am trying to creat a new connection pool by the examples Consolewith
    WebServer
    6.0
    Name: testingPool
    URL: jdbc:cloudscape:demo or jdbc:dbc:cloudscape:Test (where Test isa new
    DB
    in cloudscape)
    Driver Name:COM.cloudscape.core.JDBCDriver
    Property:
    user=none
    password=none
    server=none
    Then create a Datasource which using the new created testingPool andthe
    Target
    is the "exampleServer"
    However when I start the server,it keeps on complaining that the"testingPool
    is not exist".
    Any setting that I 've missed when using a new connection pool??
    I only know the workaround is using the demoPool which is already existin
    the
    example.
    Any help will be very appreciate!!
    Thanks !
    Regards,
    u0p1

  • 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

  • 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

  • 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

  • Oracle.DataAccess 2.112.1.0 - Connection Pool Problem

    Hi,
    Oracle.DataAccess 2.112.1.0 is having connection pool problem. The no. of TCP connections to Oracle database keep increasing untill the server's session run out of limit. My application created connections, use them, close them, and dispose them properly. When using previous Oracle.DataAccess 2.111.6.20, the no. of TCP connections do not increase.
    My database connection string has "Min Pool Size = 3 and Max Pool Size = 150".
    With 2.111.6.20 version, TCP connection stays at 3.
    With 2.112.1.0, TCP connection keep increasing for every 5 minutes. I've tried to disable Self Tuning, but still can't prevent the connections from increasing.
    Later today, I downloaded Oracle.DataAccess 2.112.1.2 (it comes with ODAC 11.2.0.1.2) and test again, the problem is resolved... no more connection increases... but.... it is only for 32 bit Windows.
    Unfortunately, there is no Oracle.DataAccess 2.112.1.2 for 64 bit Windows Server 2008.
    May I know how can i resolve this problem on 64bit Window installed with Oracle 11g R2 client, which comes with Oracle.DataAccess 2.112.1.0, which has serious problems...(according to this 11.2 ODP.NET causing test runner failures )
    Many thanks for your time and answers!
    Edited by: user1502907 on 04-Sep-2010 23:01

    Hi,
    The only thing that jumps out within your problem description is that connections are being increased every 5 minutes. Are you sure its every 5 minutes and not 3 minutes which is the timing interval used by the Connection Pool facility to perform connection pool maintenance. If this occurs even when the application is idle then you could be running into the following known issue filed against 11.2.0.1.0 and fixed in 11.2.0.1.2.
    Bug 9711600 - CONNECTIONS INCREASE BEYOND MAX POOL SIZE EVERY 3 MINUTE
    This is specific to using the option CommandBehavior.CloseConnection when calling execute reader. Are you using this option and then also closing the connection in code before the datareader object is closed, if so you may be hitting this bug. You can also generate an ODP trace at level 15 of the behavior and if you see negative pool counts, that is also a diagnostic that points to this bug.
    This is fixed in 11.2.0.1.0 Patch 3 or later for x64. If you have support, I recommend you open a service request to verify if this is your issue and if a patch set may help you.
    Regards
    Jenny B.

  • 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

Maybe you are looking for