Monitoring EJB,Connection Pool,Servlets

Hi,
i have one doubt does oracle provides any MBeans to monitor ejb,connection pools etc..?
thanks &regards
Magesh.N

Hi,
i have one doubt does oracle9ias provides any MBeans to monitor ejb,connection pools etc..?
thanks .ards
Magesh.N

Similar Messages

  • Web dynpro console - monitor - JCO Connection pools

    If you go to the web dynpro console -> monitor -> JCO connection pools you see a table with information.
    JCo Clients MonitorJCO Pools - 12:31:02.992
      Name Size Currently used Maximum used Max.connections Max.pool size
    Can somebody explain what for example the "Size" and "Maximum used" mean in this table?
    And if you have set max.pool size to 20, what things can override this setting in the SAP system?

    Hi,
    You can follow this link for information on JCO in Web Dynpro Java:
    [http://help.sap.com/SAPHELP_NW04S/helpdata/EN/3a/3b1b40fcdd8f5ce10000000a155106/frameset.htm|http://help.sap.com/SAPHELP_NW04S/helpdata/EN/3a/3b1b40fcdd8f5ce10000000a155106/frameset.htm]
    -Kunal Kotak

  • Monitoring Connection Pools

    Hello All,
    Environment details: OBIEE - 10.1.3.4.1 on 10gAS , Solaris 10. Single Node
    We are implementing OBIEE in our organization and every quarter we add more number of data sources, dashboards and users. Recently we have started observing slowness while logging in. After crosschecking we have observed that not having separate connection pools for session variables might be one of the issue.
    Before defining any new connection pools, we would like to take a proper step to design our connection pools. But we are unable to locate proper resources for monitoring the connection pool usage at a give point of time. Ideally we would to automate a job which will collect statistics of all available connection pools, users at a decent level of detail. This can help us in identifying the pattern of usage and further help us in defining an optimal connection pool strategy.
    Could someone please guide me to a proper resource ? Can UDML help me here ? Any tips?
    Thanks a lot for your help.
    ~Ravi.M

    As far as I know there isn't any way of checking the connection pool usage from the OBIEE layer. But your DBA should able to queries to monitor the OBIEE connection usage from the database side. As for your question about designing connections pools the documentation is very extensive on this subject, have you reviewed the relevant section in the server Administration Guide?
    After crosschecking we have observed that not having separate connection pools for session variables might be one of the issue.This is specifically mentioned in the documentation, you should separate connections for your Init Blocks. Also you should try to consolidate Init Blocks to reduce the database call overhead. In addition to this I can mention that most login problems relate to Init Blocks taking long to run rather than connection pool issues. Make sure your Init Blocks return data quickly. Also if you have a lot of session init blocks you may want to set some depencies between them. Suppose you have 10 session init blocks. If two users login at the same time OBIEE will try to run all those queries at the same time, should the max connections be set that high (20). By setting some execution depencies in your Init Blocks you can control the execution to reduce the parallelism and make them to run a bit more serial reducing the connection pool usage.

  • Monitor Connection pool

    Hi,
    I am using ODP.Net from Oracle 9i client talking against Oracle 9i. Using in VS2005/.Net2.0.
    I am successfully using connection pooling in my applictaion behind web services running in IIS. My front end calls the web service, and the webservice uses the connection from the pool and retrieves data from the database. This works great. I checkd this by looking at the number of open connections in the v$session table.
    I am wondering is there any other way of monitoring the connections/pool on the IIS web server machine. Is there any other app or does ODP.Net have any counters for the connections and the connection pool which we can monitor.
    Thanks
    - Jaideep

    Hi,
    I think I have the answer. I just have to open up active connection pool in the
    administration console and click on Monitoring.
    Please correct me if I am wrong.
    Thanks and best regards,
    Jaya
    "Jaya" <[email protected]> wrote:
    >
    Hi all,
    Is there a way to monitor active connections from Weblogic administration
    console
    (or from anywhere else)?
    I have configured a connection pool with minumum capacity=50, maximum
    capacity=100
    and capacity increment = 1.
    Is there a way to find out how many connections have been used up from
    the pool
    at a given time?
    Thanks in advance.
    Best regards,
    Jaya

  • Monitor Connection Pool 10g

    I am using odp.net 10gR2. Is there a way I can monitor the connection pool, like action connection, connection strings or active connections etc. Also, can I know the like how many connection pools will be there per cpu in my server and can I make any of the connection pool as inactive or disable or something like that ?
    Thanks,

    Hi,
    isn't the theory that there is no direct guaranteed mapping between connections -> sessions -> process ?!
    atleast on 10.2.0.1 x64 on windows 2003 i'm chasing a issue where v$session and v$process counts do not correspond to the number of thread in the oracle.exe process. Seems like as the connection pools increase the threads go up as you would expect but then stay idle until the client app restarts (also a bug with Dead connection detections and keepalives with this release potentially).
    anybody else with this kind of issue or more insight or even better a method to get a bit more insight?
    thanks

  • Shared Connection Pool via Singleton

    I have just started to learn Java (more jsp & servlets) and have been going through "Core Servlets and Java Server Pages" and in there is stuff on connection pooling. The author provides a good a connection pool servlet that can be shared, but as I'm new and don't fully understand how everything works (got a basic idea).
    How do i go about making the following code accessiable via a singleton class?
    ConnectionPool Class
    package sco;
    import java.sql.*;
    import java.util.*;
    /** A class for preallocating, recycling, and managing
    *  JDBC connections.
    *  <P>
    *  Taken from Core Servlets and JavaServer Pages
    *  from Prentice Hall and Sun Microsystems Press,
    *  http://www.coreservlets.com/.
    *  &copy; 2000 Marty Hall; may be freely used or adapted.
    public class ConnectionPool implements Runnable {
      private String driver, url, username, password;
      private int maxConnections;
      private boolean waitIfBusy;
      private Vector availableConnections, busyConnections;
      private boolean connectionPending = false;
      public ConnectionPool(String driver, String url,
                            String username, String password,
                            int initialConnections,
                            int maxConnections,
                            boolean waitIfBusy)
          throws SQLException {
        this.driver = driver;
        this.url = url;
        this.username = username;
        this.password = password;
        this.maxConnections = maxConnections;
        this.waitIfBusy = waitIfBusy;
        if (initialConnections > maxConnections) {
          initialConnections = maxConnections;
        availableConnections = new Vector(initialConnections);
        busyConnections = new Vector();
        for(int i=0; i<initialConnections; i++) {
          availableConnections.addElement(makeNewConnection());
      public synchronized Connection getConnection()
          throws SQLException {
        if (!availableConnections.isEmpty()) {
          Connection existingConnection =
            (Connection)availableConnections.lastElement();
          int lastIndex = availableConnections.size() - 1;
          availableConnections.removeElementAt(lastIndex);
          // If connection on available list is closed (e.g.,
          // it timed out), then remove it from available list
          // and repeat the process of obtaining a connection.
          // Also wake up threads that were waiting for a
          // connection because maxConnection limit was reached.
          if (existingConnection.isClosed()) {
            notifyAll(); // Freed up a spot for anybody waiting
            return(getConnection());
          } else {
            busyConnections.addElement(existingConnection);
            return(existingConnection);
        } else {
          // Three possible cases:
          // 1) You haven't reached maxConnections limit. So
          //    establish one in the background if there isn't
          //    already one pending, then wait for
          //    the next available connection (whether or not
          //    it was the newly established one).
          // 2) You reached maxConnections limit and waitIfBusy
          //    flag is false. Throw SQLException in such a case.
          // 3) You reached maxConnections limit and waitIfBusy
          //    flag is true. Then do the same thing as in second
          //    part of step 1: wait for next available connection.
          if ((totalConnections() < maxConnections) &&
              !connectionPending) {
            makeBackgroundConnection();
          } else if (!waitIfBusy) {
            throw new SQLException("Connection limit reached");
          // Wait for either a new connection to be established
          // (if you called makeBackgroundConnection) or for
          // an existing connection to be freed up.
          try {
            wait();
          } catch(InterruptedException ie) {}
          // Someone freed up a connection, so try again.
          return(getConnection());
      // You can't just make a new connection in the foreground
      // when none are available, since this can take several
      // seconds with a slow network connection. Instead,
      // start a thread that establishes a new connection,
      // then wait. You get woken up either when the new connection
      // is established or if someone finishes with an existing
      // connection.
      private void makeBackgroundConnection() {
        connectionPending = true;
        try {
          Thread connectThread = new Thread(this);
          connectThread.start();
        } catch(OutOfMemoryError oome) {
          // Give up on new connection
      public void run() {
        try {
          Connection connection = makeNewConnection();
          synchronized(this) {
            availableConnections.addElement(connection);
            connectionPending = false;
            notifyAll();
        } catch(Exception e) { // SQLException or OutOfMemory
          // Give up on new connection and wait for existing one
          // to free up.
      // This explicitly makes a new connection. Called in
      // the foreground when initializing the ConnectionPool,
      // and called in the background when running.
      private Connection makeNewConnection()
          throws SQLException {
        try {
          // Load database driver if not already loaded
          Class.forName(driver);
          // Establish network connection to database
          Connection connection =
            DriverManager.getConnection(url, username, password);
          return(connection);
        } catch(ClassNotFoundException cnfe) {
          // Simplify try/catch blocks of people using this by
          // throwing only one exception type.
          throw new SQLException("Can't find class for driver: " +
                                 driver);
      public synchronized void free(Connection connection) {
        busyConnections.removeElement(connection);
        availableConnections.addElement(connection);
        // Wake up threads that are waiting for a connection
        notifyAll();
      public synchronized int totalConnections() {
        return(availableConnections.size() +
               busyConnections.size());
      /** Close all the connections. Use with caution:
       *  be sure no connections are in use before
       *  calling. Note that you are not <I>required</I> to
       *  call this when done with a ConnectionPool, since
       *  connections are guaranteed to be closed when
       *  garbage collected. But this method gives more control
       *  regarding when the connections are closed.
      public synchronized void closeAllConnections() {
        closeConnections(availableConnections);
        availableConnections = new Vector();
        closeConnections(busyConnections);
        busyConnections = new Vector();
      private void closeConnections(Vector connections) {
        try {
          for(int i=0; i<connections.size(); i++) {
            Connection connection =
              (Connection)connections.elementAt(i);
            if (!connection.isClosed()) {
              connection.close();
        } catch(SQLException sqle) {
          // Ignore errors; garbage collect anyhow
      public synchronized String toString() {
        String info =
          "ConnectionPool(" + url + "," + username + ")\n" +
          ", available=" + availableConnections.size() + "\n" +
          ", busy=" + busyConnections.size() + "\n" +
          ", max=" + maxConnections;
        return(info);
    ScoPool Class (singleton to access the connection pool)
    package sco;
    public class ScoPool extends ConnectionPool {
      private ScoPool pool = null;
      private ScoPool() {
        super(); // Call parent constructor
      public static synchronized ScoPool getInstance() {
        if(pool == null) {
          pool = new ScoPool();
        return(pool);
    }Please help a newbie.

    Figured it out.
    package sco;
    import java.sql.SQLException;
    public class ScoPool extends ConnectionPool {
      private static ScoPool pool;
      private ScoPool(String driver, String url, String username, String password,
                      int initialConnections, int maxConnections, boolean waitIfBusy) throws SQLException {
        super(driver, url, username, password, initialConnections, maxConnections, waitIfBusy); // Call parent constructor
      public static synchronized ScoPool getInstance() {
        if(pool == null) {
          String driver = "com.microsoft.jdbc.sqlserver.SQLServerDriver";
          String url = "jdbc:microsoft:sqlserver://MIM-W0432:1433;DatabaseName=sco";
          String username = "sco_user";
          String password = "123";
          int initCon = 5;
          int maxCon = 10;
          boolean waitIfBusy = true;
          try {
            pool = new ScoPool(driver, url, username, password, initCon, maxCon, waitIfBusy);
          catch(SQLException sqle) {
        return pool;
    }

  • Ias support for EJB, JSP/servlets,JDBC, connection pooling, XML, SOAP, load balancing etc

    Please let me know where I can find more information regarding iPlanet usage/deployment/configuring/tuning etc for support of technologies - like EJB, JSP/servlets, JDBC, connection pooling, XML, load balancing, JDBC & Transactions
    (I have already read the 'Getting Started with the iPlanet Application Server' part five and six - http://developer.iplanet.com/appserver/testdrive/partfive.jsp and partsix.jsp)(I am using the ias testdrive version).

    Hi,
    It's difficult to explain unless the J2EE architecture is understood. Also, explaining things like load balancing, Transactions, tuning, are bit vague and could blow the disk space of this site.
    To get started, the best way is to test the sample applications and the best part is you don't require internet connection to follow each steps. Install iWS and iAS, open browser, type in http://hostname:port/ias-samples/index.html. You can find links to the sample applications bundled. Please follow the steps given on deploying the application. This will enable you to a higher level.
    Regards
    Ganesh .R
    Developer Technical Support
    Sun Microsystems
    http://www.sun.com/developers/support

  • How To:  Monitor usage of a connection pool

    So I have a bunch of EJBs using a DB connection pool hosted under iAS
    6sp2 on Solaris. How do I monitor pool usage? I would like to see
    available pooled connections and in use connections - that would refresh
    periodically.
    The iAST tool has the monitor thing, which I turned on and added some
    plots (active connection, and something else)...but those plots flat
    lined and never showed any activity nor usefull information.
    Can you hook up SNMP to an iAS? What about JMX? What are other
    suggestions?
    Thanks in advance,
    Fred Welland
    [email protected]
    Intelix Inc.

    You can enable debug ( level = 1 ) at the pool level. This would throw some additonal information into kjs log. Unfortunately there is no time stamp with these lines. But you will get an ides of how your pool is performing during the test.

  • How to use my connection pool in multiple servlets?

    I now have a functioning connection pool using these lines in a servlet:
    private Connection getConnection(String lookup) throws NamingException, SQLException {
    Context context = new InitialContext();
    DataSource ds = (DataSource)context.lookup(lookup);
    Connection ocon = ds.getConnection();
    context.close();
    return ocon;
    } // private Connection getConnection(String lookup) throws NamingException, SQLException {
    ========================
    If I want to create additional servlets in the same web app which query the same database,
    do I need to repeat this block of code in every servlet, or can I just put it in one servlet
    and have other servlets access it in some way to get a connection? Should I change the code
    above from a "private" Connection to a "public" Connection?
    An example servlet is shown below. To put my question another way: If I want to
    create a second servlet with a different set of queries, would I just make a copy of the first
    servlet and then change only the queries, or is there a more efficient way to have multiple
    servlets get connections from the pool?
    Any suggestions are greatly appreciated.
    Thank you.
    Logan
    ************************************servlet example**********************************
    package CraigsClasses;
    import javax.servlet.*;
    import javax.servlet.jsp.*;
    import java.net.*;
    import java.util.*;
    import java.io.*;
    import javax.servlet.http.*;
    import java.sql.*;
    import java.util.Date;
    import java.text.*;
    import javax.naming.*;
    import javax.sql.DataSource;
    public class CraigsMain extends HttpServlet {
    public void init(ServletConfig config) throws ServletException {
    super.init(config);
    private Connection getConnection(String lookup) throws NamingException, SQLException {
    Context context = new InitialContext();
    DataSource ds = (DataSource)context.lookup(lookup);
    Connection ocon = ds.getConnection();
    context.close();
    return ocon;
    } // private Connection getConnection(String lookup) throws NamingException, SQLException {
    // Process the http Get request
    public void doGet(HttpServletRequest request, HttpServletResponse response)
         throws ServletException, IOException {
    try {
    response.setContentType("text/html");
    PrintWriter out = response.getWriter();
    String sql = "select formtitle from checkboxforms where cbformid = 157";
    // error occurs at this line
    Connection ocon = getConnection("java:comp/env/jdbc/CraigsList");
    PreparedStatement pStmt = ocon.prepareStatement(sql);
    ResultSet rs1 = pStmt.executeQuery();
    rs1.next();
    out.println("<br>" + rs1.getString(1));
    rs1.close();
    pStmt.close();
    ocon.close();
    } catch(SQLException sqle) {
    System.err.println("sql exception error: " + sqle);
    } catch(NamingException ne) {
    System.err.println("naming exception error: " + ne);
    public void doPost(HttpServletRequest request, HttpServletResponse response)
    throws ServletException, IOException {
    doGet(request, response);
    =======================================================================

    sjasja, Thank you for the reply. What you are suggesting is exactly what I have been looking for. But I'm pretty weak on how to make this separate con pool servlet work. My first attempt is shown below. It doesn't compile this line, which is obviously wrong:
    public static Connection getConnection(String lookup) throws NamingException, SQLException {
    Could you please help me with this servlet code? Thanks.
    package CraigsClasses;
    import javax.servlet.*;
    import javax.servlet.jsp.*;
    import java.net.*;
    import java.io.*;
    import javax.servlet.http.*;
    import java.sql.*;
    import javax.naming.*;
    import javax.sql.DataSource;
    public class ConPoolInit extends HttpServlet {
    public void init(ServletConfig config) throws ServletException {
    super.init(config);
    try {
    public static Connection getConnection(String lookup) throws NamingException, SQLException {
    Context context = new InitialContext();
    DataSource ds = (DataSource)context.lookup(lookup);
    Connection ocon = ds.getConnection();
    context.close();
    return ocon;
    } // private Connection getConnection(String lookup) throws NamingException, SQLException {
    } catch(SQLException sqle) {
    System.err.println("sql exception error: " + sqle);
    } catch(NamingException ne) {
    System.err.println("naming exception error: " + ne);
    =======================================

  • How to use a JCO connection pool in an EJB?

    Hi *,
    I want to build a WebService using SAP Web AS (J2EE Engine) that connects to a R/3 ERP (release 4.7).
    I thought of building a stateless session bean that will be deployed as webservice. The session bean shall connect to the R/3 in order to call some BAPIs. I'd like to use a JCO connection pool. But I'm not sure, where I should create and destroy the connection pool. Are the EJB methods ejbCreate() and ejbRemove() the right ones? If so, my businness methods would just have to get a connection from the pool and call the BAPIs, right? If not, what do you suggest?
    Another question: I already deployed a bean as webservice. Since not really knowing how to use the connection pool, I created a bean with one business method that creates a connection pool whenever it gets called. But if I have to change something in the bean so that I have to redeploy the bean I can't call my business method anymore, because JCO cannot load a native library once again, as it is already loaded, This leads to an exception. So I have to restart the complete engine everytime I redeploy my bean. Are there any workarounds for this problem? I'm not sure whether this is connected to the wrong use of the JCO connection pool.
    Kind regards,
    Lars

    Hi *,
    I want to build a WebService using SAP Web AS (J2EE Engine) that connects to a R/3 ERP (release 4.7).
    I thought of building a stateless session bean that will be deployed as webservice. The session bean shall connect to the R/3 in order to call some BAPIs. I'd like to use a JCO connection pool. But I'm not sure, where I should create and destroy the connection pool. Are the EJB methods ejbCreate() and ejbRemove() the right ones? If so, my businness methods would just have to get a connection from the pool and call the BAPIs, right? If not, what do you suggest?
    Another question: I already deployed a bean as webservice. Since not really knowing how to use the connection pool, I created a bean with one business method that creates a connection pool whenever it gets called. But if I have to change something in the bean so that I have to redeploy the bean I can't call my business method anymore, because JCO cannot load a native library once again, as it is already loaded, This leads to an exception. So I have to restart the complete engine everytime I redeploy my bean. Are there any workarounds for this problem? I'm not sure whether this is connected to the wrong use of the JCO connection pool.
    Kind regards,
    Lars

  • How to monitor connection pools using wlsd

    Hi
    i need to monitor connectionpools , i dont know that much about wlsd, how can we configure wlsd to monitor connection pools.
    Cheers
    Raghu

    U can use a Simple Java Code for that: http://jaysensharma.wordpress.com/2010/02/19/jdbcconnectionpool-parameters-using-jmx/
    In the above program you need to just change the following 4-lines:
    int port = 7001; // AdminServer Port
    String hostname = “localhost”; // AdminSewrver HostName
    h.put(Context.SECURITY_PRINCIPAL, “weblogic”); // AdminUserName
    h.put(Context.SECURITY_CREDENTIALS, “weblogic”); // Admin Paassword...
    ====================================
    Using WLST if you want to do it then you need to edit the following Script a Bit : http://jaysensharma.wordpress.com/2010/03/23/testing-datasource-status-using-wlst/

  • Pooling PreparedStatement s- Connection Pooling in a Servlet-Applicatrion

    We are using OC4J (Servlets) and Oracle9i.
    In the application I use Connection Pooling with
    datasource.xml.
    It works fine.
    Is it possible to create a pool of PreparedStatements and "connect" them with the connections in the pool?
    Has anyone an idea how to do it or an example?
    Thanks in advance
    Peter

    It's not necessarily "bad" as in "it won't work". I personally wouldn't do it because it's poor design. Now, if this is just a small, trivial app. then you have to decide if abstracting things more is worth it. It's not following best practices to put JDBC calls in your servlet. Your servlet should sit there and direct traffic to appropriate handlers, acting as a controller.
    At a minimum I would put the JDBC stuff in its own class and have the servlet use that class.
    Even if you keep your JDBC stuff in your servlet, you really should reuse a common set of DB connections instead of creating a new one each time.

  • Monitoring of topLink internal connections  pool

    we wish to monitoring use of Toplink internal connections pool : numbers maximum used, a minimum number used.
    we know to do it with the external pool (OracleAS) but not with the internal pool.
    Regards

    The only way to get this information is through API calls. If you have a Server (oracle.toplink.threetier) you can ask the read and default (write) connection pools.
            // Display Read Connection pool info       
            System.out.println("READ Available: " +
                               server.getReadConnectionPool().getConnectionsAvailable().size());
            System.out.println("READ Minimum: " +
                               server.getReadConnectionPool().getMinNumberOfConnections());
            System.out.println("READ Maximum: " +
                               server.getReadConnectionPool().getMaxNumberOfConnections());
            // Display Write Connection pool info       
            System.out.println("WRITE Available: " +
                               server.getDefaultConnectionPool().getConnectionsAvailable().size());
            System.out.println("WRITE Minimum: " +
                               server.getDefaultConnectionPool().getMinNumberOfConnections());
            System.out.println("WRITE Maximum: " +
                               server.getDefaultConnectionPool().getMaxNumberOfConnections());Doug

  • How to implement a connection pooling in servlet

    hi all,
    how to implement a connection pooling in servlet.i want to know how to implement it in tomcat in a struts based environment.
    any input to the topic is appreciated.
    Thanks
    Sudha

    Take a look at JNDI
    http://jakarta.apache.org/tomcat/tomcat-4.1-doc/jndi-datasource-examples-howto.html

  • Monitor database connections in a database pool

    Hi,
    Do you know how I can monitor database connections in a database pool.. ? I am using Jboss container.
    The purpose is to monitor connections that are closed and refresh them.
    Thanks,

    There a firewall.. across which my application makes connections to the database.. the firewall times out due to the inactivity. and my application dies.
    I was thinking may be I could check for the database connections in a pool and then one that is not being used for a long time .. close it and again refresh the connection.
    Please Advise...

Maybe you are looking for