OC4j connection pooling

We are using OC4J as application server. At this moment we dont have any ejb module in our application.
We just have servlets and JSP.
How do I use connection pooling for my web application?
Satish Juware

In $J2EE_HOME/config/data-sources.xml, define a datasource with "pooled-location" tag (other location types are "location", "xa-location", "ejb-location"), then you can lookup for the JNDI name associated with that pooled location and use the pooled connection.

Similar Messages

  • Oc4j connection pool: too much INACTIVE connections

    I am publishing an application - developed using Eclipse and previously published in Tomcat (where it works perfectly for a long time) - within corporate servers using Oc4j version 10.1.3. The database server is Oracle 9g.
    After the deployment operation, the application seems to work, but that happens during the work by users, there are still many connections whith status "INACTIVE", until to complete all the available connections.
    The datasource is set as follows:
    <connection-pool name="ConnectionPoolRichiestaPubblicazione">
    <connection-factory factory-class="oracle.jdbc.pool.OracleDataSource"
    user="REDAZIONE"
    password="password"
    url="jdbc:oracle:thin:@(DESCRIPTION=(FAILOVER=ON)
         (ADDRESS_LIST=(LOAD_BALANCE=ON)
         (ADDRESS=(PROTOCOL=TCP)
         (HOST=10.146.2.86)(PORT=1521))
         (ADDRESS=(PROTOCOL=TCP)(HOST=10.146.2.86)(PORT=1521)))
         (CONNECT_DATA=
    (SERVER=DEDICATED)
    (SERVICE_NAME=XE)
    (FAILOVER_MODE=(TYPE=SELECT)(METHOD=BASIC)(RETRIES=180)(DELAY=5))))">
    </connection-factory>
    </connection-pool>
    <managed-data-source
    jndi-name="jdbc/RichiestaPubblicazioneDS"
    name="RichiestaPubblicazioneDS"
    connection-pool-name="ConnectionPoolRichiestaPubblicazione" />
    The java code to establish a connection is as follows:
    private Connection creaConnessioneDataSource(String nomedatasource) throws ConnessioneException{
              LOGGER.debug("START");
              try {
                   InitialContext context = new InitialContext();
                   DataSource ds = (DataSource)context.lookup(nomedatasource);
                   LOGGER.debug("URL DATASOURCE : " + ds.getConnection().getMetaData().getURL());
                   LOGGER.debug("USERNAME : " + ds.getConnection().getMetaData().getUserName());
                   this.conn = ds.getConnection();
              catch( Exception e ) {
                   LOGGER.error("Errore nella connessione tramite datasource : " + StringUtils.getCustomStackTrace(e));
              LOGGER.debug("END");
              return this.conn;
    Connections and statements are closed using the following methods:
         public boolean chiudi(Connection conn){
              LOGGER.debug("START");
              boolean esito = false;
              if (conn != null){
                   try {
                        conn.close();
                        esito = true;
                        LOGGER.debug("Connessione chiusa");
                   catch (SQLException e) {
                        LOGGER.error("Eccezione nella chiusura della connessione : " + e);
              LOGGER.debug("END");
              return esito;
         public boolean chiudi(Statement stmt){
              LOGGER.debug("START");
              boolean esito = false;
              if (stmt != null){
                   try {
                        stmt.close();
                        esito = true;
                        LOGGER.debug("Statement chiuso");
                   } catch (SQLException e) {
                        LOGGER.error("Eccezione nella chiusura dello statement : " + e);
                        e.printStackTrace();
              LOGGER.debug("END");
              return esito;
    Here are a couple of examples of code that interact with the database:
         public List<StatoRichiestaSintesi> getElencoStatiRichieste() throws ConnessioneException{
              LOGGER.debug("START");
              List<StatoRichiestaSintesi> listaStati=new LinkedList<StatoRichiestaSintesi>();
              LOGGER.debug("Apriamo connessione e statement");
              Connection conn = databaseManager.creaConnessioneDataSource(datasource);
              Statement stmt = databaseManager.creaStatement(conn, false);
              String sql="SELECT * FROM STATORICHIESTA";
              try {
                   ResultSet rs = stmt.executeQuery(sql);
                   while(rs.next()){
                        StatoRichiestaSintesi temp=new StatoRichiestaSintesi();
                        temp.setIdStato(rs.getString(1));
                        temp.setDescrizioneStato(rs.getString(2));
                        listaStati.add(temp);
                   LOGGER.debug("Numero record trovati : " + listaStati.size());
              } catch (SQLException e) {
                   LOGGER.error("Eccezione di tipo SQL : " + StringUtils.getCustomStackTrace(e));
              finally{
                   LOGGER.debug("Chiusura di statement e connessione");
                   databaseManager.chiudi(stmt);
                   databaseManager.chiudi(conn);
              LOGGER.debug("END");
              return listaStati;
    Below is another example using PreparedStatement:
         private synchronized void aggiungiIndicazioneProgetto(String idprogetto, String idrichiesta) {
              LOGGER.debug("START");
              LOGGER.debug("Creo un oggetto di tipo connessione");
              Connection conn = databaseManager.creaConnessioneDataSource(datasource);
              LOGGER.debug("Definisco una query sql");
              String sql = "INSERT INTO RICHIESTAPROGETTO (IDRICHIESTA,IDPROGETTO) VALUES (?,?)";
              LOGGER.debug("Dichiaro un oggetto di tipo preparedstatement");
              PreparedStatement stmt = null;
              try {
                   LOGGER.debug("Istanzio l'oggetto statement");
                   stmt = conn.prepareStatement(sql);
                   LOGGER.debug("Imposto i segnalibri della query");
                   stmt.setString(1, idrichiesta);
                   stmt.setString(2, idprogetto);
                   LOGGER.debug("Eseguo la query di inserimento del progetto");
                   stmt.executeUpdate();
              } catch (SQLException e) {
                   LOGGER.error("Eccezione di tipo SQL : " + StringUtils.getCustomStackTrace(e));
              finally {
                   LOGGER.debug("Chiusura di statement e connessione");
                   databaseManager.chiudi(stmt);
                   databaseManager.chiudi(conn);
              LOGGER.debug("END");
         Which may be the cause for the described behavior?
         I hope someone help me..

    My problem is the following.
    If I deploy my application with the illustred datasource in my local OC4J (10.1.3 in a Standalone Environment) all work fine.
    The application creates a reasonable number of connections (in ORACLE - 10g Enterprise Edition Release 10.2.0.4.0 - db I run the query verification "select count(*) from v$session where username='MYAPPLICATION'"), and overall performance is very good.
    If, however, to deploy on the production machine of corporate (always 10.1.3, but obviously in Oracle Application Server Environment) the
    number of connections (status 'INACTIVE') grows massively, and this is saturated in a short time.
    The exception that at the end from the application is that:
    java.sql.SQLException: ORA-01034: ORACLE not available
    ORA-27101: shared memory realm does not exist
    Linux Error: 2: No such file or directory
    oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:138)
    oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:316)
    oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:277)
    oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:272)
    oracle.jdbc.driver.T4CTTIoauthenticate.receiveOsesskey(T4CTTIoauthenticate.java:243)
    oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:304)
    oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:430)
    oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:151)
    oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:32)
    oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:608)
    oracle.jdbc.pool.OracleDataSource.getConnection(OracleDataSource.java:218)
    oracle.jdbc.pool.OracleConnectionPoolDataSource.getPhysicalConnection(OracleConnectionPoolDataSource.java:114)
    oracle.jdbc.pool.OracleConnectionPoolDataSource.getPooledConnection(OracleConnectionPoolDataSource.java:77)
    oracle.jdbc.pool.OracleImplicitConnectionCache.makeCacheConnection(OracleImplicitConnectionCache.java:1361)
    oracle.jdbc.pool.OracleImplicitConnectionCache.getCacheConnection(OracleImplicitConnectionCache.java:441)
    oracle.jdbc.pool.OracleImplicitConnectionCache.getConnection(OracleImplicitConnectionCache.java:336)
    oracle.jdbc.pool.OracleDataSource.getConnection(OracleDataSource.java:286)
    oracle.jdbc.pool.OracleDataSource.getConnection(OracleDataSource.java:179)
    oracle.jdbc.pool.OracleDataSource.getConnection(OracleDataSource.java:159)
    oracle.oc4j.sql.DataSourceConnectionPoolDataSource.getPooledConnection(DataSourceConnectionPoolDataSource.java:57)
    oracle.oc4j.sql.xa.EmulatedXADataSource.getXAConnection(EmulatedXADataSource.java:92)
    oracle.oc4j.sql.spi.ManagedConnectionFactoryImpl.createXAConnection(ManagedConnectionFactoryImpl.java:211)
    oracle.oc4j.sql.spi.ManagedConnectionFactoryImpl.createManagedConnection(ManagedConnectionFactoryImpl.java:170)
    com.evermind.server.connector.ApplicationConnectionManager.createManagedConnection(ApplicationConnectionManager.java:1377)
    oracle.j2ee.connector.ConnectionPoolImpl.createManagedConnectionFromFactory(ConnectionPoolImpl.java:327)
    oracle.j2ee.connector.ConnectionPoolImpl.access$800(ConnectionPoolImpl.java:98)
    also I add the other attributes of Connection Pool of the Datasource:
    Connections:
    Initial size of Connection Cache = 0     
    Minimum Number of Connections = 0
    Maximum Number of Connections = -1
    Connection Retry Interval (seconds) = 1
    Maximum Connection Attempts = 3
    Maximum Number of Statements Cached = 0     
    Lower Threshold Limit On Pool (%)= 20     
    Validate Connection = False
    What I can do?
    many thanks..

  • NameNotFOundException in OC4J Connection Pool

    Hi,
    I am trying to implement connection pooling in OC4J.I modified the data-sources.xml file as follows:
    <!-- DataSource for Connection Pooling for MD Database -->
    <managed-data-source name="MDDS"
    connection-pool-name="SampleConnectionPool"
    jndi-name="jdbc/MDDS"/>
    <connection-pool name="SampleConnectionPool"
         min-connections="10"
         max-connections="100"
         inactivity-timeout="30">
    <connection-factory factory-class="oracle.jdbc.pool.OracleDataSource"
    user="xxx"
    password="xxx"
    url="jdbc:oracle:thin:@//localhost:1521/zzz">
    </connection-factory>
    </connection-pool>
    My Java Coding is as follows:
    javax.naming.InitialContext ic = new javax.naming.InitialContext();
         javax.sql.DataSource dataSource = (javax.sql.DataSource)ic.lookup("jdbc/MDDS");
         con = dataSource.getConnection();
    While executing the above code,I am getting "javax.naming.NameNotFoundException : jdbc/MDDS not found..
    Am I missing any step?.Thanks.

    Have you restarted the container?

  • OC4J Connection Pool internals?

    Hi Folks,
    Regarding the connection pool available with a DataSource I would like to know if the pool caches:
    * Statements
    * Preparted Statements
    * ResultSets
    Is there any technial withepaper/guide available?
    Thx
    Toby

    Hi Folks,
    Regarding the connection pool available with a DataSource I would like to know if the pool caches:
    * Statements
    * Preparted Statements
    * ResultSets
    Is there any technial withepaper/guide available?
    Thx
    Toby

  • Connection Pooling in 903

    Hi,
    I'm trying to use the oc4j connection pooling as described in the J2EE Service guide.
    my data-sources.xml looks like this:
    <?xml version="1.0" standalone='yes'?>
    <!DOCTYPE data-sources PUBLIC "Orion data-sources" "http://xmlns.oracle.com/ias/dtds/data-sources.dtd">
    <data-sources>
    <data-source
    class="com.evermind.sql.DriverManagerDataSource"
    name="jCROSS"
    location="jdbc/JCROSSCoreDS"
    xa-location="jdbc/xa/JCROSSXADS"
    ejb-location="jdbc/jCROSS"
    pooled-location="jdbc/jCROSSPool"
    max-connections="30"
    min-connections="10"
    connection-driver="oracle.jdbc.driver.OracleDriver"
    username="username"
    password="password"
    url="jdbc:oracle:thin:@localhost:1521:test"
    inactivity-timeout="30"
    connection-retry-interval="1"
    />
    </data-sources>
    I'm running the following code:
    Connection con[] = new Connection[15];
    DataSource ds = null;
    try {
    InitialContext ctx = new InitialContext();
    ds = (DataSource)ctx.lookup("jdbc/jCROSS");
    for(int i=0;i<=10;i++)
    con[i] = ds.getConnection();
    } catch (Exception e) {
    System.out.println(e);
    } finally {
    for(int i=0;i<=10;i++)
    con.close();
    I'm targeting the ejb-location because I need a pooled and transaction aware connection but when running this code with oc4j in debug mode I don't see that the connections are pooled:
    Oracle9iAS (9.0.3.0.0) Containers for J2EE initialized
    new DebugConnection(1)
    new DebugConnection(2)
    new DebugConnection(3)
    Press enter to continue
    new DebugConnection(4)
    new DebugConnection(5)
    new DebugConnection(6)
    new DebugConnection(7)
    new DebugConnection(8)
    new DebugConnection(9)
    new DebugConnection(10)
    new DebugConnection(11)
    closing DebugConnection(1)
    closing DebugConnection(2)
    closing DebugConnection(3)
    closing DebugConnection(4)
    closing DebugConnection(5)
    closing DebugConnection(6)
    closing DebugConnection(7)
    closing DebugConnection(8)
    closing DebugConnection(9)
    closing DebugConnection(10)
    closing DebugConnection(11)
    Open sets: {}
    Open connections: {}
    Dirty connections:
    Press enter to continue
    when changing the lookup to :
    ds = (DataSource)ctx.lookup("jdbc/jCROSSPool");
    the pool works, but few questions arise from this behaviour:
    1. Does the ejb-location support pooled connections? How? (in various articles it is recommend to specifically use this location).
    2. Are the connections from the pooled-location transaction-aware?
    Thx in advance.

    Hi people!
    I have a question on the above code.
    I tried it myself on OC4j 9.0.3 (the one that comes with JDeveloper) and I noticed the connections on the pool. The problem is the behaviour of this code when the datasource is configured to have as a "max_connections" attribute a value less than 10, e.g. 8.
    I tried a datasource of the following form
         <data-source
              class="com.evermind.sql.DriverManagerDataSource"
              name="OracleDS"
              location="jdbc/OracleCoreDS"
              xa-location="jdbc/xa/OracleXADS"
              ejb-location="jdbc/OracleDS"
              connection-driver="oracle.jdbc.driver.OracleDriver"
              username="myuser"
              password="mypass"
              min-connections="2"
              max-connections="8"
              url="jdbc:oracle:thin:@localhost:1521:orcl"
              inactivity-timeout="60">
         <property name="cacheScheme" value="DYNAMIC_SCHEME"/>
         </data-source>
    but the execution of the code stops when it comes to get a Statement object out of the 9th connection object. Isn't the pool supposed to give a new connection and remove it when it's finished with it? After all, the documentation says that this is the default behaviour of the pool (it is not necessary to declare the DYNAMIC_SCHEME in the data-source.xml)
    I am interested in this, because I have a bunch of JSP files (100 of them or even more) that shall use the same connection pool. If some of them are being executed concurrently, then there will definitely be a problem with the available connection objects.
    Thanx

  • How to use connection pooling in JDev 10.1.2

    In all the ADF apps I have created, I have always used the defined connection in JDev and deployed the password. I'm now being told I need to stop doing that and start using oc4j connection pool with datasource definition so the passwords won't have to be deployed.
    I pretty much need step by step instructions on how to do this becasue I've never done it. Any help would be greatly appreciated. Thanks.

    Hi,
    How about these tutorials?
    http://www.oracle.com/technology/tech/java/newsletter/articles/oc4j_data_sources/oc4j_ds.htm
    http://www.oracle.com/technology/products/jdev/tips/duff/mysql_and_oc4j3.html

  • Connection pooling oc4j

    hi guys,
    I have a deployed application in OC4J (oracle 10g). My JSP needs connection pooling to the DB connection . right now i am uisng normal DB connection, which is not feasible for long term process.
    I had seen some of the mails/step by step process to implement and create Data soruce and Connection pooling examplesin forum & OTN but those examples and applications[b] which are accessing from outside the server.
    can you please provide the link or thread where i can get the example for datasource and connection pooling.

    It's always more helpful if you can provide more specific details about the version you are using -- 10g spans multiple releases.
    So basically you want to make use of a connection pool from your web app?
    The basic solution then is to create a DataSource on the OC4J instance, then lookup the datasource in the JSP and extract a connection from it to use. When you close the connection it will return to the pool maintained by the DataSource.
    Worth noting is that the DataSource/ConnectionPool implementation has changed a bit between the 10.1.2 and 10.1.3 releases, although the core principals remain the same.
    The documentation covers how to do this:
    10.1.2 doc: http://download-west.oracle.com/docs/cd/B14099_19/web.1012/b14012/datasrc.htm#sthref425
    10.1.3 doc: http://download-west.oracle.com/docs/cd/B31017_01/web.1013/b28958/datasrc.htm#BABIDCBJ
    10.1.3. How-To:
    http://www.oracle.com/technology/tech/java/oc4j/1013/howtos/how-to-datasource/doc/how-to-datasource.html
    Here's a link to a how-to that walks you through constructing and testing a datasource using the Application Server Control console.
    I wrote a blog posting a while back on how to lookup a datasource using the fully abstracted approach:
    http://buttso.blogspot.com/2006/06/datasource-lookup-using-javacompenv.html
    cheers
    -steve-

  • Connection Pool - unable to establish connection for one or more OC4J inst.

    Hi.
    I'm using Oracle JDeveloper 10.1.3.1 to develop some app. Database is Oracle XE 10.2.0. Application server is Oracle Aplication Server 10.1.3.1
    After create a needed code, I' v tried establish Connection Pool. When I' v tested connection, next errors was occurred:
    Unable to establish connection for one or more OC4J instances<<
    Home on admin.FRIEND-6843859F - Failed due to error: "Exception occurred testing connection. Exception: java.sql.SQLException: invalid arguments in call."<<"FRIEND-6843859F " is Computer name where Application server is installed.
    --Database is started.
    --App.server processes are started.
    How can I solve this problem?
    Thanx

    If you are using ADF "BC" Jdev will not support more than one connection
    I've tryied and always gives a errors.

  • OC4J 1.0.2.2.1, connection pooling, and over-riding the default username and password

    We are using OC4J 1.0.2.2.1 and connection pooling with data-sources.xml
    In data-sources.xml, we have specified the default username and password.
    However, there are situations where we will want to use a different username and password and still use the connection pool. For example:
    public static Connection getConnection(String aUserNameS, String aPasswordS) {
    Connection conn;
    try {
    InitialContext ic = new InitialContext();
    DataSource ds = (DataSource) ic.lookup("jdbc/ejb/OracleDS");
    conn = ds.getConnection(aUserNameS, aPasswordS);
    } catch (Exception ex) {...}
    return conn;
    Will this work? I mean, is it possible to specify a different username and password in the JNDI lookup and have it over-ride a provided default username and password in data-sources.xml?
    Thanks,
    Ed

    This may be problem with your userid/password. Please look the $OC4J_HOME/j2ee/home/config/principals.xml whether you have a right userid password.
    I did a quick test at looking up at "jdbc/OracleDS" for two users admin and SCOTT and this works fine both in 1.0.2.2.x an 9.0.2
    I got your errors when I had wrong passwords for these users
    regards
    Debu

  • Troubles with connection pool onto oc4j 1.0.2.2.1

    hi all,
    we try migrate our ejb-application to oc4j from weblogic. and I can't understand how can I set connection pooling for oc4j.
    our envirionment are Solaris2.8, Oracle 8.1.7, OC4J 1.0.2.2.1.
    our datasource I've defined as:
    then in code we standard snippet for get pooled connection.

    You can add the following parameters:
    min-connections="50"
    max-connections="100"
    to increase pool connections.
    (However Ive found the datsource is not very forgiving regarding
    sqls withins sqls)
    Hope this helps

  • How to change the connection pool configuration on OC4J?

    Hi everybody,
    I am developing an application with JDeveloper which is running on an OC4J standalone server, we have 2 enviroments, the develop server and the server of the client, and the data base connection configurations are differents.
    The problem is that if we try to deploy the application (we have deploy on the develop server) on the client server and try to change the connection pool configuration the application cannot connect to the data base, we need to re-build the project with the client connection pool configuration.
    We tried to change the configuration on the enterprise manager of the OC4J, on "JDBC Resources" panel, and the test the connection is ok, but when try to access to the application we get an Exception. After that we try to do that changing the parameters from the datasources.xml file on the application, but the result is the same.
    How can we change the DataBase configuration without re-build the project?
    Thanks very much
    Tony

    Meaning you have created just the empty data-sources.xml and not configured any Connection Pool and DataSource in JDev?
    In Oracle AS 10.1.3 you have two ways to do this:
    1. Use JDev and configure the data-sources.xml (Context Menu -> Properties)
    2. In Oracle AS: Select application -> Administration -> Services -> JDBC Resources -> Create Pool and Create DataSource
    --olaf                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

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

  • Issues with JDBC Connection Pooling

    Hi all,
    I'm experiencing some unexpected behaviour when trying to use JDBC Connection Pooling with my BC4J applications.
    The configuraiton is -
    Web Application using BC4J in local mode
    Using Default Connection Stagegy
    Stateless Release Mode
    Retrieving Application Modules using Configuration.createRootApplicationModule( am , cf );
    Returning Application Modules using Configuration.releaseRootApplicationModule( am, false );
    Three application modules
    AppModuleA - connects to DatabaseConnection1
    AppModuleB - connects to DatabaseConnection2
    AppModuleC - connects to DatabaseConnection2
    My requirement is to -
    Use App Module Pooling and have individual pool for each Application Module
    Use JDBC Pooling and have individual pool for each Database connection
    Note: All configuration was achieved in design mode (i.e. right clicking AppModule->Configurations...)
    1. Initial approach -
    In the configuration for each Application Module I specified the connection type as 'JDBC Datasource' and specified to approriate datasource.
    Tried setting doConnecitonPooling to 'true' as well as 'false'
    In the data-sources.xml I specified all the appropriate info including min-connections and max-connections.
    I would expect, with the above config that BC4J would use OC4J's built in JDBC connection pooling.
    2. Second approach -
    In the configuration for each Application Module I specified the connection type as JDBC URL.
    In the configuration I specified doConnectionPooling = 'true' as well as the max connection, max available and min available
    What I experienced in both cases was that the max connections seem to be ignored as the number of connection as reported by the database (v$session) was exceeded by more than 10.
    In addition to this once the load was removed the number of JDBC connecitons did not drop (I would have expected it to drop to max available connections)
    My questions are -
    1. When specifying to use a 'JDBC Datasource' style of connection, is it in fact OC4J that is then responsible for pooling JDBC connections? And in this case should BC4J's doConnectionPooling parameter be set to true or false?
    2. Are there any known issues with the use of the JDBC Conneciton Pool as stated by the above to approaches?

    Thanks for the additional info. Please see my comments. below.
    Sorry should have been more specififc -
    1. Is each application pool using a different JDBC user? You mentioned DatabaseConnection1 and DatabaseConnection2
    above; are these connections to different schemas / users? If so, BC4J will create a separate connection pool for each
    JDBC user. Each connection pool will have its own maximum pool size.
    Each 'DatabaseConnection' refers to a different database, actually hosted on a seperate physical server, different
    schema and different user.BC4J will maintain a separate connection pool for each permutation of JDBC URL / schema. If each user is connecting
    to a different DB instance then I would expect no greater than 10 DB sessions. However, if a DB instance is hosting
    more than user then I would expect greater than 10 DB sessions (though still no more than 10 DB sessions per user).
    2. Are all the v$session sessions related to the JDBC clients? There should be at least one additional database
    session which will be related to the session that is querying v$session.
    When querying the v$session table I specifically look for connections from the user in quesiton and from the machine
    name in question and in doing so eliminate the database system's connections, as well as the query tools'
    connection. One area I'm not sure about is the connection BC4J uses to write to its temporary tables. I am using
    Stateless release mode and have not explicetly stated to save to the database but I'm wondering if it still does if so
    and how does it come into the equation with max connections?BC4J's internal connections are also pooled and the limits apply as mentioned above. So, if you have specified
    internal connection info for a schema which is different than the users above I would expect the additional conns.
    One helpful diagnostic tool, albeit programmatic, might be to print the information about the connection pools after
    your test client(s) have finished. This may be accomplished as follows:
    // get a reference to the BC4J connection pool manager
    import oracle.jbo.server.ConnectionPoolManagerFactory;
    import oracle.jbo.server.ConnectionPoolManagerImpl;
    import oracle.jbo.pool.ResourcePool;
    import java.io.PrintWriter;
    import java.util.Enumeration;
    // get the ConnectionPoolManager. assume that it is an instance of the supplied manager
    ConnectionPoolManagerImpl mgr = (ConnectionPoolManagerImpl)ConnectionPoolManagerFactory.getConnectionPoolManager();
    Enumeration keys = mgr.getResourcePoolKeys();
    PrintWriter pw = new PrintWriter(System.out, true);
    while (keys.hasMoreElements())
    Object key = keys.nextElement();
    ResourcePool pool = (ResourcePool)mgr.getResourcePool(key);
    System.out.println("Dumping pool statistics for pool: " + key);
    pool.dumpPoolStatistics(pw);
    }

  • Connection Pool and Database Sessions

    Hi,
    Is there any way to use the connection pool or Datasource while connecting to database?If I am using a stateless sesssion bean and using a Data Access layer which just creates a database session to write the persistence toplink objects how I can make use of application server connection pool?
    Thanks,
    Vinod

    Hi,
    Is there any way to use the connection pool or Datasource while connecting to database?If I am using a stateless sesssion bean and using a Data Access layer which just creates a database session to write the persistence toplink objects how I can make use of application server connection pool?Hi Vinod,
    Yes, TopLink allows you to use the app server's connection pooling and transaction services. Chapter 2 of the Oracle9iAS TopLink Foundation Library Guide provides details as do the TopLink examples. The easiest way to set this up is by using the sessions.xml file. The sample XML below is from the file <toplink903>\examples\ias\examples\ejb\sessionbean\sessions.xml. Here we are adding the datasource defined in OC4J and specifying that we are using the OC4J transaction controller also.
    <login>
    <user-name>sa</user-name>
    <password></password>
    <datasource>java:comp/env/jdbc/ejbJTSDataSource</datasource>
    <uses-external-transaction-controller>true</uses-external-transaction-controller>
    <uses-external-connection-pool>true</uses-external-connection-pool>
    </login>
    <external-transaction-controller-class>oracle.toplink.jts.oracle9i.Oracle9iJTSExternalTransactionController</external-transaction-controller-class>
    When using this approach you need to change your TopLink code slightly in the EJB methods:
    a. Acquire the ACTIVE unit of work from the server
    session (again, see the EmployeeSessionEJB code
    example) with something like:
    UnitOfWork uow = clientSession.getActiveUnitOfWork();
    b. Calls to uow.commit() can be ommitted or commented out
    because the EJB will handle this. Note that of course
    the methods you create in the EJB that are using this
    approach must have TX Required (default).
    Hope this helps.
    Pete

  • Listener EA2: database connection pool and connection revalidation

    Hi all,
    As one can expect from early adopter release there could be some bugs but I can't find any references in forum to my situation:
    * My 11g XE database and listener are starting as windows services when server boots operating system (Windows Server 2003 R2).
    * I configured my web server (unsupported Jetty 9.0.0.M1) to start as windows service when operating system starts.
    * Apex Listener 2.0.0.268.17.05 configured to connect with XE using JDBC thin driver with default settings (initial pool size 3, max statements 10, min connections 1, max connections 10, inactivity timeout 1800, abandoned connection timeout 900)
    * Because web server starts a bit faster than Oracle database when apex connects first time it gets "ORA-12528, TNS:listener: all appropriate instances are blocking new connections" (could be that database still starting but already registered service with listener)
    * From listener.log file I can see that all further connections made from Apex listener succeeds
    * When I try to open any apex page with browser I am getting 404 error and apex listener logs error (*time is 2 days after system startup*):
    2012-11-30 3:56:02 PM oracle.dbtools.common.config.db.DatabaseConfig badConfiguration
    SEVERE: The pool named: apex is not correctly configured, error: Listener refused the connection with the following error:
    ORA-12528, TNS:listener: all appropriate instances are blocking new connections
    ConnectionPoolException [error=BAD_CONFIGURATION]
         at oracle.dbtools.common.jdbc.ConnectionPoolException.badConfiguration(ConnectionPoolException.java:62)
         at oracle.dbtools.common.config.db.DatabaseConfig.badConfiguration(DatabaseConfig.java:146)
         at oracle.dbtools.common.config.db.DatabaseConfig.createPool(DatabaseConfig.java:168)
         at oracle.dbtools.common.config.db.DatabaseConfig.getConnection(DatabaseConfig.java:68)
         at oracle.dbtools.common.jdbc.ora.OraPrincipal.connection(OraPrincipal.java:25)
         at oracle.dbtools.apex.ModApexContext.getConnection(ModApexContext.java:320)
         at oracle.dbtools.apex.Procedure.getProcedure(Procedure.java:166)
         at oracle.dbtools.apex.OWA.validateProcedure(OWA.java:384)
         at oracle.dbtools.apex.security.Security.isValidRequest(Security.java:171)
         at oracle.dbtools.apex.ModApex.validateRequest(ModApex.java:233)
         at oracle.dbtools.apex.ModApex.doGet(ModApex.java:79)
         at oracle.dbtools.apex.ModApex.service(ModApex.java:263)
         at oracle.dbtools.rt.web.HttpEndpointBase.modApex(HttpEndpointBase.java:288)
         at oracle.dbtools.rt.web.HttpEndpointBase.service(HttpEndpointBase.java:127)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:848)
         at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:665)
         <... Jetty web server stack ...>
         at java.lang.Thread.run(Unknown Source)
    2012-11-30 3:56:02 PM oracle.dbtools.rt.web.HttpEndpointBase modApex
    * Oracle listener log for same time (no errors here):
    30-NOV-2012 15:56:01 * (CONNECT_DATA=(CID=(PROGRAM=JDBC Thin Client)(HOST=__jdbc__)(USER=SYSTEM))(SERVICE_NAME=xe)(CID=(PROGRAM=JDBC Thin Client)(HOST=__jdbc__)(USER=SYSTEM))) * (ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=1078)) * establish * xe * 0
    30-NOV-2012 15:56:01 * (CONNECT_DATA=(CID=(PROGRAM=JDBC Thin Client)(HOST=__jdbc__)(USER=SYSTEM))(SERVICE_NAME=xe)(CID=(PROGRAM=JDBC Thin Client)(HOST=__jdbc__)(USER=SYSTEM))) * (ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=1079)) * establish * xe * 0
    30-NOV-2012 15:56:01 * (CONNECT_DATA=(CID=(PROGRAM=JDBC Thin Client)(HOST=__jdbc__)(USER=SYSTEM))(SERVICE_NAME=xe)(CID=(PROGRAM=JDBC Thin Client)(HOST=__jdbc__)(USER=SYSTEM))) * (ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=1080)) * establish * xe * 0
    30-NOV-2012 15:56:01 * (CONNECT_DATA=(CID=(PROGRAM=JDBC Thin Client)(HOST=__jdbc__)(USER=SYSTEM))(SERVICE_NAME=xe)(CID=(PROGRAM=JDBC Thin Client)(HOST=__jdbc__)(USER=SYSTEM))) * (ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=1081)) * establish * xe * 0
    * For some reason apex listener keeps first connection status and won't try to establish new connection if first attempt finished with ORA-12528
    * The same scenario is valid when at time of web server start oracle database/listener is not available - even if database and listener starts and apex successfully establishes further connections all apex pages gets 404 error
    * If I restart web server windows service (while oracle db and listener still running) browser opens apex pages without errors and apex listener does not log any errors
    * I know that I can avoid this error delaying start of web server windows service but it would be nice to have production release 2.x without such bugs

    Hi,
    Is there any way to use the connection pool or Datasource while connecting to database?If I am using a stateless sesssion bean and using a Data Access layer which just creates a database session to write the persistence toplink objects how I can make use of application server connection pool?Hi Vinod,
    Yes, TopLink allows you to use the app server's connection pooling and transaction services. Chapter 2 of the Oracle9iAS TopLink Foundation Library Guide provides details as do the TopLink examples. The easiest way to set this up is by using the sessions.xml file. The sample XML below is from the file <toplink903>\examples\ias\examples\ejb\sessionbean\sessions.xml. Here we are adding the datasource defined in OC4J and specifying that we are using the OC4J transaction controller also.
    <login>
    <user-name>sa</user-name>
    <password></password>
    <datasource>java:comp/env/jdbc/ejbJTSDataSource</datasource>
    <uses-external-transaction-controller>true</uses-external-transaction-controller>
    <uses-external-connection-pool>true</uses-external-connection-pool>
    </login>
    <external-transaction-controller-class>oracle.toplink.jts.oracle9i.Oracle9iJTSExternalTransactionController</external-transaction-controller-class>
    When using this approach you need to change your TopLink code slightly in the EJB methods:
    a. Acquire the ACTIVE unit of work from the server
    session (again, see the EmployeeSessionEJB code
    example) with something like:
    UnitOfWork uow = clientSession.getActiveUnitOfWork();
    b. Calls to uow.commit() can be ommitted or commented out
    because the EJB will handle this. Note that of course
    the methods you create in the EJB that are using this
    approach must have TX Required (default).
    Hope this helps.
    Pete

Maybe you are looking for

  • ITunes Match, AOL Account, Apple ID

    So here's my dilemma. I tried to sign up for iTunes Match on my mac but was told I couldn't because I was still using my old AOL account for iTunes and iOS App Store purchases (this is not an Apple ID, this is from when iTunes allowed you to sign in

  • Looking for a list of companies who use Oracle

    Hi Everyone, I hope this is the correct forum to post this message. I was wondering if anyone knows how to find a list of companies in my area (the state of CT) that use Oracle so I can use it to find employment for myself. Thanks in advance. Emad

  • Please help me configure a new 8core for FCP

    PLEASE HELP A PC GUY MOVE OVER... I need to configure a new 8-core for FCP mainly. I need to keep the expense reasonable so dont want to spend extra $$$ if i dont have to. I edit files from many different camera's these days. Mostly weddings & demos.

  • Problem in the Procedure GET_MATCHING

    THE PROCEDURE JOB : GET compare BETWEEN ANY WORD IN TABLE dynamic for Each character but the loop not stop when i run the procedure please help me i have frustration ...thanks for all team support BODY Procedure : CREATE OR REPLACE PROCEDURE APPS.get

  • Powerpoint converter hangs with converting PP presentation with audio

    Hi all, I've been using Captivate v5 before. Now I've starting Captivate 6 and now I've got an issue: When I import a Powerpoint presentation (2003) with a  voice over, made in powerpoint, the powerpoint converter hangs. No response on any click. The