Specifying initialization SQL for a connection pool

Hi,
I am having a locale problem with my application server and oracle database server. I would like to issue an "ALTER SESSION SET NLS_LANG= ..."
Is there any way to specify an initialization SQL or any other recommentations from internationalization perspective.
Thanks in advance

It's ok I found the answer to connection pooling at http://www.developer.com/db/print.php/10920_2172891_3 if anyone is interested.
Cheers!
James

Similar Messages

  • Does com.evermind.sql.DriverManagerDataSource provide connection pooling?

    Hi,
    The class defined in default data-sources.xml file is com.evermind.sql.DriverManagerDataSource. In Oracle9i JDBC Developer's Guide and Reference Release 1 (9.0.1) documentation's chapter 15, Oracle encourages to use this emulated data source for it is fast and efficent.
    But I could not find any info about whether com.evermind.sql.DriverManagerDataSource provides connection pooling.
    Actually, I want to make sure that if I use default data-sources.xml and ejb-location attribute for lookup method, will I be able to get pooled connection?
    Thanks a lot.

    Hi,
    Thank you for taking your time.
    I could manage to get connections from the com.evermind.sql.DriverManagerDataSource using jdbc/OracleDS in JNDI lookup string.
    As far as I've understood from the document you pointed out, I could not see "connection pooling" expression directly for emulated class. But there is an explanation that says "Connections retrieved within a single transaction from a data source using the same username and password causes the logical connections to share a single physical connection.". Is this what you've mentioned?
    Lastly, how can I make sure that the connections are coming from the pool? Is there a way to see that?
    Thanks again.

  • Shall I use one datasource for multiple connection pool?

    Hi,
    I need to clarrify that, Shall I use one Datasource for multiple connection pool in distributed transaction?
    Thanks with regards
    Suresh

    No. If its transactions across multiple databases you should use different datasources.

  • Any way to disable encryption of password for database connection pool?

    Dear all,
    Does anybody know how to disable the password encryption for jdbc connection pool under weblogic 8.1? I need to put clear text password in the config.xml but it seems there's no way to disable the password encryption. Any help is appreciated. Thx in advance.
    Paul

    paul wee wrote:
    Dear all,
    Does anybody know how to disable the password encryption for jdbc connection pool under weblogic 8.1? I need to put clear text password in the config.xml but it seems there's no way to disable the password encryption. Any help is appreciated. Thx in advance.
    PaulWhen you create the pool, don't give it any password at all, but when you add the
    driver properties, add
    password=mypassword
    as one of the properties.
    Joe

  • How to get ManagedBean for C3P0 connection pool.

    Hi there,
    How to get ManagedBean(C3P0PooledDataSourceMBean) for C3P0 connection pool, as the object name is getting constructed during run time.
    Thanks,
    Sid

    Hi there,
    How to get ManagedBean(C3P0PooledDataSourceMBean) for C3P0 connection pool, as the object name is getting constructed during run time.
    Thanks,
    Sid

  • Which DataSource class to use for DB connection pooling?

    Hi,
    can someone point me in the direction of some (sample?working?) data-sources.xml configurations that pool the DB connections please. I don't have a requirement for TPC, so either native or emulated would be fine, but I need a LOT less db connections for multiple users using stateless sessions on the same database/datasource than I am currently getting. An added bonus would be being able to use the "Monitor Performance" button in Enterprise Manager.
    thanks
    Brigette

    data-sources.xml configurations that pool the DB connections
    Define a data source connection pool with a data-source element in data-sources.xml file.
    <data-source
         class="oracle.jdbc.pool.OracleConnectionPoolDataSource"
              name="OracleDS"
              location="jdbc/OracleDS"
              xa-location="jdbc/xa/OracleXADS"
              ejb-location="jdbc/OracleDS"
              connection-driver="oracle.jdbc.driver.OracleDriver"
              username=""
              password=""
         url="jdbc:oracle:thin:@<host>:<port>:<SID>"
              inactivity-timeout="30"
         />

  • How to Retrieve Server Name for creating connection pool during startup!

    Hi All,
    I am going thru the edocs documentation of weblogic for creating the connection pool and the datasource dynamically. The URL I referred to was as under
    http://edocs.bea.com/wls/docs81/jdbc/programming.html
    There is a sample given in the above-mentioned URL. The Server MBean is created by passing the server name.
    The code below mentioned was have placed in my dblib.java
    svrAdminMBean = (ServerMBean)adminMBeanHome.getAdminMBean("myserver", "Server");
    I am creating the connection pool from the servlet by invoking the dblib.java
    I cannot hard-code the server name in the dblib.java since the same code was shared across multiple servlets.
    Each Servlet will create its own connection pool during application server startup.
    Is there a way to retrieve the server name in which the dblib.java is invoked.
    Any pointers to info source will be REALLY appreciated.
    Many Thanks in Advance,
    C R Baradwaj

    You can get it from the Java system property weblogic.Name, i.e. System.getProperty("weblogic.Name");
    Cheers
    Feargal

  • Does JNDI always return the same DataSource reference for a connection pool

    Hi,
    In my project, I have a class called DBConnect which has a method called
    getConnection(). This method returns a data base Connection object from the
    pool. I am doing this to avoid replicating code.
    Here, each time a database connection is required this method looks up for
    the pool using JNDI , gets the DataSource and then gets the data base
    connection.
    What I want to know is that, can I get this DataSource reference only once,
    store it in an instance variable and use the same value for getting the
    connections when ever needed. This wud reduce the overhead of making the
    lookup each time.
    but wud this lead to probs. is there a threat of having a stale reference.
    Or is there a better way to do this.
    Thanks,
    Manohar

    Hello,
    In our EJBs, we successfully cache the DataSource object as an instance
    variable. Since bean access is synchronized, the concurrency issue Jeff
    Wang mentioned is dealt with.
    Eron
    "Manohar" <[email protected]> wrote in message
    news:[email protected]..
    Hi,
    In my project, I have a class called DBConnect which has a method called
    getConnection(). This method returns a data base Connection object fromthe
    pool. I am doing this to avoid replicating code.
    Here, each time a database connection is required this method looks up for
    the pool using JNDI , gets the DataSource and then gets the data base
    connection.
    What I want to know is that, can I get this DataSource reference onlyonce,
    store it in an instance variable and use the same value for getting the
    connections when ever needed. This wud reduce the overhead of making the
    lookup each time.
    but wud this lead to probs. is there a threat of having a stalereference.
    >
    Or is there a better way to do this.
    Thanks,
    Manohar

  • Create a dedicated connection pool for initialization blocks

    Hi,
    I'm using OBIEE11.6, then I set a session initialization block in RPD, and this block is based on connection pool '"My_DB".
    "My_CP"'.
    when Consistency Checking it warning as follow:
    Initialization Block 'Authorization' uses Connection Pool '"My_DB".
    "My_CP"' which is used for report queries. This may impact query performance.
    but there is no table under the connection pool "My_CP",so I don't know why it say it's used for report queries? and how to remove the warning?
    any one know it?
    Thank you!

    Hi Leo,
    Generally, when there is only one connection pool for a database in physical layer, the BI Server understands this to be the only connection pool for queries (I do not think this really checks if there are underlying tables. I think this is because there is a way to add tables to a database by right clicking on connection pool and choosing import metadata.).
    As a good practise, when you have init block pointing to a specific database please make sure that you create another connection pool just for the use by init blocks. This would make sure that the report queries and init blocks do not go on a single pool.
    So, for your case, create a second connection pool and point your init blocks to the second one. Yes, you cannot point to the first one as it is kind of reserved by BI Server for reports. (Unless you change this in the Options menu of .rpd)
    Hope this helps.
    Thank you,
    Dhar

  • Creating a connection pool using SQL Server 2000, Sun ONE Application Serve

    Has any one succesfully configured SQL Server 2000 to work with Sun ONE Application Server 7 on Windows 2000 server service pack 4? I am embarking on a new J2EE project and I need to configure it as soon as possible.
    The problem I am having is that, when I ping the data souce name, there is a connection error.
    I have set the data source name and other details as follows:
    Under JDBC, I have set the parameters for the connection pool as follows:
    Data Source Name:      com.microsoft.jdbc.sqlserver.SQLServerDriver
    Database Name:          jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=Test
    User:               test
    Password:          test
    In the JVM settings page, I have set the prefix class path as follows for the location of the Microsoft JDBC
    drivers that I downloaded as follows:
    c:\microsoft\drivers/lib/msbase.jar
    c:\microsoft\drivers/lib/msutil.jar
    c:\microsoft\drivers/lib/mssqlserver.jar
    Under JVM Options, there is a strange setting which I don't understand: perhaps this is the cause of the
    connction error?
    -Djdbc.drivers=com.pointbase.jdbc.jdbcUniversalDriver
    Please help????

    I'm in a similar boat...
    Trying to setup AS7 JDBC and followed the instructions on the link you provided and get the following exception. I kept the case the same, thinking 'setpassword" was incorrect, so I tried changing the property to "Password", but get the same exception but it points to "setPassword" instead.
    SEVERE: RAR5041:Cannot get jdbc connection
    com.sun.enterprise.repository.J2EEResourceException
    java.lang.NoSuchMethodException: setpassword
    at com.sun.enterprise.repository.JdbcConnectionPool.createDataSource(JdbcConnectionPool.java:243)
    at com.sun.enterprise.resource.JdbcUrlAllocator.createResource(JdbcUrlAllocator.java:80)
    at com.sun.enterprise.resource.IASNonSharedResourcePool.createSteadyResources(IASNonSharedResourcePool.java:856)
    at com.sun.enterprise.resource.IASNonSharedResourcePool.initPool(IASNonSharedResourcePool.java:416)
    at com.sun.enterprise.resource.IASNonSharedResourcePool.internalGetResource(IASNonSharedResourcePool.java:625)
    at com.sun.enterprise.resource.IASNonSharedResourcePool.getResource(IASNonSharedResourcePool.java:520)
    at com.sun.enterprise.resource.PoolManagerImpl.getResourceFromPool(PoolManagerImpl.java:263)
    at com.sun.enterprise.resource.JdbcXAConnection.<init>(JdbcXAConnection.java:74)
    at com.sun.enterprise.resource.Jdbc10XaAllocator.createResource(Jdbc10XaAllocator.java:94)
    at com.sun.enterprise.resource.IASNonSharedResourcePool.createSteadyResources(IASNonSharedResourcePool.java:856)
    at com.sun.enterprise.resource.IASNonSharedResourcePool.initPool(IASNonSharedResourcePool.java:416)
    at com.sun.enterprise.resource.IASNonSharedResourcePool.internalGetResource(IASNonSharedResourcePool.java:625)
    at com.sun.enterprise.resource.IASNonSharedResourcePool.getResource(IASNonSharedResourcePool.java:520)
    at com.sun.enterprise.resource.PoolManagerImpl.getResourceFromPool(PoolManagerImpl.java:263)
    at com.sun.enterprise.resource.PoolManagerImpl.getResource(PoolManagerImpl.java:170)
    at com.sun.enterprise.resource.JdbcDataSource.internalGetConnection(JdbcDataSource.java:241)
    at com.sun.enterprise.resource.JdbcDataSource.getConnection(JdbcDataSource.java:98)
    at com.rvi.database.jdbcConnection.getConnection(jdbcConnection.java:93)
    at com.webapp.database.ArticlesDAO.selectByYear(ArticlesDAO.java:102)
    at com.webapp.actions.ArticleAction.list(ArticleAction.java:96)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:324)
    at org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:280)
    at org.apache.struts.actions.DispatchAction.execute(DispatchAction.java:216)
    at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
    at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
    at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
    at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at org.apache.catalina.core.StandardWrapperValve.invokeServletService(StandardWrapperValve.java:720)
    at org.apache.catalina.core.StandardWrapperValve.access$000(StandardWrapperValve.java:118)
    at org.apache.catalina.core.StandardWrapperValve$1.run(StandardWrapperValve.java:278)
    at java.security.AccessController.doPrivileged(Native Method)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:274)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:505)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:212)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:505)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:203)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:505)
    at com.iplanet.ias.web.connector.nsapi.NSAPIProcessor.process(NSAPIProcessor.java:157)
    at com.iplanet.ias.web.WebContainer.service(WebContainer.java:598)

  • Unable to set-up sybase connection pool for wls6.1

    Hi All,
    I am trying to set-up sybase connection pool in wls6.1 using the supplied jConnect driver (don't know the version of the driver). In diff places I am seeing diff opinions about the settings. It is really frustrating because BEA doc shies away from documenting just the sybase details although it provides details about Oracle, informix and SQL Server.
    I just want to know these
    1. the xml string for the connection pool
    2. which config file should have it (web.xml or config.xml or something else?)
    thanks a ton in advance
    ~rakesh

    Hi,
    I've already solve the problem. I did the following:
    set the Url to be: jdbc:oracle:thin:@hostname:port:SID
    set username
    set password
    add oracle.jdbc.drivers.OracleDriver into the JVM options -Djdbc.drivers
    restart the server
    test the connection
    it works :)

  • Connection pool for ldap

    Hi
    My application is an interface to ldap directory. I have not used any ldap open source api to retrieve data from ldap. I have written connection pool that will help the application to connect to the ldap. It's working fine, but it's creating threads which are not invited.
    ConnectionPool class takes care of the connection storage and creation, while Housekeeping thread relases these connection when idle after a given time.
    Can someone please help in finding the problem in the code that creates additional threads.
    package com.ba.cdLookup.manager;
    import com.ba.cdLookup.exception.CDLookupException;
    import com.ba.cdLookup.server.CdLookupProperties;
    import java.util.Vector;
    import javax.naming.Context;
    import javax.naming.NamingException;
    public class HouseKeeperThread extends Thread {
             * Apache Logger to log erro/info/debug statements.
        protected static org.apache.commons.logging.Log log = org.apache.axis.components.logger.LogFactory
             .getLog(HouseKeeperThread.class.getName());
        private static HouseKeeperThread houseKeeperThread;
             * Close all connections existing.
             * @param connections
             *                void
        private void closeConnections(Vector connections) {
         String methodIdentifier = "closeConnections";
         int numOfConn = connections.size();
         try {
             for (int i = 0; i < numOfConn; i++) {
              Context context = (Context) connections.get(i);
              if (context != null) {
                  context.close();
                  context = null;
                  connections.remove(i);
                  numOfConn--;
                  log.info(" connection name:" + context
                       + " removed. Threadcount =" + (connections.size()));
         } catch (NamingException e) {
             String errMsg = "CDLdapBuilder connect() - failure while releasing connection "
                  + " Exception is " + e.toString();
             log.error(errMsg);
         } catch (Exception e) {
             String errMsg = "CDLdapBuilder connect() - failure while releasing connection "
                  + " Exception is " + e.toString();
             log.error(errMsg);
             * Thread run method
        public void run() {
         String methodIdentifier = "run";
         try {
             while(true){
              log.debug("house keeping :" + this + " ---sleep");
              //sleep(100000);
              log.debug("house keeping :" + this + " startd after sleep");
               sleep(CdLookupProperties.getHouseKeepConnectionTime());
              ConnectionPool connectionPool = ConnectionPool
                   .getConnectionPool();
              Vector connList = connectionPool.getAvailableConnections();
              closeConnections(connList);
         } catch (CDLookupException cde) {
             log.error(methodIdentifier + " " + cde.getStackTrace());
         } catch (InterruptedException ie) {
             log.error(methodIdentifier + " " + ie.getStackTrace());
         * @param connectionPool
         * @return
         * Thread
        public static Thread getInstance() {
         if(houseKeeperThread==null){
             houseKeeperThread = new HouseKeeperThread();
         return houseKeeperThread ;
    package com.ba.cdLookup.manager;
    import com.ba.cdLookup.exception.CDLookupException;
    import com.ba.cdLookup.server.CdLookupProperties;
    import com.ba.cdwebservice.schema.cdLookupPacket.LookupFailureReasons;
    import java.util.Properties;
    import java.util.Vector;
    import javax.naming.Context;
    import javax.naming.NamingException;
    import javax.naming.directory.DirContext;
    import javax.naming.directory.InitialDirContext;
    * ConnectionPool class manages, allocates LDAP connections. It works as a lazy
    * binder and retrieves connections only when required. It doesn't allow
    * connection greater then the maximum connection stated.
    * To retrieve a connection the singelton method getConnectionPool is to used,
    * which retruns thread safe singleton object for the connection.
    public class ConnectionPool implements Runnable {
        private int initialConnections = 0;
        private int maxConnections = 0;
        private boolean waitIfBusy = false;
        private Vector availableConnections, busyConnections;
        private boolean connectionPending = false;
        private static int threadCount = 0;
             * classIdentifier
        private final String classIdentifier = "ConnectionPool";
             * Apache Logger to log erro/info/debug statements.
        protected static org.apache.commons.logging.Log log = org.apache.axis.components.logger.LogFactory
             .getLog(CDLdapBuilder.class.getName());
             * To get the attribute a systemaccessfor out of the search result
        private String vendorContextFactoryClass = "com.sun.jndi.ldap.LdapCtxFactory";// "com.ibm.jndi.LDAPCtxFactory";
             * context factory to use
        private String ldapServerUrl = "LDAP://test.ldap.com"; // default ldap
             * server live used by default
        private String searchBase;
             * environment properties.
        private Properties env;
             * DirContext
        private javax.naming.directory.DirContext ctx;
             * default search base to be used in Corporate Directory searches
        private String defaultSearchBase = "dc=Pathway";
             * search criteria
        private String searchAttributes;
             * search filter to retrieve data from CD
        private String searchFilter;
             * CorporateDirectoryLookup Constructor
             * <p>
             * loads the setup parameters from the properties file and stores them
             * Makes a connection to the directory and sets default search base
             * @throws CDLookupException
             * @throws CDLookupException
        private ConnectionPool() throws CDLookupException {
         this.maxConnections = CdLookupProperties.getMaxConnection();// maxConnections;
         this.initialConnections = CdLookupProperties.getInitialConnection();
         this.waitIfBusy = CdLookupProperties.isWaitIfBusy();
         this.searchBase = CdLookupProperties.getDefaultSearchBase();
         //for local env testing
    //      this.maxConnections = 5;
    //      this.initialConnections = 1;
    //      this.waitIfBusy = true;
             * For keeping no of connections in the connection pool if
             * (initialConnections > maxConnections) { initialConnections =
             * maxConnections; }
         availableConnections = new Vector(maxConnections);
         busyConnections = new Vector(maxConnections);
         for (int i = 0; i < maxConnections; i++) {
             availableConnections.add(makeNewConnection());
             *  ConnectionPoolHolder provide Thread safe singleton
             *         instance of ConnectionPool class
        private static class ConnectionPoolHolder {
             * connection pool instance
         private static ConnectionPool connectionPool = null;
             * If no ConnectionPool object is present, it creates instance of
             * ConnectionPool class and initiates thread on that.
             * @return ConnectionPool Returns singleton object of ConnectionPool
             *         class.
             * @throws CDLookupException
         private static ConnectionPool getInstance() throws CDLookupException {
             if (connectionPool == null) {
              connectionPool = new ConnectionPool();
              new Thread(connectionPool).start();
              // Initiate house keeping thread.
              HouseKeeperThread.getInstance().start();
             return connectionPool;
             * Returns singleton object of ConnectionPool class.
             * @return ConnectionPool
             * @throws CDLookupException
        public static ConnectionPool getConnectionPool() throws CDLookupException {
         return ConnectionPoolHolder.getInstance();
             * getConnection retrieves connections to the corp directory. In case
             * there is no available connections in the pool then it'll try to
             * create one, if the max connection limit for the connection pool
             * reaches then this waits to retrieve one.
             * @return Context
             * @throws CDLookupException
        public synchronized Context getConnection() throws CDLookupException {
         String methodIdentifier = "getConnection";
         if (!availableConnections.isEmpty()) {
             int connectionSize = availableConnections.size() - 1;
             DirContext existingConnection = (DirContext) availableConnections
                  .get(connectionSize);
             availableConnections.remove(connectionSize);
                     * 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 == null) {
              notifyAll(); // Freed up a spot for anybody waiting
              return (getConnection());
             } else {
              busyConnections.add(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 CDLookupException("Connection limit reached", 0);
                     * 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) {
              String errMsg = "Exception raised =" + ie.getStackTrace();
              log.error(errMsg);
              throw new CDLookupException(classIdentifier, methodIdentifier,
                   errMsg, ie);
             // connection freed up, 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);
             log.debug("background thread created");
             connectThread.start();
         } catch (OutOfMemoryError oome) {
             log.error("makeBackgroundConnection ="+ oome.getStackTrace());
             * Thread run method
        public void run() {
         String methodIdentifier = "run";
         try {
             Context connection = makeNewConnection();
             synchronized (this) {
              availableConnections.add(connection);
              connectionPending = false;
              notifyAll();
         } catch (Exception e) { // SQLException or OutOfMemory
             // Give up on new connection and wait for existing one
             // to free up.
             String errMsg = "Exception raised =" + e.getStackTrace();
             log.error(errMsg);   
             * This explicitly makes a new connection. Called in the foreground when
             * initializing the ConnectionPool, and called in the background when
             * running.
             * @return Context
             * @throws CDLookupException
        private Context makeNewConnection() throws CDLookupException {
         String methodIdentifier = "makeNewConnection";
         Context context = null;
         env = new Properties();
         log.debug("inside " + methodIdentifier);
         try {
             env.put(Context.INITIAL_CONTEXT_FACTORY,
                  getVendorContextFactoryClass());
             env.put(Context.PROVIDER_URL, getLdapServerUrl());
             env.put("com.sun.jndi.ldap.connect.pool", "true");
             context = new InitialDirContext(env);
         } catch (NamingException e) {
             String errMsg = "CDLdapBuilder connect() - failure while attempting to contact "
                  + ldapServerUrl + " Exception is " + e.toString();
             throw new CDLookupException(classIdentifier, methodIdentifier,
                  errMsg, e, LookupFailureReasons.serviceUnavailable);
         } catch (Exception e) {
             String errMsg = "CDLdapBuilder connect() - failure while attempting to contact "
                  + ldapServerUrl + " Exception is " + e.toString();
             throw new CDLookupException(classIdentifier, methodIdentifier,
                  errMsg, e, LookupFailureReasons.serviceUnavailable);
         log.info("new connection :" + (threadCount++) + " name =" + context);
         log.debug("exit " + methodIdentifier);
         return context;
             * releases connection to the free pool
             * @param context
        public synchronized void free(Context context) {
         busyConnections.remove(context);
         availableConnections.add(context);
         // Wake up threads that are waiting for a connection
         notifyAll();
             * @return int give total no of avail connections.
        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();
             * Close all connections existing.
             * @param connections
             *                void
        private void closeConnections(Vector connections) {
         String methodIdentifier = "closeConnections";
         try {
             for (int i = 0; i < connections.size(); i++) {
              Context context = (Context) connections.get(i);
              if (context != null) {
                  log.info(" connection name:" + context
                       + " removed. Threadcount =" + (threadCount++));
                  context.close();
                  context = null;
         } catch (NamingException e) {
             String errMsg = "CDLdapBuilder connect() - failure while attempting to contact "
                  + ldapServerUrl + " Exception is " + e.toString();
             log.error(errMsg);
        public synchronized String toString() {
         String info = "ConnectionPool(" + getLdapServerUrl() + ","
              + getVendorContextFactoryClass() + ")" + ", available="
              + availableConnections.size() + ", busy="
              + busyConnections.size() + ", max=" + maxConnections;
         return (info);
             * @return the defaultSearchBase
        public final String getDefaultSearchBase() {
         return defaultSearchBase;
             * @param defaultSearchBase
             *                the defaultSearchBase to set
        public final void setDefaultSearchBase(String defaultSearchBase) {
         this.defaultSearchBase = defaultSearchBase;
             * @return the ldapServerUrl
        public final String getLdapServerUrl() {
         return ldapServerUrl;
             * @param ldapServerUrl
             *                the ldapServerUrl to set
        public final void setLdapServerUrl(String ldapServerUrl) {
         this.ldapServerUrl = ldapServerUrl;
             * @return the vendorContextFactoryClass
        public final String getVendorContextFactoryClass() {
         return vendorContextFactoryClass;
             * @param vendorContextFactoryClass
             *                the vendorContextFactoryClass to set
        public final void setVendorContextFactoryClass(
             String vendorContextFactoryClass) {
         this.vendorContextFactoryClass = vendorContextFactoryClass;
         * @return the availableConnections
        public final Vector getAvailableConnections() {
            return availableConnections;
    }

    Hi,
    As the connection pool implmentation has the bug of not extending more than the min size, workaround I use is MIN_CONN=100 and MAX_CONN=101,and just waiting for the bug to get fixed. (using Netscape SDK for java4.0)

  • Read data using 2 diff connection pool for same DB folder in physical layer

    Hi All,
    i am using two connection pool which have different dsn connection information (both are directed to different database name or database server)..
    so if i view the data of any table, a prompt will come asking for the connection pool, so how do i automize it....?
    how do i set the different connection pool for different tables?
    please let me know if u need further informtaion to understand my problem..
    thnx...

    thnx Stijn..
    yupe that i know...
    actually i have total of around 300 tables in physical layer (in both the schemas..) , around 12 fact and 100 dimension tables in bmm and same in the presentation layer...
    so i think u can guess how many joins and other stuff, i have made in my bmm layer..
    if now i will start modifying all this it will take lot of time...
    i am just wondering that there is no alternative for this...
    as when i check my data from the physical layer then a prompt ask for the connection pool (i have already made two connection pool..) so there could be some alternative way to automize the default connection pool setting for the tables/schemas folders in case if more than one connection pool exits under the same database in the physical layer...
    isn't it?
    thnx again..

  • Creating Connection Pool for DB2 V6.1

    Hi,
    I have created the Connection Pool to point to the DB2 database and has successfully
    created the entity bean jar file. However,
    when I encountered the following error:
    The pool TestPool could not be found. Please make sure that it is declared in
    your config.xml file.
    The following in from my config.xml file:
    <JDBCConnectionPool DriverName="COM.ibm.db2.jdbc.app.DB2Driver"
    Name="TestPool"
    Properties="user=mydata;server=examplesServer" URL="jdbc:db2:mydata"/>
    Hope to hear from you soon. Thanks.

    Hi Jimmy,
    You need to assign a target for your connection pool.
    You may do it by going to console, selecting Target
    tab on the pool and chose servers your want to run
    the connection pool. If you use pre-6.1 version of
    weblogic, you will need to reboot the server after you
    assigned targets to it.
    Regards,
    Slava Imeshev
    "Jimmy" <[email protected]> wrote in message
    news:3c04ad6b$[email protected]..
    >
    Hi,
    I have created the Connection Pool to point to the DB2 database and hassuccessfully
    created the entity bean jar file. However,
    when I encountered the following error:
    The pool TestPool could not be found. Please make sure that it is declaredin
    your config.xml file.
    The following in from my config.xml file:
    <JDBCConnectionPool DriverName="COM.ibm.db2.jdbc.app.DB2Driver"
    Name="TestPool"
    Properties="user=mydata;server=examplesServer" URL="jdbc:db2:mydata"/>
    Hope to hear from you soon. Thanks.

  • Appropriate location for a OLAP connection pool?

    Greetings.
    We are working on a J2EE infrastructure and application. We have
    chose JATO for the MVC interface. Currently, we are working on
    building a connection pool for an OLAP database. This is actually a
    small component of our DataServices layer which will soon include
    other data sources beyond OLAP (e.g., RDBMS).
    As we are inexperienced with JATO we wonder which of the following is
    the most appropriate location for the connection pool:
    1. Web layer - Modeled as a JATO application container. The utility
    here is that we want to thread off new connection pools and Jato
    helps us get this 'for free'.
    2. EJB - App server (iPlanet AS) session bean. Possibly more hand-
    coding for the threading part of the connection pool, but more
    flexible across the enterprise layer.
    I appreciate any comments and suggestions.

    It's ok I found the answer to connection pooling at http://www.developer.com/db/print.php/10920_2172891_3 if anyone is interested.
    Cheers!
    James

Maybe you are looking for

  • How to pass the values to the WHERE-Clause in JClient ADF?

    Hi all, my JDeveloper Version is 10.1.2.0.0 (Build 1811) I need something like this: A Form with a Filter-Panel, and the Table-Panel EMP. In Filter: 1. DEPTNO as ComboBox with values from the DEPT table (not static values). The ComboBox should contai

  • Spry accordion help...

    uhm, so here it goes... well as you can see i have spry accordion issue here... it seems that some of the contents are having scroll bars and some dont... is there a way to eliminate this kind of thing? here below is the html of my spry accordion tha

  • Connecting from VB to Oracle without a client installation

    Hi, In my web page, i have an activex dll which is downloaded in the client machine which in turn has to connect to a Oracle 9i database .The client machine doesnt have Oracle client software installed.Could anyone please help me how i can go about t

  • Remove spaces out of XML element

    Hi, I have a mapping where i map a flatfile to a xml. The incoming element can take a max of  27characters, but most of the time we only get 13 characters. So it has some leading spaces in the xml element, how can i remove those spaces? The outcome n

  • Toolbar of ALV hierachy tree cumulates separators at the end

    Hi all, I'm using an ALV hierarchy tree on a dynpro with dynamic subscreens, where each subscreen adds one or two buttons to the standard ALV toolbar. These buttons are separated by a separator. Now the user can reset the screen with the subscreen an