Subject areas and connection pools

Hi,
Could you let me know what is the best option for me. We have tables coming from single data source. We are doing diffferent subject areas based on the requirements. My question is is it best to do different connection pools for each subject area or just do one connection pool for all subject areas.

Hi friend,
i think the best option depends on number of user will use the application. If you a have a high number of user on each subject data, i think it will be better have a connection pool per subject area, because the connection pool have a maximum number of concurrent connection. On the other hand, if you have a few number of user, one connection pool will be enough.
For futher information, take a look to next link:
http://www.appsbi.com/obiee-connection-pool
I hope this solve your doubt.
Regards.

Similar Messages

  • [Fwd: Re: rdbms realm and connection pool]

    Hi,
    One reason why I would like to use the connection pool for the RDBMS
    realm is because there is the retry machanism built into the connection
    pool. With this retry, I don't need to re-start WebLogic if the DB
    server is somehow re-started. With the current implementation, all the
    connections maintained by the realm will become invalid if the DB server
    has been restarted independently.
    -------- Original Message --------
    Subject: Re: rdbms realm and connection pool
    Date: Wed, 27 Sep 2000 09:32:47 +0100
    From: "Terry" <[email protected]>
    Reply-To: "Terry" <[email protected]>
    Organization: BEA SYSTEMS Inc
    Newsgroups: weblogic.developer.interest.security
    References: <[email protected]>
    I believe not- the realm restricts access to connection pools to those
    who
    are allowed it, so if the realm needs the connection pool to start up,
    and
    you can't open the connection pool without the realm then you have a bit
    of
    a no-chicken and no-egg situation, which is I believe one of the reasons
    why
    there is no use of connection pools, ejbs, jndi, servlets etc. in the
    realm
    (along with other reasons, like why would it be provided with a servlet)
    The delegate pool acts somewhat similarly to a connection pool, and can
    even
    use the same database, so I'm not sure what the advantage would be
    Terry
    Nirmala devi <[email protected]> wrote in message
    news:[email protected]..
    >
    I think the rdbms realm uses different connection as it need to be setbefore
    the connection pool for Database.Is there any that i can point my rdbmsrealm to use
    the connection pool for Database instead
    Thanks in advance
    Nirmala

    I believe not- the realm restricts access to connection pools to those who
    are allowed it, so if the realm needs the connection pool to start up, and
    you can't open the connection pool without the realm then you have a bit of
    a no-chicken and no-egg situation, which is I believe one of the reasons why
    there is no use of connection pools, ejbs, jndi, servlets etc. in the realm
    (along with other reasons, like why would it be provided with a servlet)
    The delegate pool acts somewhat similarly to a connection pool, and can even
    use the same database, so I'm not sure what the advantage would be
    Terry
    Nirmala devi <[email protected]> wrote in message
    news:[email protected]..
    >
    I think the rdbms realm uses different connection as it need to be setbefore
    the connection pool for Database.Is there any that i can point my rdbmsrealm to use
    the connection pool for Database instead
    Thanks in advance
    Nirmala

  • Java Pet Store and connection pooling

    Hi. Does the Java Petstore version 1.2 use connection pooling? I know in the database.properties file it has the following variables:
    Pool.MaximumActiveConnections=10
    Pool.MaximumIdleConnections=5
    Pool.MaximumCheckoutTime=120000
    Pool.TimeToWait=10000
    Pool.PingEnabled=false
    Pool.PingQuery=select * from dual
    Pool.PingConnectionsOlderThan=0
    Pool.PingConnectionsNotUsedFor=0
    Pool.QuietMode=true
    To me this seems like it is using connection pooling. However, on our server, we are continually running out of connections and I KNOW that our other apps ARE using connection pooling. So I'm just wondering if someone can confirm with me that the Java Pet Store is in fact using connection pooling.
    Thanks in advance,
    Dylan

    I forgot to mention that I'm using the Ibatis version of the JPetstore.

  • Difference between Datasource and Connection Pool

    Hi,
    What is the major difference between Datasource and Connection Pool.
    Both the Datasource with JNDI and Connectio Pool will serve the pool of connections. Then what is the difference.
    regards,
    Raj

    A datasource is not implicitly a connection pool. You can configure that in the datasource properties. A connection pool is also not implicitly a datasource. You can create your own connection pool using the java.sql interfaces. A datasource just gives the ability to acquire the connections and access the database through JNDI. A connection pool just gives the ability to reuse a set of connections which are created/closed/controlled by the connection pool logic.

  • A very surprise problem about JDBC and connection pool

    I occur a very problem about JDBC and connection pool on Weblogic Platform
    8.1.
    There is a table in Oracle
    Table
    Name: t1
    id varchar2(5);
    content clob;
    id is primary key.
    If I use a connection pool to connect to Oracle,like following program:
    InitialContext ic = new InitialContext();
    DataSource ds = (DataSource) ic.lookup("cgOracleDataSource");
    con = ds.getConnection();
    then following program will throw a ClassCastException
    String sql = "select content from t1 where id = ?";
    PreparedStatement pst = con.prepareStatement(sql);
    pst.setString(1,"001");
    oracle.sql.CLOB clob = (oralce.sql.CLOB)rs.getClob("content") //this
    statement will throw ClassCastException
    but if I use JNDI to connect to Oracle,like following program, then those
    program above is ok
    private String dbdriver="oracle.jdbc.driver.OracleDriver";
    private String dburl="jdbc:oracle:thin:@192.168.7.148:1521:ep";
    private String username="ep";
    private String password="epuser";
    Class.forName(dbdriver);
    conn = DriverManager.getConnection(dburl, username, password);
    conn.setAutoCommit(false);
    On the contrary, if I use JNDI to connect to Oracle, following program will
    throw ClassCastException
    weblogic.jdbc.vendor.oracle.OracleThinClob clob =
    (weblogic.jdbc.vendor.oracle.OracleThinClob)rs.getClob("content");
    but it is fine if I use connection pool to connect to Oracle.
    I am confused this problem, who can tell me why?
    Daniel

    When you are getting connection using datasource lookup from weblogic
    connection pool, this connection is internally wrapped and hence you have to
    cast it to weblogic.jdbc.vendor.oracle.OracleThinClob which you do and so it
    works.
    But when you get connection by loading driver straight, you are getting naked
    oracle connection. In this case when you cast it to oracle.sql.Clob it works,
    as you have seen in your test case.
    I hope this explains what is going on with your code.
    Thanks,
    Mitesh
    Daniel wrote:
    I occur a very problem about JDBC and connection pool on Weblogic Platform
    8.1.
    There is a table in Oracle
    Table
    Name: t1
    id varchar2(5);
    content clob;
    id is primary key.
    If I use a connection pool to connect to Oracle,like following program:
    InitialContext ic = new InitialContext();
    DataSource ds = (DataSource) ic.lookup("cgOracleDataSource");
    con = ds.getConnection();
    then following program will throw a ClassCastException
    String sql = "select content from t1 where id = ?";
    PreparedStatement pst = con.prepareStatement(sql);
    pst.setString(1,"001");
    oracle.sql.CLOB clob = (oralce.sql.CLOB)rs.getClob("content") //this
    statement will throw ClassCastException
    but if I use JNDI to connect to Oracle,like following program, then those
    program above is ok
    private String dbdriver="oracle.jdbc.driver.OracleDriver";
    private String dburl="jdbc:oracle:thin:@192.168.7.148:1521:ep";
    private String username="ep";
    private String password="epuser";
    Class.forName(dbdriver);
    conn = DriverManager.getConnection(dburl, username, password);
    conn.setAutoCommit(false);
    On the contrary, if I use JNDI to connect to Oracle, following program will
    throw ClassCastException
    weblogic.jdbc.vendor.oracle.OracleThinClob clob =
    (weblogic.jdbc.vendor.oracle.OracleThinClob)rs.getClob("content");
    but it is fine if I use connection pool to connect to Oracle.
    I am confused this problem, who can tell me why?
    Daniel

  • ADF Swing and connection pooling

    I am using Java Web Start, ADF Swing, ADF Business Components and Oracle database 10g.
    My application needs to support 300 users.
    Can I use database connection pooling in this configuration?
    Any relevant document about this subject? Thanks.

    Hi,
    only if you would deploy ADF BC as EJB. Otherwise the ADF BC sources are on the client, which means that each client creates its own connection
    Frank

  • Problem with JNDI/LDAP AND connection pool

    I'm a newbie to Java but am attempting to write a servlet that retrieves info use to populate the contents of drop down menus. I'd like to only have to do this once. The servlet also retrieves other data (e.g. user profile info, etc ...). I'd like to be able to use the connection pool for all of these operations but I'm getting a compile error:
    public class WhitePages extends HttpServlet {
    ResourceBundle rb = ResourceBundle.getBundle("LocalStrings");
    public static String m_servletPath = null;
    public static String cattrs = null;
    public static String guidesearchlist[] = {};
    public static int isLocalAddr = 0;
    private int aeCtr;
    private String[] sgDNArray;
    private HashMap sgDN2DNLabel = new HashMap();
    private HashMap sgDN2SearchGuide = new HashMap();
    private String strport;
    private int ldapport;
    private String ldaphost;
    private String ldapbinddn;
    private String ldapbindpw;
    private String ldapbasedn;
    private int maxsearchcontainers;
    private int maxsearchkeys;
    private String guidesearchbases;
    private String guidecontainerclass;
    private String strlocaladdr;
    private String providerurl;
    // my init method establishes the connection
    // pool and then retrieve menu data
    public void init(ServletConfig config) throws ServletException {
    super.init(config);
    String strport = config.getInitParameter("ldapport");
    ldapport = Integer.parseInt(strport);
    String strconts = config.getInitParameter("maxsearchcontainers");
    maxsearchcontainers = Integer.parseInt(strconts);
    String strkeys = config.getInitParameter("maxsearchkeys");
    maxsearchkeys = Integer.parseInt(strkeys);
    ldaphost = config.getInitParameter("ldaphost");
    ldapbinddn = config.getInitParameter("ldapbinddn");
    ldapbindpw = config.getInitParameter("ldapbindpw");
    ldapbasedn = config.getInitParameter("ldapbasedn");
    guidesearchbases = config.getInitParameter("guidesearchbases");
    guidecontainerclass = config.getInitParameter("guidecontainerclass");
    strlocaladdr = config.getInitParameter("localaddrs");
    providerurl = "ldap://" + ldaphost + ":" + ldapport;
    /* Set up environment for creating initial context */
    Hashtable env = new Hashtable(11);
    env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory");
    env.put(Context.PROVIDER_URL, providerurl.toString());
    /* Enable connection pooling */
    env.put("com.sun.jndi.ldap.connect.pool", "true");
    StringTokenizer st = new StringTokenizer(guidesearchbases, ":" );
    String guidesearchlist[] = new String[st.countTokens()];
    for ( int i = 0; i < guidesearchlist.length; i++ ) {
    guidesearchlist[i] = st.nextToken();
    // Get a connection from the connection pool
    // and retrieve the searchguides
    StringBuffer asm = new StringBuffer(""); // This is the advanced search menu htmlobject buffer
    StringBuffer strtmpbuf = new StringBuffer(""); // This is the simple search menu htmlobject buffer
    try {
    StringBuffer filter = new StringBuffer("");
    filter.append("(objectclass=" + guidecontainerclass + ")");
    String[] attrList = {"dn","cn","searchguide"};
    SearchControls ctls = new SearchControls();
    ctls.setReturningAttributes(attrList);
    ctls.setSearchScope(SearchControls.SUBTREE_SCOPE);
    String attrlabelkey;
    sgDNArray = new String[guidesearchlist.length];
    for( int i = 0; i < guidesearchlist.length; i++ ) {
    // Search each of the namingspaces where
    // searchguides exist then build
    // the dynamic menus from the result
    DirContext ctx = new InitialDirContext(env);
    NamingEnumeration results = ctx.search(guidesearchlist, filter, ctls);
    I get a compile error:
    WhitePages.java:164: cannot resolve symbol
    symbol : method search (java.lang.String,java.lang.StringBuffer,javax.naming.directory.SearchControls)
    location: interface javax.naming.directory.DirContext
    NamingEnumeration results = ctx.search(guidesearchlist[i], filter, ctls);
    ^
    WhitePages.java:225: cannot resolve symbol
    symbol : variable ctx
    location: class OpenDirectory
    ctx.close();
    ^
    Can anyone help? If there is someone out there with JNDI connection pool experience I would appreciate your assistance!

    Manish
    The issue may not be related to the number of connections or the initial
    connections. Check your heap size (ms, mx). Turn on verbosegc. Your heap may
    not be big enough to accept the 25,000 rows.
    Bernie
    "Manish Kumar Singh" <[email protected]> wrote in message
    news:3e6c34ca$[email protected]..
    We are creating the result set with 25000 rows(each row has 56 columns) bygetting the connection using data source. With the initial capacity of the
    connection pool is 5 and the max capacity as 30 and grow connection as 1,
    the server gets out of memory exception, when we issue a new request, even
    after closing the previous connections.
    Now, if we change the initial capacity to 1 and rest all the things assame, the issue gets resolved and the server works fine.
    Could you please help me out in this regard????
    thanks in advance
    manish

  • Weblogic 7.0 deploy exception and Connection Pooling

    Hi,
    I am using weblogic 7.0
    When I delpoy my application in the server I get the following exception when deployed through webLogic builder deploy tool
    <Aug 24, 2004 1:26:32 PM IST> <Error> <Deployer> <149201> <The Slave Deployer failed to complete the deployment task with id 0 for the application MyApp.
    weblogic.management.ApplicationException: No modules to prepare on myserverfor application named MyApp
    at weblogic.j2ee.J2EEApplicationContainer.prepare(J2EEApplicationContainer.java:545)
    at weblogic.management.deploy.slave.SlaveDeployer.processPrepareTask(SlaveDeployer.java:1062)
    at weblogic.management.deploy.slave.SlaveDeployer.prepareUpdate(SlaveDeployer.java:730)
    at weblogic.drs.internal.SlaveCallbackHandler$1.execute(SlaveCallbackHandler.java:24)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:213)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:189)
    but
    then when I invoke the application the application is successfully executed
    My application.xml file
    is like
    <application>
    <display-name>MyApp</display-name>
    <module>
    <web>
    <web-uri>MyApp.war</web-uri>
    <context-root>MyApp</context-root>
    </web>
    </module>
    </application>
    weblogic.xml has following
    <weblogic-web-app>
    <reference-descriptor>
    <resource-description>
    <res-ref-name>jdbc/MyApp</res-ref-name>
    <jndi-name>jdbc/MyApp</jndi-name>
    </resource-description>
    </reference-descriptor>
    <charset-params>
    </charset-params>
    </weblogic-web-app>
    in weblogic-application.xml file
    <weblogic-application>
    <data-source-name>MyApp</data-source-name>
    </weblogic-application>
    web.xml has
    <resource-ref>
    <res-ref-name>jdbc/MyApp</res-ref-name>
    <res-type>javax.sql.DataSource</res-type>
    <res-auth>Container</res-auth>
    </resource-ref>
    under the
    http://localhost:7001/console
    mydomain>JDBCConnection>
    Name:jdbc/MyApp
    URL:jdbc:weblogic:oracle
    Driver Classname:weblogic.jdbc.oci.Driver
    Properties
    (key=value): User=SimpleUser
    Server=myServer
    ACL Name:blank
    Password:XXXXX
    Open String Password:XXXXX
    mydomain> JDBC Data Sources> MyApp
    Name: MyApp
    JNDI Name: jdbc/MyApp
    Pool Name: jdbc/MyApp
    Row Prefetch Enabled
    Row Prefetch Size: 48
    Stream Chunk Size: 256 bytes
    WebDescriptor-9> WebAppDescriptor-9> Resource Refs> jdbc/MyApp
    Description: blank
    Ref Name: jdbc/MyApp
    Ref Type: javax.sql.DataSource
    Auth: Container
    Sharing Scope: (none)
    WebDescriptor-9> WebAppExtDescrip...> ReferenceDescrip...> Resource Descrip...> jdbc/MyApp
    Jndi Name: jdbc/MyApp
    Resource Reference: (none)jdbc/MyApp
    now in DAO source Code
    try {
    icCtx = new InitialContext(); // Instantiate the InitialContext Object
    // Lookup the Datasource using the DBName
    strDbName = "java:comp/env/jdbc/MyApp";
    dsObject = (DataSource) icCtx.lookup(strDbName);
    connObject = dsObject.getConnection(); // Get the Connection
    connObject.setAutoCommit(false);
    System.out.println("Conn established" +connObject );
    } catch (Exception e) {
    Now when I invoke My Application as
    http://localhost:7001/MyApp/HomePage
    I get
    Conn establishedweblogic.jdbc.rmi.SerialConnection@71d8c0
    Conn establishedweblogic.jdbc.rmi.SerialConnection@2cfbaf
    Conn establishedweblogic.jdbc.rmi.SerialConnection@5a739d
    Conn establishedweblogic.jdbc.rmi.SerialConnection@4d42cf
    different Adrress Meaning Connection Pooling is Not working.
    Where are the possible mistakes being done?Why I am not getting the same connnection and why is there an Exception in Deployment?
    Can somebody help me out?

    DAO Code
    connObject = dsObject.getConnection(); // Get the Connection
    connObject.setAutoCommit(false);
    System.out.println("Conn established" +connObject );
    } catch (Exception e) {
    Now when I invoke My Application as
    http://localhost:7001/MyApp/HomePage
    I get
    Conn establishedweblogic.jdbc.rmi.SerialConnection@71d8c0
    Conn establishedweblogic.jdbc.rmi.SerialConnection@2cfbaf
    Conn establishedweblogic.jdbc.rmi.SerialConnection@5a739d
    Conn establishedweblogic.jdbc.rmi.SerialConnection@4d42cf
    different Address Meaning Connection Pooling is Not working.
    How do I can be sure that the connection pool is working?

  • Oracle: slow performance with SELECT using ojdbc14 and connection pooling

    Hello,
    i'm working hard the last days to solve a performance problem with our customer using a oracle 10g database. For testing I used our oracle 9.2.0.1.0 database which shows the same symptoms. All doing solved nothing: the performance while using this oracle is much slower than other databases. This result I cannot trust and so I need some advice. What is missing to improve the performance on the java side?
    The webapplication I use runs fast on MySQL 4.x and SQLServer 2000, but on the above mentioned Oracle it was always 4 times slower. The webapplication uses a lot of simple SELECT-Statements without complicated joins and so on (because it should run on many different databases). Doing some days of creating tests within this webapplication, I was not able to find any entrance point for a change. All databases server I'm using, having only the default configurations after a common installation.
    To reduce the complexity I wrote a simple java application with connection pooling using only the latest libraries from apache-commons(dbcp, pool), and the latest ojdbc14 for oracle 9.2.
    First the results than the code: MySQL needed less than 1000 millisecond, SQLServer around 1000 milliseconds and Oracle over 2000 milliseconds. I stopped pooling and the results are for Oracle even worse: over 18000 milliseconds (mysql:2500, sqlserver:4100).
    I changed the classes for Oracle and used the class oracle.jdbc.pool.OracleConnectionCacheImpl from the ojdbc14-library. No difference (around 100 milliseconds more or less).
    The only Select-Statement works on this table, which has one index on HICTGID.
    It contains 259 entrances.:
    CREATE TABLE HIERARCHYCATEGORY (
      HICTGID                 NUMBER (19)   NOT NULL,
      HICTGLEVEL              NUMBER (10)   NOT NULL,
      HICTGEXTID              NUMBER (19)   NOT NULL,
      HICTGEXTPARENTID        NUMBER (19)   NOT NULL,
      HICTGNAME               VARCHAR2(255) NOT NULL
    );The application simply loops through this table using
    SELECT Hictgid, Hictgname FROM HIERARCHYCATEGORY WHERE HICTGID = ?, but I always open a connection before this query and closes this connection afterwards. So I use the pooling as much as possible. That's all SQL I'm using.
        protected static DataSource setupDataSource(String sDriver, String sUrl, String sUser, String sPwd) throws SQLException {
            BasicDataSource ds = new BasicDataSource();
            ds.setDriverClassName(sDriver);
            ds.setUsername(sUser);
            ds.setPassword(sPwd);
            ds.setUrl(sUrl);
            // The maximum number of active connections:
            ds.setMaxActive(3);
            // The maximum number of active connections that can remain idle in the pool,
            // without extra ones being released, or zero for no limit:
            ds.setMaxIdle(3);
            // The maximum number of milliseconds that the pool will wait (when there are no available connections)
            // for a connection to be returned before throwing an exception, or -1 to wait indefinitely:
            ds.setMaxWait(3000);    
            return ds;
        }I can switch by using external properties between three databases (oracle, mysql and sqlserver) and if I want I can switch pooling off. And all actions I'm interested are logged by Log4J.
        public static Connection getConnection() throws SQLException {
            Connection result = null;
            String sJdbcDriver = m_oJbProp.getString("jdbcDriver");
            String sJdbcUrl = m_oJbProp.getString("databaseConnection");
            String sJdbcUser = m_oJbProp.getString("dbUsername");
            String sJdbcPwd = m_oJbProp.getString("dbPassword");
                try {
                    if (m_oJbProp.getString("useConnectionPooling").equals("true")) {
                         if (log.isDebugEnabled()) {
                              log.debug("ConnectionPooling true");
                        if(null == m_ds) {
                            m_ds = setupDataSource(sJdbcDriver,sJdbcUrl,sJdbcUser,sJdbcPwd);
                              if (log.isDebugEnabled()) {
                                   log.debug("DataSource created");
                        result = m_ds.getConnection();
                    } else {
                        // No connection pooling:
                         if (log.isDebugEnabled()) {
                              log.debug("ConnectionPooling false");
                        try {
                            Class.forName(sJdbcDriver);
                            result = DriverManager.getConnection(sJdbcUrl, sJdbcUser, sJdbcPwd);
                        } catch (ClassNotFoundException cnf) {
                            log.error("Exception: Class Not Found. ", cnf);
                            System.exit(0);
    (.. ErrorHandling ...)Here is the code fragment which is doing the work:
                     StringBuffer sb = new StringBuffer();
                while (lNextBottom <= lNextCeiling) {
                     con = getConnection();
                     innerSelStmt = con.prepareStatement("SELECT Hictgid, Hictgname FROM HIERARCHYCATEGORY WHERE HICTGID = ?");
                     innerSelStmt.setLong(1, lNextBottom);
                     rsInner = innerSelStmt.executeQuery();
                     if ((rsInner != null) && (rsInner.next())) {
                         sb.append(rsInner.getLong(1) + ", " + rsInner.getString(2) + "\r");
                          if (log.isDebugEnabled()) {
                               log.debug("Inner Statement: " + rsInner.getLong(1) + "\r");
                     rsInner.close();
                     con.close();
                     lNextBottom++;
                 if (log.isInfoEnabled()) {
                      log.info("\rResult values: Hictgid, Hictgname \r");
                      log.info(sb.toString());
                 }and the main method:
        public static void main(String[] args) {
            try {
                 long lStartTime = System.currentTimeMillis();
                 JdbcBasic oJb = new JdbcBasic();
                 boolean bSuccess = false;
                 bSuccess = oJb.getHierarchycategories();
                 if (log.isInfoEnabled()) {
                      log.info("Running time: " + (System.currentTimeMillis() - lStartTime));
                 if (null != m_ds) {
                     printDataSourceStats(m_ds);
                      shutdownDataSource(m_ds);
                      if (log.isInfoEnabled()) {
                           log.info("Datasource closed.");
             } catch (SQLException sqe) {
                  log.error("SQLException within  main-method", sqe);
        }My database values are
    databaseConnection=jdbc:oracle:thin:@SERVERDB:1521:ora
    jdbcDriver=oracle.jdbc.driver.OracleDriver
    databaseConnection=jdbc:jtds:sqlserver://SERVERDB:1433/testdb
    jdbcDriver=net.sourceforge.jtds.jdbc.Driver
    databaseConnection=jdbc:mysql://localhost/testdb
    jdbcDriver=com.mysql.jdbc.Driver
    dbUsername=testusr
    dbPassword=testpwdThanks for your reading and maybe for your help.

    A few comments.
    There is of course another difference between your test cases then just the database. There is also the driver. And I suspect that in at least the case with the jtds driver it is helping you along where you are doing something silly and the Oracle driver is not.
    Before I explain the next part I would say the speed differences between MS-SQL and MySQL look about right I think you are aiming here for MS-SQL level performance not MySQL. (For a bunch of reasons MySQL is inherently faster but there are MANY drawbacks as well which have been well discussed on previous threads)
    Here is where I believe your problem lies
    while (lNextBottom <= lNextCeiling) {
                     con = getConnection();
                     innerSelStmt = con.prepareStatement("SELECT Hictgid, Hictgname FROM HIERARCHYCATEGORY WHERE HICTGID = ?");
                     innerSelStmt.setLong(1, lNextBottom);
                     rsInner = innerSelStmt.executeQuery();
                     if ((rsInner != null) && (rsInner.next())) {
                         sb.append(rsInner.getLong(1) + ", " + rsInner.getString(2) + "\r");
                          if (log.isDebugEnabled()) {
                               log.debug("Inner Statement: " + rsInner.getLong(1) + "\r");
                     rsInner.close();
                     con.close();
                     lNextBottom++;
                 }There at least four things that are wrong with above.
    1) Why are you preparing the statement INSIDE the loop. Let us for a moment say that the loop will spin 100 times. That means that you are preparing the same statement 100 times. This is bad. It is also very relevant because for example the Jtds driver is going to be caching the prepared statements you make so that actually while you try and prepare it 100 times it only actually does it once... but in Oracle I don't know what it is doing for sure but if it is preparing on each pass well than that bit of it is going take 100 times longer then it should.
    2) You are opening and closing the connection on each pass through the loop... also a terrible idea. You need to fix this first so that you can repeatedly use the same prepared statement.
    3) Why are you looping in the first place? More on this later.
    4) Where do you close the PreparedStatement? It doesn't look like you do.
    Okay so for starters your loop should look a lot more like this...
    code]
    con = getConnection();
    innerSelStmt = con.prepareStatement("SELECT Hictgid, Hictgname FROM HIERARCHYCATEGORY WHERE HICTGID = ?");
    while (lNextBottom <= lNextCeiling) {
    innerSelStmt.setLong(1, lNextBottom);
    rsInner = innerSelStmt.executeQuery();
    if ((rsInner != null) && (rsInner.next())) {
    sb.append(rsInner.getLong(1) + ", " + rsInner.getString(2) + "\r");
    rsInner.close();
    lNextBottom++;
    innerSelStmt.close();
    con.close();
    I think the code above (and you can put your debug stuff back if you want) which uses ONE connection and ONE prepared Statement will improve your performance dramatically.
    The other question though I would as is why in the hell you are doing 100 or whatever number of queries anyway. This can be done all in ONE query which again will improve performance.
    Your query and such should look like this I think.
    String sql = "SELECT Hictgid, Hictgname FROM HIERARCHYCATEGORY WHERE HICTGID >=? AND HICTGID<=?";
    PreparedStatement ps = conn.prepareStatement(sql);
    ps.setLong(1,lNextBottom );
    ps.setLong(2,lNextCeiling);
    ResultSet rs = ps.executeQuery();
    while(rs.next()){
      // your appending to string buffer code goes here
    }and I can't understand why you're not doing that in the first place.

  • Can admin.jar create oc4j users and connection pools that use those users

    Hi
    I have an ADF BC application written in jdev 10.1.3.3 deployed to standalone oc4j 10.1.3
    When I deploy the application I use the enterprise manager to create the users on the security provider/realms tab. I then set up the connection pools in jdbc resources to use those users via the username and indirect password fields. I also set the minimum number of connections on the attributes tab.
    I have read the following document but I cannot find any reference to setting up users, connection pools with indirect passwords or minimum number of connections.
    http://download-uk.oracle.com/docs/cd/B31017_01/web.1013/b28950/adminclient.htm#BABHJAFE
    Is it possible to do using admin.jar?
    thanks
    paul schweiger

    I'm not sure about setting indirect passwords on the connection pool creation -- never tried it. It's probably treated purely as a lexical string, so may well be able to to issue the CP creation command with the "->USER" entry as the password.
    To create realms, users, groups, etc. you need to use the $ORACLE_HOME/j2ee/home/jazn.jar utility: http://download.oracle.com/docs/cd/B25221_04/web.1013/b14429/admintool.htm#g1022417
    The options for connection pool parameters such as min/max connections aren't directly expressable in the command. I'll need to look at the code and see if they can be passed in as non checked options via the factoryproperties. If not, then you can create a JMX client to use the MBeans that are created for the CP post deployment to change its behaviour.
    -steve-

  • Distributed transactions and connection pooling

    Hi,
    We have a problem with the enlistment of connections in distributed transactions.
    The following very simple C# program does not work correctly (a simple form with one button and a class hosted in COM+). If you put a breakpoint on "cnOraTx.Close();" you will see that the inserted record is already visible in the database although the transaction has not commited yet.
    If you comment out the lines between //START and //END everything works as expected.
    Also, if we use "Pooling=false" in the connection string, everything works fine again, but since we are writing a web application, we really need the connection pooling.
    We are using ODP.NET 9.2.0.2.102 (I also tried with the ODP.NET 9.2.0.4.0 BETA) and an oracle 8.1.7 database.
    Best Regards,
    Piet
    private void button1_Click(object sender, System.EventArgs e)
    //When commenting the following lines the connection is enlisted in the distributed transaction
    //START
    OracleConnection cnOraTx;
    cnOraTx = new Oracle.DataAccess.Client.OracleConnection("Data Source=ECOMP532;User ID=USER;Password=PWD");
    cnOraTx.Open();
    cnOraTx.Close();
    cnOraTx.Dispose();
    //END
    OpenOraTransConn obj = new OpenOraTransConn();
    obj.Connect();
    //This class is going to be hosted within COM+
    [Transaction(TransactionOption.Required)]
    public class OpenOraTransConn: ServicedComponent
    private OracleConnection cnOraTx;
    private OracleCommand cmd;
    internal void Connect()
    cnOraTx = new OracleConnection("Data Source=ECOMP532;User ID=USER;Password=PWD");          
    cnOraTx.Open();
    cmd = new OracleCommand();
    cmd.Connection = cnOraTx;
    cmd.CommandText = "INSERT INTO SYSADM.PERSON (PE_KEY) VALUES(130000)";
    cmd.ExecuteNonQuery();
    cnOraTx.Close();
    cnOraTx.Dispose();
    ContextUtil.SetComplete();

    Hello:
    We are experiencing the exact same problem. INSERT, UPDATE or DELETE statements that should roll back because an exception is being thrown from inside our ServicedComponent-derived class (which is set to TransactionOption.Required and uses AutoComplete) are not -- and instead are being committed to the database.
    Were you able to figure out why this is happening, and what can be done to get around it? We too were able to avoid the problem by setting Pooling=False to our connect string, but for a variety of reasons we want to use connection pooling ...!

  • JDriver for MS SQL Server 6.5 and Connection Pooling

    I was given the unfortunate task :-) of getting data out of M$FT SQL 6.5. I set
    up a JDBC connection pool using jDriver in mssqlserver4v65.jar, and created a
    JDBCDataSource for the pool. I am using a stateless session bean + JDBC (with
    the DAO pattern) to get data. In the DAO class I have an instance variable for
    the datasource, which I look up in the constructor. In the DAO's business method
    I RELIGIOUSLY call datasource.getConnect() first, and ALWAYS call connection.close()
    in the finally block. Now the initial requests are fine, but after a while I
    got a weblogic.common.ResourceException telling me there were no more connection
    available in the pool. Is this a jDriver bug? I never run into such a problem
    with an Oracle connection pool using the thin driver.
    Any insight will be greatly appreciated.
    Eric Ma

    Eric Ma wrote:
    Joe:
    Connection is a LOCAL variable declared in each method. DataSource is an instance
    variable.That sounds fine... let me see your code (main block plus finally block). How long does this
    take to reproduce? Show me your pool definition.
    thanks,
    Joe
    >
    >
    Eric
    Joseph Weinstein <[email protected]> wrote:
    Eric Ma wrote:
    I was given the unfortunate task :-) of getting data out of M$FT SQL6.5. I set
    up a JDBC connection pool using jDriver in mssqlserver4v65.jar, andcreated a
    JDBCDataSource for the pool. I am using a stateless session bean +JDBC (with
    the DAO pattern) to get data. In the DAO class I have an instancevariable for
    the datasource, which I look up in the constructor. In the DAO's businessmethod
    I RELIGIOUSLY call datasource.getConnect() first, and ALWAYS call connection.close()
    in the finally block. Now the initial requests are fine, but aftera while I
    got a weblogic.common.ResourceException telling me there were no moreconnection
    available in the pool. Is this a jDriver bug? I never run into sucha problem
    with an Oracle connection pool using the thin driver.
    Any insight will be greatly appreciated.
    Eric MaHi. Is the connection object an instance variable? That would be a problem.
    The connection object has to be a method variable to be safe from multithreading
    issues.
    Joe

  • MTS, OraOLEDB provider, and Connection Pooling

    I have read through "Using Microsoft Transaction Server with Oracle8" (http://technet.oracle.com/doc/oracle8i_816/nt.816/a73029/prog.htm#1082299) and the OraOLEDB provider document, and found little coverage in regard to the subject of "Connection Pooling." Could you point me to additional documentation and code samples that would help guide me in designing my application.
    I am designing a web based distributed application subsystem with MTS/COM+, OraOLEDB provider (8.1.7.2.0), Oracle Services for MTS (8.1.7.0.0) and Oracle 8i (8.1.6). A major requirement of this subsystem is that it scales well as it is utilized by more and more applications and users. This requirement could be accomplished much easier if the OraOLEDB Provider provides Connection Pooling. Much of the documentation I have seen from Microsoft describes Connection Pooling using ODBC. The documentation from Oracle discusses Connection Pooling with OO4O or OCI. Does the OraOLEDB Provider provide Connection Pooling? If so could you point me to additional documentation and samples?
    Thanks,
    Bryan Wood

    I am facing the same issue. This is strange, no one has responded to this for a year. What does it mean? It sux so bad that no one uses OmniPortlet? It's clear when you execute a sql thru this stupid OmniPortlet it opens a connection and never releases it. I have seen this by turning off everything and keep refreshing the OmniPortlet.
    What bothers me more is that there seems to be no freakn documentation on this especially around how to do this from the console and how to use the jndi datasource. There has to be a way. Please help us out on this either from inside or outside oracle.
    The world class Oracle support seems to be a joke.

  • Javamail performance and connection pooling

    Dear Javamail users and programmers,
    I am new to javamail. We are working on a commercial web mail project and using Javamail to connect with an IMAP/SMTP clustered server group to read and write mails.
    Our application will have 400000 concurrent users in the system and an Approximate , we will have 200 servers (Glassfish 3 ) and each server will have 2000 active users at time.
    Now my problem! At the moment, we are opening the store each time we read or store mails for each user. I doubt this will have performance issues in production.
    Does anyone have experience using Javamail in this dimension?
    I read the connection pooling mechanism in the package com.sun.mail.imap Descriptio. If i understood correctly, this will require at-least one dedicated connection per user to the server . I think, that will be too many connections at a time for any Imap server cluster system.
    Is there any other method of doing connection pooling?
    Btw in which scenario I should increase the mail.imap.connectionpoolsize to more than one? I assume, i only need to increase this parameter if i want to keep more than one folder open for a particular user at time, isn't it?
    What will be the best approach which suite to our application?
    Thank you very much for any help.
    With regards,
    Alvin Antony

    Connection pooling isn't likely to help in your scenario. IMAP connection pooling does not allow multiple
    users to use the same connection to the server. Unless you want to map all of your web mail users to a
    single IMAP user, connection pooling won't help you.
    The general issue of managing sessions and connections was discussed briefly in this other thread:
    [http://forums.sun.com/thread.jspa?threadID=5423307|http://forums.sun.com/thread.jspa?threadID=5423307]
    I suspect you're going to need to do some experiments to determine the best approach.

  • SessionCookie and Connection pooling

    hi,
    we use BC4J with connection pooling enable and we have some misunderstandings ... We have chosen a navigation through our web application through wizards ...
    We only enter data in the database at the end of the wizard so we have chosen to use the release mode stateful for our BC4J aplication module.
    After one page, in a struts action, we create a Row of a ViewObject ... and in the second page, we want to retrieve the row created ... but we can't... the application module that we get seems to be another.
    Is it a normal behavior ?
    How do we get the instance of application module we have instantiated at the beginning of the wizard ? Is it a problem with the connection pooling ?
    Some detail: we use a class HttpContainer to get our application module instance ? Are we wrong ? should we get these instance directly from the PoolManager ?
    Tanx for any comment.

    i would ignore the idea all together, unlessyour
    connection has state or something, here readthis:
    http://nikhilb020875.wordpress.com/2006/05/24/cache-vs
    -pool/Hard to say for sure but I would guess your response
    is meaningless. It certainly isn't clear to me why
    you think that link is relevant.if you had read the first 2 lines from the page..I read the entire link.

Maybe you are looking for

  • My ipad will not completely shut off.  If I try to power down, it reboots on its own.

    When I hold the sleep button down to power off my ipad, I get the red slide that confirms that I want to power down.  I slide it like I always have, but once it shuts down, it immediately reboots.  I can't get it to shut off completely.

  • How to hide Saved Searches in the header area of web ui

    Hi All, My Query Is how to hide Saved Searches in the header area of web ui. For This is there any configuration or we have do through the code. Thanks & Regards, Venkat

  • Oracle 10g Enterprise vs Standard Edition performance

    For a database hosted on a single machine is there any performance advantage in using Oracle 10g Enterprise Edition over Standard Edition? For our application we do not require data warehousing or OLAP, just the ability to store and query a large amo

  • What is the Cisco 881G "PDP establish max timeout" ?

    Hi What is the Cisco 881G "PDP establish max timeout"? The Cisco 881G 3G connection is to be disconnect by PDP establish max timeout. I want to infinite to establish this connection. What parameter I can adjust?

  • Calculation with additional costs

    Hi all, we have a calculation based on info records. The calculation is done based on condition PB00 for the main vendor. The Problem is: for some products we have additional costs from other intermediate vendors. For example: Main vendor has a condi