Database Pooling

How can I create a Database Pooling ??
Thanks,
Juliano

I assume, you mean connection pooling.
one sample could be de.must.dataobj.ConnectionPool among others from http://www.must.de/Jacompe.htm
Christoph

Similar Messages

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

  • Database Pool Status

    What is being reported in the Performance Monitor when Database Pool Status says:
    Connections in use: 0
    Total Connections: -6
    Avg Connections: -1
    Thanks

    I have the same problem, only difference is I'm using OC4J. The BC4J can't access recompiled PL/SQL program, unless I redeploy.
    Anyone can help?

  • IPlanet6.0 Database pool

    Hi
    Is there any provision for Database pooling in iPlanet6.0?. Now I am creating my own
    classes for pooling. If there is any provision for using its own pool, that will be much helpful. Pls anybody
    give details how to set it.I am using Oracle81.

    I don't really use iPlanet, but I think you can let the container manage the connection pooling by setting up a jndi datasource, just like you can in Tomcat.
    I found this info for iPlanet Application Server 6.5. (maybe it's the same for 6)
    http://docs.sun.com/source/816-5786-10/jpgjdbc.htm#13470

  • No connection left in WebLogic database pool

    Hi,
    We have a J2EE business web application that runs in WebLogic. We noticed in application log files errors messages that seems like  "No resource available in db pool", it means all the connection objects (to Oracle database) are used. Then the application is unstable and unseable.
    I think the maximum number of  connections configured in Weblogic pool has been reached due to an increase of users and activity. But when the workload decreases the application is still out of service. It seems connections objects are not relased to the pool. What can be the explanation for this issue ? Normally it is managed by the container (EJB3 for the business tier).
    Once the limit of the pool is reached it is necessary to restart the server to solve this kind of error ?
    Thanks a lot.

    Hi,
    First:
    I guess you should check with your DBA about how many allowed concurrent session of the data base connection for your user. After this, check your data source file configuration according it.
    Second:
    I guess you should check if your application open another session connection with data base.
    e.g.
    - Another file configuration opens connection without to watch and lookup your configuration in data source file;
    - Another code opens JDBC directly without to watch and lookup your configuration in data source file.

  • Questions about database pooling....

    Hi everyone, I'm not new to java programming but I am looking to polish up my skills. I have read sooo many articles and am still confused so please be patient with me. Java has a way of adding new acronyms everytime I turn around - its very hard to keep up with...
    I am using Netbeans 5 with Tomcat 5.5.9 bundled.
    I am connecting to a postgresql database (version 8.1).
    I would like to implement some type of jdbc connection pooling. Everything I have read, even on the tomcat website is confusing and seems to be a "best effort" type of situation - none gauranteeing correctness or reliability or replicability between what others may experience and what I might.
    I looked into a pure java solution such as DbConnectionBroker but I get confused as to how this "pooling" is effected by servlet lifecycles. I have read and read and still do not understand the necessary concepts.
    If I have a login servlet that makes a single query to the database, how long does that instance of the servlet stay loaded into memory? If it is dropped out of memory right away it seems there is no benefit of using the connectionBroker? (since each time someone visits the login servlet it would have to recreate the login servlet and broker object??)
    Is the broker object kept in memory somewhere with connections open after the servlet stops executing? How can other servlets access that same broker object without creating a new one of their own??
    I guess it comes down to really not understanding the persistence of how things are loaded and kept in memory. If this is a question for the Tomcat people I do apologize :/ It just seems these forums are by far and away the best place for any type of java help :)

    A servlet has nothing to do with it.
    A servlet uses a pooled instance. It is the pooled instance, not the servlet which is cached. At least in terms of discussing db connection pools.
    A cache means that it remains in memory. If the cache isn't kept in memory then keeping a cache is pointless.
    I guess it comes down to really not understanding
    the persistence of how things are loaded and kept in memory.More of a basic java question than anything else.
    The GC will collect reference which are no longer active sometime after they become not active. Thus a local reference can be collected after the method exits. But a static will not be collected until the class is (not instances of the class, but the class itself.) That won't happen until the class loader that loaded the class is collected.

  • Multiple Database Pooling using Entity Bean

    Hi,
    Can anyone come across this problem? I have an entity bean (BMP). I want to connect to multiple databases(Oracle, My-SQL, MS-SQL Server). The application is like this. if a request come from the client i have to identify the client request and connect to the database. How to do this. How to connect to get the pool from the connection pooling. Please reply its urgent.
    thanks
    Prem

    Thanks for ur reply.
    what the point is i want to identify the client request and send this request to that bean. i have developed 30 cmp beans, if i have to identify i have to change all cmp to bmp, is there any solution to this.

  • Managing database pools in webLogic

    How can I close or restart the pools created to the database in webLogic ? Thank you.

    Please check the links below:
    Reset connections in a JDBC data source
    Managing WebLogic JDBC Resources - 11g Release 1 (10.3.6)
    Best Regards
    Luz

  • Database Pooling Connection?

    Hi All
    is it possible to use Database Connection Pooling against UCM?
    Please share how to config it
    thanks

    Do you want to use the existing pool? Than go to (on the server machine) start --> All programs --> oracle content server --> utilities --> sytem properties --> and databse tab and configure your driver settings and number of connections you would like to use. Hope this is helpful..

  • Database connection is not closing in the database pool

    Hi,
    i am using tomcat 6.0 and mysql 5.0 database server
    and implementing the DBCP in my application
    and my context.xml is this
    <Resource name="jdbc/racecourse" auth="Container" type="javax.sql.DataSource"
    factory="org.apache.tomcat.dbcp.dbcp.BasicDataSourceFactory"
    maxActive="200" maxIdle="10" maxWait="1000" removeAbandoned="true" removeAbandonedTimeout="300" logAbandoned="true"
    username="betting" password="race" driverClassName="com.mysql.jdbc.Driver"
    url="jdbc:mysql://localhost:3306/betting?autoReconnect=true"
    description="race"/>
    My problem is the connections in the mysql server are becoming idle instead of closing . due to this i am getting connection error 
    please help me how to slove this error
    try { DataSource ds = null;     Context context = new InitialContext(); Context envCtx = (Context) context.lookup("java:comp/env"); ds =  (DataSource)envCtx.lookup("jdbc/racecourse"); if (ds != null) { cons = ds.getConnection(); } String query3="select max(meetingdate) from meeting"; Statement st3= cons.createStatement(); ResultSet rs3=st3.executeQuery(query3); String srno45=""; while(rs3.next()) {   srno45=rs3.getString(1); } String query="select callcount from callcounter where dateofrace='"+srno45+"'"; Statement stat = cons.createStatement(); ResultSet rs =stat.executeQuery(query); String a=""; int i=1; String cc1="1"; while(rs.next()) { a=rs.getString(1); i=Integer.parseInt(a); //Integer b=new Integer(i); i++; cc1=Integer.toString(i); } session.setAttribute("b123",cc1); String query1="update callcounter set callcount='"+cc1+"' where dateofrace='"+srno45+"'"; Statement stat1 = cons.createStatement(); stat1.executeUpdate(query1); cons.close(); } catch(Exception e) { out.println("saleaction"+e); } finally { try {           if (cons != null)             cons.close();         } catch (SQLException e3) { System.out.println("saleaction"+e3); } } }

    i am declaring on the top of the try block
    connection cons=null;
    try
              DataSource ds = null;
               Context context = new InitialContext();
                Context envCtx = (Context) context.lookup("java:comp/env");
                ds =  (DataSource)envCtx.lookup("jdbc/racecourse");
               if (ds != null)
                         cons = ds.getConnection();
               String query3="select max(meetingdate) from meeting";
               Statement st3= cons.createStatement();
               ResultSet rs3=st3.executeQuery(query3);
               String srno45="";
               while(rs3.next())
                srno45=rs3.getString(1);
              String query="select callcount from callcounter where dateofrace='"+srno45+"'";
              Statement stat = cons.createStatement();
               ResultSet rs =stat.executeQuery(query);
              String a="";
              int i=1;
              String cc1="1";               
                   while(rs.next())
                    a=rs.getString(1);
                    i=Integer.parseInt(a);
                    //Integer b=new Integer(i);
                    i++;
                    cc1=Integer.toString(i);
                   session.setAttribute("b123",cc1);
                   String query1="update callcounter set callcount='"+cc1+"' where dateofrace='"+srno45+"'";
              Statement stat1 = cons.createStatement();
              stat1.executeUpdate(query1);
              cons.close();
              catch(Exception e)
              out.println("saleaction"+e);
         finally
              try {
              if (cons != null)
                cons.close();
            } catch (SQLException e3)
                   System.out.println("saleaction"+e3);
         }

  • Passing Database Pool Connection to Java Object

    SO I have a set of Java libs that i would like to use within
    CFMX. In fact, I would like to do all my business logic with those
    libraries. Question is, the classes require I pass a database
    connection to them. How would I do this?

    In Coldfusion you can just code the usual Java DB connection
    directly. That is, something like
    <cfscript>
    classObj = CreateObject("java", "java.lang.Class");
    classObj.forName("etc.etc..Driver");
    driverManager = CreateObject("java",
    "java.sql.DriverManager");
    connectionURL="jdbc: etc etc. ";
    conn=driverManager.getConnection(connectionURL,username,password);
    myQuery="SELECT blah1, blah2 FROM blah3";
    preparedStatement = conn.prepareStatement(myQuery);
    rs=preparedStatement.executeQuery();
    while (rs.next()) {
    etc etc
    rs.close();
    conn.close();
    </cfscript>
    That is for single calls. To set up a permanent connection,
    you could include in the libraries a class whose job is simply to
    establish the connection to the DB. I should expect the code to
    contain some of the themes above, namely,
    getConnection (String url, String user, String password)
    connectionURL = "jdbc:etc"
    java.sql.Connection conn =
    java.sql.DriverManager.getConnection (connectionURL, username,
    password);
    etc. etc.
    You could also find it convenient to store connection and
    user data data in a properties object of the java.util.Properties
    class.
    java.util.Properties properties = new java.util.Properties
    properties.setProperty ("user", "bkbk");
    properties.setProperty ("password", "knoflook");
    java.sql.Connection conn =
    java.sql.DriverManager.getConnection (connectionURL, properties);

  • Database pool connectivity

    Hi,
    I am on j2ee 6.20 . I already have one jdbc connectivity for oracle maintained. One more connection has to be maintained for oracle jdbc. When I navigate to server dbpool through VA ,I dont get any option to create a new pool(ie New)but there is an option to add new driver.Since I want to use the existing driver already maintained . Pls suggest how can I create a new pool.
    Thanks
    Ravi

    Hi Ravi,
    you can use the telnet console to create a new connection pool in J2EE 6.20.
    use telnet <servername> 50008 (if your instance number is 00)
    jump to a server node
    add dbpool
    the command you have to use then is register_pool, i do not remember the exact syntax anymore, as I do not have a 6.20 J2EE here any longer, but there is a manual entry ("man register_pool")
    Good luck
    Jochen

  • Database pooling question

    Currently at work we have one shared Pool of 100 Connections. If we need to switch schemas we "alter session". Would there be any benefit if each web application had its own Pool vs having a globally shared Pool?

    What is you expectation?
    You have a server that runs in an applicationserver with a JVM that runs BPEL. Then the BPEL process will retrieve via TopLink your data (I/O & Network), It will be manipulated by BPEL (CPU). Then send back via TopLink your data (I/O & Network).
    Yes you have overhead. It all depends on how the servers (app & db) are conencted to each other? Highspeed network ? The same Server? Processing the XML consumes CPU. The more CPU's and clockspeed the more and faster the processes are run.

  • Database sessions, Application Modules and Pools

    Hi,
    I have an ADF 10.1.3 application (ADF Faces on ADF BC) that uses JAAS to authenticate it's users. After the user has logged in I would like my session_user_info managed bean to query the database and retrieve all the user's details, for access throughout the user's session. Initially I wrote the following code to achieve this:
          ApplicationModule am = Configuration.createRootApplicationModule(applicationModuleName, applicationConfigName);
          ViewObject vo = am.findViewObject("CurrentUserView1") ;
          vo.setNamedWhereClauseParam("v_userName",userName);
          vo.executeQuery();
          if(vo.getRowCount() <= 0)
            user = null ;
          else
            user = (CurrentUserViewRowImpl) vo.first();
          Configuration.releaseRootApplicationModule(am, true); This works fine BUT because it's creating a new root ApplicationModule each time I end up with an excessive number of database connections after a very short space of time (the call to Configuration.releaseRootApplicationModule does not seem to be releasing the database connection, even though the application module is released). I also don't like this as it feels like I'm "breaking" the framework by making a direct call to the model layer.
    So the next thing I wanted to try was creating a DataControl (by dragging my CurrentUserView1 on to a jspx page, then deleting it to preserve the bindings) and make a call to that using something like this:
            /**** TODO GET BINDING TO CurrentUserView1 ******/
            OperationBinding operationBinding =
                bindings.getOperationBinding("ExecuteWithParams");
            JUCtrlAttrsBinding vUsername =
                (JUCtrlAttrsBinding)bindings.findNamedObject("v_userName");
            statusCode.setAttribute("v_userName", username);
            Object result = operationBinding.execute();
            if (operationBinding.getErrors().isEmpty()) {
               /***** TODO Cast this result object in to something useful *****/
                setUser(result)
            }But as you can see I still don't completely understand what I have to do here (and yes I have trawled the various guides and documentation - but I can't work out exactly what applies to me as this isn't a backing bean).
    If any of you Aces out there can give me some pointers it would be MUCH appreciated as I've beat my head against this for a week now!!
    Dave
    Edited by: Short Dave on Dec 1, 2008 2:52 PM

    John,
    It's been 2 months since I asked this question and in that time I have tried innumerable ways of getting my application and database pools to behave in such a way that doesn't end up filling my database with unclosed sessions. The situation I'd ideally like to achieve is this:
    Application Modules
    A pool of application modules minimum 5 maximum 150 with a "working set" of about 25 (the jbo.recyclethreshold setting)
    For application modules to timeout if they are inactive for > 120 seconds (so if somebody has left their browser open in the background I don't want them hogging my AMs)
    Database Connections +(I am using a JDBC data source to allow multiple applications to reuse my connection pool settings)+
    A pool of database connections minimum 5 maximum 150
    If a connection is inactive for > 300 seconds for that connection to be closed (i.e. if an AM has been returned to the pool, but is not re-used within 5 minutes then I'd like the connection closed)
    Obviously, for the purposes of testing, I don't want to try and manage 150 browser sessions to see if this setup works, so I have been trying to create a scaled-down version of my requirements:
    Application Modules
    A pool of application modules minimum 1 maximum 5 with a "working set" of 1 (the jbo.recyclethreshold setting)
    For application modules to timeout if they are inactive for > 30 seconds
    Database Connections
    A pool of database connections minimum 1 maximum 5
    If a connection is inactive for > 60 seconds for that connection to be closed
    My problem is that, despite all the API's, the ADF for 4GL guide, forum entries and Steve Muench's guide to AM Pooling I still can't get this relatively simple example to work.
    My bc4j.xcfg file looks like (assume all other settings are as default):
             <jbo.recyclethreshold>1</jbo.recyclethreshold>
             <jbo.ampool.maxavailablesize>5</jbo.ampool.maxavailablesize>
             <jbo.ampool.maxinactiveage>30000</jbo.ampool.maxinactiveage>
             <jbo.ampool.minavailablesize>1</jbo.ampool.minavailablesize>
             <ApplicationName>gpl.model.PreUserLoginModule</ApplicationName>
             <jbo.ampool.monitorsleepinterval>30000</jbo.ampool.monitorsleepinterval>My data-sources.xml file has the following entries for the connection used by that application module (assume all other settings are as default):
      <connection-pool name="jdev-connection-pool-gslportal_at_ppmsdb"
                       disable-server-connection-pooling="false"
                       validate-connection="false" inactivity-timeout="60"
                       max-connections="5" min-connections="1"
                       property-check-interval="30"
                       used-connection-wait-timeout="30">With this configuration I can open a maximum of 5 browsers and each one connects successfully. On opening the 6th I get an exception because no more connections are available (as expected). My problem is that if I wait for 5 minutes I'd expect that
    a) 4 of the inactive application modules should be released (with one left available as per the min setting)
    b) The database connections of the 4 inactive application modules should be released as per the "inactivity" and "used-connection-wait" timeouts on the data-source
    c) I'd now expect the 6th browser to be able to connect because of the "freed up" resources
    From what I can make out none of these things happens. Even if I close the original 5 browsers, the 6th still cannot connect.
    I have noticed that if I set the "time-to-live-timeout" for the datasource then this will close the connection after the given period of time, but regardless of whether or not the connection was in use and in doing so renders the application module held in the pool as useless. (So if any of my original 5 sessions attempt to re-use the application module with the closed database connection, a "Closed Connection" SQLException is raised).
    I do appreciate this topic has been given LOTS of forum discussion already - but I really have done my research and am still none the wiser. Any help or guidance will be much appreciated.
    Kind Regards
    Dave

  • BPEL - Database Connection Pools, JNDI - How do you do it ?

    Scoured forum and BPEL developer and admin guides, and didn't find any good instructions on how to configure and use database pools for BPEL, except possibly this post nearly two years ago data-sources.xml and oc4j-ra.xml
    I suspect things may have changed some in two years ! Where can I find this info. Does anyone who has done it have step by step instructions ?

    You should have scoured better ;-)
    I had a problem that needed to be fixed with a connection pool. Check this post:
    Strange Toplink errors appearing
    It points to some documentation that will help you:
    http://download-uk.oracle.com/docs/cd/B31017_01/integrate.1013/b28994/adptr_db.htm#sthref528
    Basically you have to do the following:
    - look in the WSDL of your DB adapter. It will have a jca:address section. In this section you will see a jndi location, something like: eis/DB/<a_connection>. Make note of this location
    - on the server look for the file oc4j-ra.xml in <oracle_home>/j2ee/<oc4j_soa>/application-deployments/default/DbAdapter. Edit the file. In there are mappings that basically forward the object in location eis/DB/<a_connection> to jdbc/<connection>.
    E.g.:
    <connector-factory location="eis/DB/DBConnection1" connector-name="Database Adapter">
                    <config-property name="xADataSourceName" value="jdbc/DBConnection1DataSource"/>
                    <config-property name="dataSourceName" value="loc/DBConnection1DataSource"/>
                    <config-property name="platformClassName" value="oracle.toplink.platform.database.Oracle9Platform"/>
                    <config-property name="usesNativeSequencing" value="true"/>
                    <config-property name="sequencePreallocationSize" value="50"/>
                    <config-property name="defaultNChar" value="false"/>
                    <config-property name="usesBatchWriting" value="true"/>
                    <connection-pooling use="none">
                    </connection-pooling>
                    <security-config use="none">
                    </security-config>
            </connector-factory>Now copy one of these blocks and edit it so that the location matches your eis/DB/<a_connection> location. Map the dataSource and xaDataSource properties to jdbc/<connection> s (which you create in the next step)
    - go to the enterprise manager, click on the soa suite oc4j container, choose the 'administration' link. Click on the 'Go to task' icon for JDBC connections. Here you can create your connection pool, and db connection. Make sure the location of your JDBC connection matches what you have configured in the oc4j-ra.xml file.
    - restart your soasuite/bpel oc4j container
    - bob's your uncle ;-)
    HTH,
    Bas

Maybe you are looking for