JSTL, Connection Pooling

I am busy setting up connection pooling in my jboss.
Our applications are not that hardcore, so we mostly use JSTL and JavaBeans. But we never used pooling before.
Can i still use connection pooling with my jstl >
<sql:query dataSource="PostgresDS"/>
or must i do all my db connections in a javabean?
where can i find an example of how to use connection pooling?

The server will handle the connection pooling aspect for you.
It looks like you are already using a JNDI datasource lookup method.
As long as the dataSource specified is a "connection pooling datasource" it will be connection pooling.
No code change should be required.

Similar Messages

  • Mvc - connection pool - jstl - oh my!

    I am trying to understand how to use the mvc model to break my existing jsp's up. I finally got my connection pool working yesterday(yay!) so now I want to get everything organized into servlets. My understanding of servlets sucks - and I have not written one yet. Researching it on the net hasnt helped much - a bit overwhelming..
    Please tell me if my logic is on track or not - keeping in mind the mvc model - keeping in mind I dont know how to write a servlet : )
    DATABASE package;
    public static dbpool getConnection() {
         // write JNDI information
    public static void dbpoolClose(Connection connDB) {
         // close connection
    }Then in a servlet I would try to write something like this...
    MyBean {
    // call the connection method
    - do crud operations
    - use getters and setters
    - close statements that I have open
    // call the close connection method
    }Then in my JSP( I have JSTL working YAY!!) I wil call the bean/getters/setters and use JSTL to manipulate and present the data? Is this close to being in the MVC model?
    I havent found an example using the mvc using a connection pool, database operations and a jsp - that I have been able to understand.. so If I am waay off.. sorry.

    Basically, use the servlet to tell other classes what to do (these can be other servlets or whatever).
    Those classes prepare the data you want to have the JSPs show and process the data returned from the JSPs.
    The JSP does nothing except display data presented to it by the servlet (and may have URLs or forms to provide input to servlets.
    At its simplest, there's no controller at all (so no C). A JSP calls a servlet which processes the data sent to it and prepares new data for another (or the same) JSP to which it forwards the request when done.
    That data can be stored in the Http session or (sometimes) better in the request.
    More usually, a controller will receive all requests from and determine to what servlet to send them.
    The servlet then either determines on its own to which JSP to send the results or gives those results back to the controller which will do that for them and forward to the proper JSP.
    If needed you can thus chain requests so that a request goes to a servlet, from there to another servlet and then to a JSP (for example), each time via the controller.
    This can be handy to break up complex processing in small steps where those small steps could also occur separate.

  • Unable to create connection pooling

    hello everyone,
    i am trying to implement connection pooling with sybase as the database and tomcat 5 as the container. But this is the exception thats coming :
    javax.naming.NameNotFoundException: Name jdbc/TestDB2 is not bound in
    this Context
    My server.xml looks lilke this :
         <Context path="/DBTest2" docBase="DBTest2" debug="5" reloadable="true" crossContext="true" >
         <Logger classname="org.apache.catalina.logger.FileLogger"
              prefix="localhost_DBTest2_log." suffix=".txt" timestamp="true" />     
         <Resource name="jdbc/TestDB2" auth="Container" type="javax.sql.DataSource" />
         <ResourceParams name="jdbc/TestDB2">
              <parameter>
              <name>factory</name>
              <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
              </parameter>
              <parameter>
              <name>maxActive</name>
              <value>100</value>
              </parameter>
              <parameter>
              <name>maxIdle</name>
              <value>30</value>
              </parameter>
              <parameter>
              <name>maxWait</name>
              <value>10000</value>
              </parameter>
              <parameter>
              <name>username</name>
              <value>sa</value>
              </parameter>
              <parameter>
              <name>password</name>
              <value></value>
              </parameter>
              <parameter>
              <name>driverClassName</name>
              <value>com.sybase.jdbc2.jdbc.SybDriver</value>
              </parameter>
              <parameter>
              <name>url</name>
              <value>jdbc:sybase:Tds:172.16.12.84:2048/lnk_common_dd</value>
              </parameter>
         </ResourceParams>     
         </Context>
    This is my web.xml
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <!DOCTYPE web-app
    PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
    "http://java.sun.com/dtd/web-app_2_3.dtd">
    <web-app xmlns="http://java.sun.com/xml/ns/j2ee"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
    http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
    version="2.4">
    <description>MySQL Test App</description>
    <resource-ref>
    <description>DB Connection</description>
    <res-ref-name>jdbc/TestDB2</res-ref-name>
    <res-type>javax.sql.DataSource</res-type>
    <res-auth>Container</res-auth>
    </resource-ref>
    </web-app>
    this is my test.jsp
    <%@ taglib uri="http://java.sun.com/jsp/jstl/sql" prefix="sql" %>
    <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
    <sql:query var="rs" dataSource="jdbc/TestDB2">
    select id, foo, bar from testdata
    </sql:query>
    <html>
    <head>
    <title>DB Test</title>
    </head>
    <body>
    <h2>Results</h2>
    <c:forEach var="row" items="${rs.rows}">
    Foo ${row.foo}
    Bar ${row.bar}
    </c:forEach>
    </body>
    </html>
    Any help would be much appreciated as i am stuck with this since the last 2 days
    thanking you all in advance
    Bhavani

    Hi Karthikeyan,
    This is not the issue at all. I can open the management studio by the same login id and password and also i can make the database jdbc connection from plain java file.
    It does not give me any problem by them.
    I'm unable to find the actual problem. May be i'm missing something in connection pooling.
    Please help.
    Regards
    Mina

  • Tomcat 5.0.* global JNDI database connect pooling. complex config question

    Ok. I can't get global connection pooling to work in tomcat 5.0.24. (I am running windows xp pro)
    I am using MySQL (installed on the same machine) and I have succesfully worked through the tutorial titled "MySQL DBCP Example" found at http://jakarta.apache.org/tomcat/tomcat-5.0-doc/jndi-datasource-examples-howto.html
    This example does not demonstrate global connection pooling, however. I want to share a single connection pool across all my web applications. I don't want a different connection pool for each webapp.
    So I define the connection pool JDBC resource in the conf/server.xml file under the <GlobalNamingResources> element.
    Here is the entire <GlobalNamingResources> element lifted from conf/server.xml:
    (Please overlook some of the formatting mistakes due to the <code> tag interpreting the xml as java.)
    <!-- Global JNDI resources -->
    <GlobalNamingResources>
        <Environment name="simpleValue" type="java.lang.Integer" value="30"/>
        <Resource name="UserDatabase"
                  auth="Container"
                  type="org.apache.catalina.UserDatabase"
                  description="User database that can be updated and saved">
        </Resource>
        <Resource name="jdbc/MySQL"
                  auth="Container"
                  type="javax.sql.DataSource"/>
        <ResourceParams name="UserDatabase">
            <parameter>
                <name>factory</name>
                <value>org.apache.catalina.users.MemoryUserDatabaseFactory</value>
            </parameter>
            <parameter>
                <name>pathname</name>
                <value>conf/tomcat-users.xml</value>
            </parameter>
        </ResourceParams>
        <ResourceParams name="jdbc/MySQL">
            <parameter>
                <name>factory</name>
                <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
            </parameter>
            <parameter>
                <name>maxActive</name>
                <value>100</value>
            </parameter>
            <parameter>
                <name>maxIdle</name>
                <value>30</value>
            </parameter>
            <parameter>
                <name>maxWait</name>
                <value>20000</value>
            </parameter>
            <parameter>
               <name>username</name>
               <value>webapp</value>
            </parameter>
            <parameter>
               <name>password</name>
               <value>******</value>
            </parameter>
            <parameter>
                <name>removeAbandoned</name>
                <value>true</value>
            </parameter>
            <parameter>
                <name>removeAbandonedTimeout</name>
                <value>3000</value>
            </parameter>
            <parameter>
                <name>logAbandoned</name>
                <value>true</value>
            </parameter>
            <parameter>
                <name>url</name>
                <value>jdbc:mysql://localhost:3306/javatest?autoReconnect=true</value>
            </parameter>
        </ResourceParams>
      </GlobalNamingResources>I am still trying to get the DBTest example (described in the link to the tomcat 5 docs above) to work, only now I want it to work using a global connection pool. So here is the contents of webapps/DBTest/WEB-INF/web.xml: (again, please overlook formatting difficulties :)
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <web-app xmlns="http://java.sun.com/xml/ns/j2ee"
             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
             xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
             http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
             version="2.4">
      <description>MySQL Test App</description>
      <resource-ref>
          <description>DB Connection</description>
          <res-ref-name>jdbc/MySQL</res-ref-name>
          <res-type>javax.sql.DataSource</res-type>
          <res-auth>Container</res-auth>
      </resource-ref>
    </web-app>The last thing I need to do, I think, is to include a <resourceLink> element in the context.xml file for this webapp. Now in tomcat 5.0.* it is not recommended that the <context> element appear in the conf/server.xml file. Instead, as I understand it, it should appear in either of the two following places (for a webapp called DBTest):
    $CATALINA_HOME/conf/[engine_name]/[host_name]/DBTest.xml
    $CATALINA_HOME/webapps/DBTest/META-INF/context.xmlSince I would eventually like to package each webapp in its own war file, I prefer the second option above. This will enable me to place the context.xml file within the .war file. Currently, however, I am not using .war files.
    For the DBTest webapp I have the following <context> element in webapps/DBTest/META-INF/context.xml:
    <context path="/DBTest" docBase="/DBTest" debug="1">
        <ResourceLink global="jdbc/MySQL" name="jdbc/MySQL" type="javax.sql.DataSource" />
    </context>Now, when I point my browser to http://localhost:8080/DBTest/test.jsp I get the following message:
    javax.servlet.ServletException: Unable to get connection, DataSource invalid: "org.apache.commons.dbcp.SQLNestedException: Cannot create JDBC driver of class '' for connect URL 'null', cause: No suitable driver"
    For those who are interested, here is test.jsp:
    <%@ taglib uri="http://java.sun.com/jsp/jstl/sql" prefix="sql" %>
    <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
    <sql:query var="rs" dataSource="jdbc/MySQL">
    select id, foo, bar from javatest.testdata
    </sql:query>
    <html>
      <head>
        <title>DB Test</title>
      </head>
      <body>
      <h2>Results</h2>
    <c:forEach var="row" items="${rs.rows}">
        Foo ${row.foo}<br/>
        Bar ${row.bar}<br/>
    </c:forEach>
      </body>
    </html>Now I know that this is a very long and detailed question and that it is unlikely that anyone is even going to read down this far, let alone take the time to study all that XML, but if anyone is able to tell me why this setup does not allow global connection pooling, I will be pretty *@&$**% impressed. I only wish I had duke dollars to give.
    Jon

    Okay, I went back and double checked that I can get the DBTest example working. It is described here: http://jakarta.apache.org/tomcat/tomcat-5.0-doc/jndi-datasource-examples-howto.html
    I was not able to get it working exactly according to the tutorial, though. I was required to put the <context> element not in the conf/server.xml but in conf/Catalina/localhost/DBTest.xml. Then, with the DBTest/WEB-INF/web.xml as above, I was able to get the DBTest example working. The output of test.jsp (described above also) is the following:
    Results
    Foo hello
    Bar 12345I would like to be able to put the <context> element in webapps/DBTest/META-INF/context.xml (as I think should be allowed) because then I would be able to include it in a war file that encompassed the entire web application. If I am forced to put the <context> element in a subdirectory of the conf directory, then I cannot include it in a war file and I will be unable to just drop my war files in the webapps directory and go. Instead I will have to drop my war files in the webapps directory, then go and fiddle around with the xml files in conf/Catalina/localhost/
    But if I move the <context> element into webapps/DBTest/META-INF/context.xml then the example stops working. When I put it back in conf/Catalina/localhost/DBTest.xml everything is fine again.
    Ok, no big deal. I guess my war file deployment will just have to be a little more complicated.
    But what if I want the resource to be global??? If I remove the <Resource> and <ResourceParams> elements from the webapp-specific <context> element and put them in the <GlobalNamingResource> element in the conf/server.xml file I should have a global resource, right? I did this, then added a resource link to the <context> element (see above), however, the example stops working. I have tried both with and without the <resource-ref> element in web.xml.
    Can some remarkably intelligent and knowledgeable person please explain to me how global resources work in tomcat 5.0, especially global JDBC connection pooling.
    Thanks,
    Jon

  • Connection Pooling in Tomcat with SQL Server

    Hey Guys,
    I have been banging my head against this all day :( so i now turn to you for some help :) I have a web app that uses a database now i want to start using this connection pooling that is supposed to be greatly more efficient than creating a new statement each time i need something from the database.
    I have read many articles about this already today and feel that a lot of the contradict each other and one thing that i saw was that there seems to be different way of doing this.
    One solution i have tried to implement but have so far failed is as follows:
    In Web app:
    Update Web.xml to include:
    <resource-ref>
            <description>
                Resource reference to a factory for java.sql.Connection
                instances that may be used for talking to a particular
                database that is configured in the server.xml file.
            </description>
            <res-ref-name>
                    jdbc/BBL
            </res-ref-name>
            <res-type>
                javax.sql.DataSource
            </res-type>
            <res-auth>
                Container
            </res-auth>
        </resource-ref>Update Context.xml to include:
    <Context path="/TEST_CON_POOLING">
    <Resource name="jdbc/BBL"
    auth="Container"
    type="javax.sql.DataSource"
    username="sa"
    password="sa"
    driverClassName="com.microsoft.sqlserver.jdbc.SQLServerDriver"
    url="jdbc:microsoft:sqlserver://10.20.1.91:1433;DatabaseName=BBL"
    maxActive="8"
    maxIdle="4" />
    </Context>And then my jsp to test this:
    <%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
    --%>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
    <html>
        <head>
            <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
            <title>JSP Page</title>
        </head>
        <body>
            <%@ page import="java.sql.ResultSet, java.sql.*,java.sql.SQLException,javax.naming.Context,javax.naming.InitialContext,
            javax.naming.NamingException,javax.sql.DataSource" %>
            <%
            Context initCtx = new InitialContext();
            Context envCtx = (Context) initCtx.lookup("java:comp/env");
            DataSource ds = (DataSource)
            envCtx.lookup("jdbc/BBL");
            Connection conn = ds.getConnection();
            //... use this connection to access the database ...
            Statement stmt = conn.createStatement();
            ResultSet rs = stmt.executeQuery("select id from users");
            while(rs.next()){
                out.write(rs.getString("ID"));
            conn.close();
            %>
        </body>
    </html>When i actually deply this i get the following nasty tomcat error:
    root cause
    org.apache.tomcat.dbcp.dbcp.SQLNestedException:
    Cannot create JDBC driver of class 'com.microsoft.sqlserver.jdbc.SQLServerDriver' for connect URL 'jdbc:microsoft:sqlserver://10.20.1.91:1433;DatabaseName=BBL'
         org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1150)
         org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSource.java:880)
         org.apache.jsp.index_jsp._jspService(index_jsp.java:71)
         org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:331)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
    root cause
    java.sql.SQLException: No suitable driver
         java.sql.DriverManager.getDriver(DriverManager.java:243)
         org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1143)
         org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSource.java:880)
         org.apache.jsp.index_jsp._jspService(index_jsp.java:71)
         org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:331)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:803)As far as i know all the necessary sql server jar files are in my classpath, and any way i have them all sitting in the CATALINA_HOME/common/lib directory.
    Question:
    Am i going about this correctly? Some tutorials i have read say that i should be updateing the server.xml file but whenever i go near that tomcat will not even start.
    Help greatly appreciated.
    If there is anything i have not posted let me know and i will get it up.
    Rob

    Updating the server.xml file used to be necessary. It is no longer required, and actually not recommended any more.
    The best approach I feel is as you have done here, putting the definition into a context.xml file specifically for this application.
    In fact it all looks pretty good to me.
    JDBC driver jar in [TOMCAT]/common/lib - check
    Configuration in context.xml rather than server.xml - check
    Using JNDI - check.
    Have you got the connection url right?
    Is it jdbc:microsoft:sqlserver or just jdbc:sqlserver ? I have seen both on various sites around the internet.
    What version of SQL Server are you using? Check its documentation on the JDBC driver as to what class to use, and what the connection string should be.
    Try it in a plain java class - can you get a connection just using plain JDBC code?
    What values do you use for that?
    Hope this helps,
    evnafets

  • How do I expand my simple JSP page to implement Connection Pooling?

    Hi everyone,
    I have a small SQL database which contains information about Students and a StudenBean which contains their attributes and appropriate get/set methods (which I haven't needed to use yet).
    I want to write a simple JSP page which displays all the students details in one big table. I can do this using the basic prototyping method of adding the dataSource and driver details to the deployment descriptor (web.xml - I'm using the latest version of Tomcat by the way) and then accessing the database using JSP standard SQL actions.
    Here's a snipet of what I've done (just an example, the final code works):
    <sql:query var="temp"
    sql="SELECT * FROM Employee ORDER BY UserName"
    />
    <c:forEach items="${temp.rows}" var="row">
    <td><c:out value ="${row.UserName}"/></td>
    <td><c:out value ="${row.FirstName}"/></td>
    <td><c:out value ="${row.LastName}"/></td>
    Now I want to upgrade! I want to access the dataSource using Connection Pooling and it's causing me a lot of trouble. I already have the required working classes/data such as ConnectionPool.java, ResourceManagerListener.java, the MySQL driver etc.
    However, I don't know what the best way to setup the connection for my purposes would be and where I should do it.
    Do I need to write a servlet or tag handler/custom action to establish the connection and access my bean through it? I would like to keep a similar sort of business logic as I already have developed i.e. be able to use actions in my JSP page to cycle through the database and print out each detail from the row.
    Rather confused and muddled. Thanks for any input!

    Good idea.
    Set up a JNDI data source for your app, according to these docs:
    http://jakarta.apache.org/tomcat/tomcat-4.1-doc/jndi-datasource-examples-howto.html
    You'll have to put the right information into your web.xml and a context.xml. Once you've done that, your JSTL JSPs will simply use the connection resource automagically.
    MOD

  • RFC_FAILURE affects Connection Pool

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

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

  • Connection pool / db failure

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

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

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

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

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

  • Connection Pool Failure: "No suitable driver"

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

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

  • Connection Pool Failure

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

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

  • Easy JNDI + Connection Pool Question

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

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

  • Create A Connection Pool In the ServletContextListener

    The Specification says that we should create the connection pool in the ServletContextListener. I have the code for creating a connection pool (see below). How do I create it in the ServletContextListener?
    import java.sql.Connection;
    import java.sql.SQLException;
    import javax.naming.InitialContext;
    import javax.naming.NamingException;
    import javax.sql.DataSource;
    public class DBConnection
       public static Connection getDBConnection() throws SQLException
          Connection conn = null;
          try
             InitialContext ctx = new InitialContext();
             DataSource ds = ( DataSource ) ctx.lookup( "java:comp/env/jdbc/MySQLDB" );
             try
                conn = ds.getConnection();
             catch( SQLException e )
                System.out.println( "Open connection failure: " + e.getMessage() );
          catch( NamingException nEx )
             nEx.printStackTrace();
          return conn;

    I use the connection pool feature provide by the server I use. Is this what I should do? Please confirm.
    import java.sql.Connection;
    import java.sql.SQLException;
    import javax.naming.InitialContext;
    import javax.naming.NamingException;
    import javax.sql.DataSource;
    import javax.servlet.*;
    public class CreateResources implements javax.servlet.ServletContextListener
         public void contextInitialized(ServletContextEvent sce)
              public static Connection getDBConnection() throws SQLException
                   Connection conn = null;
                   try
                        InitialContext ctx = new InitialContext();
                        DataSource ds = ( DataSource ) ctx.lookup( "java:comp/env/jdbc/MySQLDB" );
                        try
                             conn = ds.getConnection();
                        catch( SQLException e )
                             System.out.println( "Open connection failure: " + e.getMessage() );
                  catch( NamingException nEx )
                        nEx.printStackTrace();
                  return conn;
         public void contextDestroyed(ServletCotnextEvent sce)
    }

  • Issue JDBC connection pool with Glassfish 3.1.2.2 and Oracle XE 11gR2

    Hello,
    I am experiencing an issue with pinging a JDBC connection Pool.
    I installed the following without any warnings or errors:
    Operating System: Oracle Enterprise Linux 5
    Oracle XE 11gR2 (11.2.0.2.0) database
    Glassfish 3.1.2.2
    I will refer to the steps I did after the installations
    1) In the .profile file of the OS I add the following:
    JRE_HOME=/usr/java/jre1.6.0_31; export JRE_HOME
    JAVA_HOME=/usr/java/jdk1.6.0_31; export JAVA_HOME
    GLASSFISH_DIR=/u01/glassfish3
    GLASSFISH_HOME=/u01/glassfish3/glassfish
    DERBY_HOME=$GLASSFISH_DIR/javadb
    OPEN_MQ_HOME=$GLASSFISH_DIR/mq
    PATH=:$JAVA_HOME/bin:$JRE_HOME/bin:$PATH:$HOME/bin:$GLASSFISH_HOME/bin:$DERBY_HOME/bin:$OPEN_MQ_HOME/bin
    export GLASSFISH_HOME
    export DERBY_HOME
    export OPEN_MQ_HOME
    export PATH
    LD_LIBRARY_PATH=/u01/app/oracle/product/11.2.0/xe/lib; export LD_LIBRARY_PATH
    . /u01/app/oracle/product/11.2.0/xe/bin/oracle_env.sh
    2) I copied the ojdbc6.jar to the $GLASSFISH_HOME/domains/domain1/lib
    3) I login to the Glassfish admin console and created a new JDBC Connection Pool.
    Pool Name: ds_orasys
    Resource Type: javax.sql.DataSource
    Datasource Classname: oracle.jdbc.pool.OracleDataSource
    User: [myschema]
    Password: [myschema password]
    URL: jdbc:oracle:thin:@localhost:1521:xe
    When I ping the connection pool I get the following message in the server log:
    [#|2012-10-23T12:14:37.069+0300|WARNING|glassfish3.1.2|javax.enterprise.resource.resourceadapter.com.sun.enterprise.connectors.service|_ThreadID=22;_ThreadName=Thread-2;|RAR8054: Exception while creating an unpooled [test] connection for pool [ ds_orasys ], Connection could not be allocated because: Invalid Oracle URL specified|#]
    [#|2012-10-23T12:14:37.071+0300|SEVERE|glassfish3.1.2|org.glassfish.admingui|_ThreadID=19;_ThreadName=Thread-2;|RestResponse.getResponse() gives FAILURE. endpoint = 'http://212.205.62.217:4848/management/domain/resources/ping-connection-pool.json'; attrs = '{id=ds_orasys}'|#]
    I tried to use different jar files. I used ojdbc6dms.jar and ojdbc14.jar.
    I also copied the jar files in the $GLASSFISH_HOME/domains/domain1/lib/ext directory as some people suggested. Still no luck. I keep getting the same error messages in the server.log
    Can anybody help me out or point me to the right direction.
    Thank you in advance

    The error is in the URL. It was in front of my eyes and I couldn't see the error. I skipped the ':' before the '@' when I created the pool. It is working fine now.

  • Configuring JCo3 Connection Pool with single sign on on non SAP Java server

    Hi Everyone,
    i have configured a connection pool on JBoss as per JCo3 Documentation and is working great.
    Now I need help to configure this connection pool with single sign on so that RFc on SAP ECC systems are executed using end users credential rather than using single user name password used to configure JCo connection pool.
    On SAP Java stack I am sure its possible within Java WebDynpro    and i assume using JCA resource adapter. But what if we don't want to use SAP Java App server.
    Any help will be appreciated.
    Thanks,
    Divyakumar Jain

    Eason, 你好!
    I have exactly the same problem.  Did you find a solution to this problem?  If so, please let me know!

Maybe you are looking for

  • Textinput on ios Cursor and typed text start where the textinput was clicked but should start left

    So... the TextInput works well in the simulator and on android... but on an iPhone the text starts at the position where the user clicks in the text input and that feels strange and looks ugly... the code: <s:TextInput id="firstNameInput"            

  • From external: block all domains except one MAPPINGS file?

    Here's the problem... I have an old domain that my mailserver is still authoritive for. We receive mail through a mail ISP cluster, in that sense that our internal mailserver does not have any MX-records associated with it. All MX-records point to th

  • Imac crashes when i install the windows 7 sp1

    So I have gotten past the intiall hurdle of installing windows 7 on my 27 inch Imac, which was not easy. it was done through boot camp and involved deleting a few key system files after the install crashes on reboot. Now the computer is crashing when

  • CF10 mail settings

    in the mail server setings CF10 will not let me submit domain\username in the user name field and shows domainusername without the backslash.

  • Commission base on price range not level for split commission for 3 reps

    Need to figure out how to design this complex commission sturcture. Commission NOT only base on price level but need add price range as well since they allow salesrep to sell in the range but over the range the commission rate will reducded.  Exapmle