Problem w/ DataSource Pooling

We are having difficulty getting 9iAS DataSource Pooling to work. We are using 9iAS 9.0.3 (without Infrastructure) and, as per the J2EE Services Guide, have :
1) Added...
Context ic = new InitialContext();
DataSource ds (DataSource) ic.lookup("jdbc/OracleDS")
Connection con = ds.getConnection();
...to our code.
2) Modified the default DataSource's url, username, password, min-connections & max-connections from within Enterprise Manager (leaving ejb-location as is at "jdbc/OracleDS") and restarted the Instance.
The app generates an exception when trying to locate the OracleDS, however.
We have also tried replacing the "com.evermind.sql.DriverManagerDataSource" class with "oracle.jdbc.pool.OracleConnectionCacheImpl" as per another post's recommendation.
It appears that others have had similar problems (prior to 903?), but some have, in fact, (now) got this working successfully -- what are we missing please......?
Thanks.

we are coming up with a much clearer and simpler to use data-sources story, which, for now, is the following:
1) if your component does not requires JTA services then you must use JDBC vendor specific data source such as oracle.jdbc.pool.OracleConnectioncacheImp -- only "location" JNDI context needs to be specified in data-sources.xml (and you must lookup the data source specified at this location -- you get JDBC (vendor's specific, in this case Oracle) pooling/caching
2) if your component requires JTA services but does not require 2PC, then you must use OC4J emulated data sources DriverManagerDataSource -- "location", "ejb-location" and "xa-location" JNDI contexts must be specified in data-sources.xml but we strongly recommend to only lookup the data source specified at ejb-location -- you get OC4J connection pooling
3) your component requires JTA AND 2PC services, you must use OC4J's non-emulated data sources OrionCMTDataSource -- only "location" JNDI context needs to be specified in data-sources.xml (and you must lookup the data source specified at this location -- you get Oracle JDBC pooling/caching -- look the doc for additional configuration (dblink, commit-coordinator, etc)
Anything else will lead to unwanted behavior
Kuassi

Similar Messages

  • URGENT : Problem in DataSource usage in Client applIcation

    URGENT : Problem in DataSource usage in Client applIcation
    Hi ALL
    I have deployed a EJB(Session Bean) in Oracle-OC4J Container.I am using datasources, in my bean as well as in my client
    application.Here Client is deployed along with bean in container.
    I am using "ejb-location"JNDI Name inside Client to get connection.
    (Which is mentioned in datasource element of datasources.xml)
    For this i have configured datasources.xml also.
    If i use "oracle.jdbc.pool.OracleDataSource" in datasources.xml then ClassNotFoundException is coming.
    But i have included classes12.jar in home/lib directory
    But if i use "com.evermind.sql.ConnectionDataSource" then i am getting connection.But if i do some operations(Even
    setAutoCommit(false))its giving NULL PointerException.
    Why this is happening?
    Thanx in advance
    Venky

    Hi Venkastesh,
    There are two issues. If your entry is like this....
    location="microDS"
    xa-location="jdbc/xa/MicroXADS"
    ejb-location="MicroPool"
    ...then use ejb-location for database calls through ejb and location when you try to get through normal java client.
    This will help you.
    regards,
    Vijay
    null

  • Problems using connection pooling

    I'm having problems configuring connection pooling in oc4j. Have specified my datasource/connection pool in my data-sources.xml. I always get the following error when I try to access it with an instance of OracleConnectionPoolDataSource within my apps. The app server dosen't seem to create the connections when started 'cos its not displayed within Oracle dba studio. Can anyone tell what I need to do pls.
    regards!
    dyzke
    //-- error displayed
    Exception in thread "main" java.sql.SQLException: Io exception: The Network Adap
    ter could not establish the connection
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:168)
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:210)
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:323)
    at oracle.jdbc.driver.OracleConnection.<init>(OracleConnection.java:260)
    at oracle.jdbc.driver.OracleDriver.getConnectionInstance(OracleDriver.ja
    va:365)
    at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:260)
    at java.sql.DriverManager.getConnection(Unknown Source)
    at java.sql.DriverManager.getConnection(Unknown Source)
    at oracle.jdbc.pool.OracleDataSource.getConnection(OracleDataSource.java
    :111)
    // -- extract
    <data-source
              class="com.evermind.sql.DriverManagerDataSource"
    name="MYDS"
              location="jdbc/XXX"      
    xa-location="jdbc/xa/OracleXADS"
              ejb-location="jdbc/OracleDS"
    pooled-location="xxx/xxxx"
              max-connections="10"
              min-connections="3"                    
              connection-driver="oracle.jdbc.driver.OracleDriver"
              username="admin"
              password="admin"
              url="jdbc:oracle:thin:@localhost:xxx"
              inactivity-timeout="30"
         />

    see my answer in the other newsgroup.
    please don't cross post.
    "M. Hammer" <[email protected]> wrote in message
    news:[email protected]..
    Hi,
    We have problems using connection pooling in a WLS 5.1.x - Cluster. Is it
    possible to use CP in such a cluster at all ? The problem is, connections
    will be opened and never been closed. How can I configure a cluster forCP?
    >
    I have a WLS-Cluster with 2 instances and my webApp uses connectionpooling.
    By the way I get a connection on Instance 1, Instance 2 gets a connection
    also, but never releases it.
    In my opinion, the reference to the connection in the partner-instancewill
    be lost.
    How do I have to configure my cluster to work well with that stuff ?
    Thank a lot,
    Markus.

  • Datasource pool are not recovered

    Sometimes in our environment, weblogic lose the connection with the database for any reason:
    - the network between weblogic server and data base server have some crash
    - the data base is out
    Most of the times, as soon as the connection is reestablished, the data source connections of the pool become available again. We have the properties 'test Frequency' and 'Test Table Name' setted.
    But, in some cases not yet identified, the datasource pool keeps unavailable. The datasource isn't recovered even if it is restarted. The only solution is to restart weblogic server (version 10.3.2).
    This happen in production and development environment. Unfortunately we couldn't map all variables that make this happen in order to reproduce it.
    Does anybody have faced the same problem? Any hint?
    Thanks. Mauro.

    You could try setting the property Test Connections On Reserve on the connection pool. Now the connection will be tested
    before it is given to the client.
    Also the Test Frequency property can be used to test unused connections if they are still valid. By default this is set to 120
    seconds.

  • 9iAS Connection (DataSource) Pooling

    We are having difficulty getting 9iAS DataSource Pooling to work. We are using 9iAS 9.0.3 (without Infrastructure) and, as per the J2EE Services Guide, have :
    1) Added...
    Context ic = new InitialContext();
    DataSource ds (DataSource) ic.lookup("jdbc/OracleDS")
    Connection con = ds.getConnection();
    ...to our code.
    2) Modified the default DataSource's url, username, password, min-connections & max-connections from within Enterprise Manager (leaving ejb-location as is at "jdbc/OracleDS") and restarted the Instance.
    The app generates an exception when trying to locate the OracleDS, however.
    We have also tried replacing the "com.evermind.sql.DriverManagerDataSource" class with "oracle.jdbc.pool.OracleConnectionCacheImpl" as per another post's recommendation.
    It appears that others have had similar problems (prior to 903?), but many have, in fact, (now) got this working successfully -- what are we missing please......?
    Thanks.

    Can you run the server with -Djbo.debugoutput=console property set on the vm command line and send us the detail exception, if any, thrown on the server console.

  • Problem in Module Pool Program

    Hi All,
    I got one problem in Module pool program.Im using table control.when selected multiple coloms by table control option left top.
    when I want to de-select one by one,unable to de-select. Please suggest me.
    thank you,
    Anu.

    Thank You All.
    Solved my self.
    The coding as below.
    PROCESS BEFORE OUTPUT.
      CALL SUBSCREEN SUB INCLUDING SY-REPID '110'.
      LOOP AT GT_ITAB INTO WA WITH CONTROL VCONTROL.
        MODULE SET.
        MODULE STATUS_0100.
      ENDLOOP.
    PROCESS AFTER INPUT.
       CALL SUBSCREEN SUB.
      LOOP AT GT_ITAB .
        CHAIN.
          FIELD WA-EBELN.
          FIELD WA-EMATN.
          FIELD WA-EBELP.
          FIELD WA-MATNR.
          FIELD WA-MARK.
          MODULE MODIFY ON CHAIN-REQUEST.
        ENDCHAIN.
      ENDLOOP.
        MODULE USER_COMMAND_0100.
    MODULE USER_COMMAND_0100 INPUT.
    CASE SY-UCOMM.
        WHEN 'SAVE'.
          PERFORM SAVE_VARIANT.
          PERFORM VARIANT_EXISTS.
        WHEN 'SEL'.
          LOOP AT GT_ITAB INTO WA.
            WA-MARK = 'X'.
            MODIFY GT_ITAB FROM WA .
          ENDLOOP.
    endmodule.
    MODULE STATUS_0100 OUTPUT.
      SET PF-STATUS 'ZTESTING'.
      SET TITLEBAR 'ZTEST'.
      SET PF-STATUS  'ZTESTING' EXCLUDING IT_EXTAB.
      MOVE:WA-EBELN TO EKKO-EBELN,
           WA-EBELP TO EKPO-EBELP,
           WA-MATNR TO WA-MATNR.
      MOVE:WA-EMATN TO WA-EMATN.
    MODIFY GT_ITAB FROM WA INDEX VCONTROL-CURRENT_LINE.
      VCONTROL-LINES = SY-DBCNT.
    ENDMODULE.                 " STATUS_0100  OUTPUT
    MODULE SET OUTPUT.
      SET CURSOR FIELD CURSORFIELD OFFSET POS.
    ENDMODULE.                 " SET  OUTPUT
    Thank You,
    Anu.

  • Problem in datasource enhancement

    Hi All,
    Facing a problem in datasource enhancement.
    In R/3 SAP ABAP release = 640 and
    BW release = 350.
    Datasource: 0WBS_ELEMT_ATTR
    I enhanced the datasource by adding an append structure with 'ZZ' fields.The data elements for these fields are SAP standard (like KUNNR,VKORG etc...)
    Everything's active and there are no inconsistencies.
    However these added fields are not visible either in the RSA6 maintenance or in RSA3 checker.
    Hence I am unable to replicate these fields and pull them over to BW.
    Please advise.

    Guys,
    The problem is not with hiding/unhiding these fields.
    The appended fields themselves are not coming up through the RSA6 maintenance. They are not available for unhiding.
    Please advise.

  • Problem with Connection Pooling of datasources in a web service

    Hi,
    I have been driven insane trying to fix this problem, I am trying to connect to a MS SQL data source from a web service in tomcat 4.1, so I have defined the data source through tomcats server administration pages and checked that it has inserted the correct code to server.xml. I have also added the relevant information to the web.xml and added the code to the service. when I start tomcat it outputs:
    DbcpDataSourceFactory: driverClassName=com.microsoft.jdbc.sqlserver.SQLServerDriver, url=jdbc:microsoft:sqlserver://192.168.0.22:1433:databaseName=dbname, user=sa
    but then these errors occours:
    java.lang.reflect.InvocationTargetException
    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.commons.launcher.ChildMain.run(ChildMain.java:269)
    Caused by: java.lang.IllegalStateException: Context path /RegistryServer is already in use
    at org.apache.catalina.core.StandardHostDeployer.addChild(StandardHostDeployer.java:523)
    ... 42 more
    and
    [ERROR] Digester - -End event threw exception <java.lang.reflect.InvocationTargetException>
    java.lang.reflect.InvocationTargetException
         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.commons.beanutils.MethodUtils.invokeMethod(MethodUtils.java:216)
         at org.apache.commons.digester.SetNextRule.end
    (Bootstrap.java:203)
         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.commons.launcher.ChildMain.run(ChildMain.java:269)
    Caused by: java.lang.IllegalStateException: Context path /Xindice is already in use
         at org.apache.catalina.core.StandardHostDeployer.addChild(StandardHostDeployer.java:523)
         ... 42 more
    And when I try to use the data source my code gets the context but when getting the datasource it shows the error:
    Error doing something: javax.naming.NamingException: DbcpDataSourceFactory: driverClassName is required
    My server.xml reads:
    <Resource name="jdbc/msService" scope="Shareable" type="javax.sql.DataSource"/>
    <ResourceParams name="UserDatabase">
    <parameter>
    <name>factory</name>
    <value>org.apache.catalina.users.MemoryUserDatabaseFactory</value>
    </parameter>
    <parameter>
    <name>pathname</name>
    <value>conf/tomcat-users.xml</value>
    </parameter>
    </ResourceParams>
    <ResourceParams name="jdbc/msService">
    <parameter>
    <name>validationQuery</name>
    <value></value>
    </parameter>
    <parameter>
    <name>user</name>
    <value>sa</value>
    </parameter>
    <parameter>
    <name>url</name>
    <value>jdbc:microsoft:sqlserver://192.168.0.22:1433:databaseName=dbname</value>
    </parameter>
    <parameter>
    <name>password</name>
    <value>password</value>
    </parameter>
    <parameter>
    <name>maxActive</name>
    <value>4</value>
    </parameter>
    <parameter>
    <name>maxWait</name>
    <value>5000</value>
    </parameter>
    <parameter>
    <name>driverClassName</name>
    <value>com.microsoft.jdbc.sqlserver.SQLServerDriver</value>
    </parameter>
    <parameter>
    <name>maxIdle</name>
    <value>2</value>
    </parameter>
    </ResourceParams>
    and my web.xml
    <web-app>
    <display-name>User Service</display-name>
    <description>A service to perform user information orientated tasks</description>
    <session-config>
    <session-timeout>60</session-timeout>
    </session-config>
    <resource-ref>
    <description> Resource reference to java.sql.Connection factory defined in server.xml</description>
    <res-ref-name>jdbc/msService</res-ref-name>
    <res-type>javax.sql.DataSource</res-type>
    <res-auth>Container</res-auth>
    </resource-ref>
    </web-app>
    I have read the other posts regarding this error and most mention that the jar files need to be in <root>/common/lib but I have deinitely put all the MS jar files here!!!
    sorry this is such a long post but if any one has any idea it would be most appreciated!!!!
    cheers
    pasty

    Hi,
    I'm struggling with the same problem. One thing I noticed is that your url looks a bit different than others that I've seen:
    Yours:
    url=jdbc:microsoft:sqlserver://192.168.0.22:1433:databaeName=dbname, user=sa
    Most other folks:
    url=jdbc:microsoft:sqlserver://192.168.0.22:1433;databaseName=dbname; user=sa
    Note the semicolons.
    I don't know whether this will help you or not, but it's worth a try.
    Does anyone know where I can get documentation for the options that MS' jdbc driver for SQL Server? I've googled groups and the web and can't find anything authoritative.
    Dan
    Hi,
    I have been driven insane trying to fix this problem,
    I am trying to connect to a MS SQL data source from a
    web service in tomcat 4.1, so I have defined the data
    source through tomcats server administration pages and
    checked that it has inserted the correct code to
    server.xml. I have also added the relevant
    information to the web.xml and added the code to the
    service. when I start tomcat it outputs:
    DbcpDataSourceFactory:
    driverClassName=com.microsoft.jdbc.sqlserver.SQLServer
    river,
    url=jdbc:microsoft:sqlserver://192.168.0.22:1433:databa
    eName=dbname, user=sa
    but then these errors occours:
    java.lang.reflect.InvocationTargetException
    at
    at
    at
    t sun.reflect.NativeMethodAccessorImpl.invoke0(Native
    Method)
    at
    at
    at
    t
    sun.reflect.NativeMethodAccessorImpl.invoke(NativeMetho
    AccessorImpl.java:39)
    at
    at
    at sun.reflect.DelegatingMethodAccessorImpl.invoke
    (DelegatingMethodAccessorImpl.java:25)
    at
    at
    at java.lang.reflect.Method.invoke(Method.java:324)
    at
    at
    at
    t
    org.apache.commons.launcher.ChildMain.run(ChildMain.jav
    :269)
    Caused by: java.lang.IllegalStateException: Context
    path /RegistryServer is already in use
    at
    at
    at
    t
    org.apache.catalina.core.StandardHostDeployer.addChild(
    tandardHostDeployer.java:523)
    ... 42 more
    and
    [ERROR] Digester - -End event threw exception
    <java.lang.reflect.InvocationTargetException>
    java.lang.reflect.InvocationTargetException
    at
    sun.reflect.NativeMethodAccessorImpl.invoke0(Native
    Method)
    at
    sun.reflect.NativeMethodAccessorImpl.invoke(NativeMeth
    dAccessorImpl.java:39)
    at
    sun.reflect.DelegatingMethodAccessorImpl.invoke(Delega
    ingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:324)
    at
    org.apache.commons.beanutils.MethodUtils.invokeMethod(
    ethodUtils.java:216)
         at org.apache.commons.digester.SetNextRule.end
    (Bootstrap.java:203)
    at
    sun.reflect.NativeMethodAccessorImpl.invoke0(Native
    Method)
    at
    sun.reflect.NativeMethodAccessorImpl.invoke(NativeMeth
    dAccessorImpl.java:39)
    at
    sun.reflect.DelegatingMethodAccessorImpl.invoke(Delega
    ingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:324)
    at
    org.apache.commons.launcher.ChildMain.run(ChildMain.ja
    a:269)
    Caused by: java.lang.IllegalStateException: Context
    path /Xindice is already in use
    at
    org.apache.catalina.core.StandardHostDeployer.addChild
    StandardHostDeployer.java:523)
         ... 42 more
    And when I try to use the data source my code gets the
    context but when getting the datasource it shows the
    error:
    Error doing something: javax.naming.NamingException:
    DbcpDataSourceFactory: driverClassName is required
    My server.xml reads:
    <Resource name="jdbc/msService" scope="Shareable"
    le" type="javax.sql.DataSource"/>
    <ResourceParams name="UserDatabase">
    <parameter>
    <name>factory</name>
    <value>org.apache.catalina.users.MemoryUserDatabaseFac
    ory</value>
    </parameter>
    <parameter>
    <name>pathname</name>
    <value>conf/tomcat-users.xml</value>
    </parameter>
    </ResourceParams>
    <ResourceParams name="jdbc/msService">
    <parameter>
    <name>validationQuery</name>
    <value></value>
    </parameter>
    <parameter>
    <name>user</name>
    <value>sa</value>
    </parameter>
    <parameter>
    <name>url</name>
    <value>jdbc:microsoft:sqlserver://192.168.0.22:1433:da
    abaseName=dbname</value>
    </parameter>
    <parameter>
    <name>password</name>
    <value>password</value>
    </parameter>
    <parameter>
    <name>maxActive</name>
    <value>4</value>
    </parameter>
    <parameter>
    <name>maxWait</name>
    <value>5000</value>
    </parameter>
    <parameter>
    <name>driverClassName</name>
    <value>com.microsoft.jdbc.sqlserver.SQLServerDriver</v>
    </parameter>
    <parameter>
    <name>maxIdle</name>
    <value>2</value>
    </parameter>
    </ResourceParams>
    and my web.xml
    <web-app>
    <display-name>User Service</display-name>
    <description>A service to perform user information
    n orientated tasks</description>
    <session-config>
    <session-timeout>60</session-timeout>
    </session-config>
    <resource-ref>
    <description> Resource reference to
    to java.sql.Connection factory defined in
    server.xml</description>
    <res-ref-name>jdbc/msService</res-ref-name>
    <res-type>javax.sql.DataSource</res-type>
    <res-auth>Container</res-auth>
    </resource-ref>
    </web-app>
    I have read the other posts regarding this error and
    most mention that the jar files need to be in
    <root>/common/lib but I have deinitely put all the MS
    jar files here!!!
    sorry this is such a long post but if any one has any
    idea it would be most appreciated!!!!
    cheers
    pasty

  • Problem in Filling Pool, In ConnectionPooling Code:Urgent Plz

    Hi All,
    I m using this program for Connection Pooling.
    import java.sql.*;
    import javax.sql.*;
    import java.util.*;
    import java.io.*;
    import javax.naming.*;
    public class ConnectionPool implements Runnable{
      private DataSource datasource;
      private int maxConnections;
      private int initialConnections;
      private boolean waitIfBusy;
      private boolean connectionPending = false;
      private Vector<java.sql.Connection> availableConnections;
      private Vector<java.sql.Connection> busyConnections;
      public ConnectionPool()throws SQLException {
        try{
             Context ic = new InitialContext();
              this.datasource = (DataSource)ic.lookup("java:msgds");                    
              System.out.println("DataSource Found msgds");
         }catch(Exception e){
              System.out.println("Error in ConnectionPool COnstructor While Locatin ashishds");
        this.waitIfBusy = true;   
        this.waitIfBusy = waitIfBusy;
        this.maxConnections = 5;
        this.initialConnections = 2;
        availableConnections = new Vector<java.sql.Connection>(2);
        busyConnections = new Vector<java.sql.Connection>();
        for(int i=0; i<initialConnections; i++) {
          availableConnections.addElement(makeNewConnection());
      public synchronized Connection getConnection()
          throws SQLException {
        if (!availableConnections.isEmpty()) {
          Connection existingConnection =
            (Connection)availableConnections.lastElement();
          int lastIndex = availableConnections.size() - 1;
          availableConnections.removeElementAt(lastIndex);
          // If connection on available list is closed (e.g.,
          // it timed out), then remove it from available list
          // and repeat the process of obtaining a connection.
          // Also wake up threads that were waiting for a
          // connection because maxConnection limit was reached.
          if (existingConnection.isClosed()) {
            notifyAll(); // Freed up a spot for anybody waiting
            return(getConnection());
          } else {
            busyConnections.addElement(existingConnection);
            return(existingConnection);
        } else {
          // Three possible cases:
          // 1) You haven't reached maxConnections limit. So
          //    establish one in the background if there isn't
          //    already one pending, then wait for
          //    the next available connection (whether or not
          //    it was the newly established one).
          // 2) You reached maxConnections limit and waitIfBusy
          //    flag is false. Throw SQLException in such a case.
          // 3) You reached maxConnections limit and waitIfBusy
          //    flag is true. Then do the same thing as in second
          //    part of step 1: wait for next available connection.
          if ((totalConnections() < maxConnections) &&
              !connectionPending) {
            makeBackgroundConnection();
          } else if (!waitIfBusy) {
            throw new SQLException("Connection limit reached");
          // Wait for either a new connection to be established
          // (if you called makeBackgroundConnection) or for
          // an existing connection to be freed up.
          try {
            wait();
          } catch(InterruptedException ie) {}
          // Someone freed up a connection, so try again.
          return(getConnection());
      // You can't just make a new connection in the foreground
      // when none are available, since this can take several
      // seconds with a slow network connection. Instead,
      // start a thread that establishes a new connection,
      // then wait. You get woken up either when the new connection
      // is established or if someone finishes with an existing
      // connection.
      private void makeBackgroundConnection() {
        connectionPending = true;
        try {
          Thread connectThread = new Thread(this);
          connectThread.start();
        } catch(OutOfMemoryError oome) {
          // Give up on new connection
      public void run() {
        try {
          Connection connection = makeNewConnection();
          synchronized(this) {
            availableConnections.addElement(connection);
            connectionPending = false;
            notifyAll();
        } catch(Exception e) { // SQLException or OutOfMemory
          // Give up on new connection and wait for existing one
          // to free up.
      // This explicitly makes a new connection. Called in
      // the foreground when initializing the ConnectionPool,
      // and called in the background when running.
      private Connection makeNewConnection()
          throws SQLException {
        try {    
          // Establish network connection to database
          Connection connection = datasource.getConnection();
          return(connection);
        } catch(Exception cnfe) {
          // Simplify try/catch blocks of people using this by
          // throwing only one exception type.
          throw new SQLException("Error in makeNewConnection() : " +cnfe);
      public synchronized void free(Connection connection) {
        busyConnections.removeElement(connection);
        availableConnections.addElement(connection);
        // Wake up threads that are waiting for a connection
        notifyAll();
      public synchronized int totalConnections() {
        return(availableConnections.size() +
               busyConnections.size());
      /** Close all the connections. Use with caution:
       *  be sure no connections are in use before
       *  calling. Note that you are not <I>required</I> to
       *  call this when done with a ConnectionPool, since
       *  connections are guaranteed to be closed when
       *  garbage collected. But this method gives more control
       *  regarding when the connections are closed.
      public synchronized void closeAllConnections() {
        closeConnections(availableConnections);
        availableConnections = new Vector<java.sql.Connection>();
        closeConnections(busyConnections);
        busyConnections = new Vector<java.sql.Connection>();
      private void closeConnections(Vector connections) {
        try {
          for(int i=0; i<connections.size(); i++) {
            Connection connection =
              (Connection)connections.elementAt(i);
            if (!connection.isClosed()) {
              connection.close();
        } catch(SQLException sqle) {
          // Ignore errors; garbage collect anyhow
      public synchronized String toString() {
        String info =
          "ConnectionPool(Data Source is :"+datasource+ ")" +
          ", available=" + availableConnections.size() +
          ", busy=" + busyConnections.size() +
          ", max=" + maxConnections;
        return(info);
    }To Test This code, I had created one Servlet. In This Servlet I m calling like this:
    in
    init(){
         connectionPool = new ConnectionPool();
    }in
    in
    service(){
         private ConnectionPool connectionPool=null;
         connection = connectionPool.getConnection();
    }in destroy of
    destroy{
         if(connectionPool != null){
                  connectionPool.closeAllConnections();     
    }The Problem is that, Many a times it work, many a times it shows following Error:
    09:56:35,109 WARN  [JBossManagedConnectionPool] Unable to fill pool
    org.jboss.resource.JBossResourceException: Could not create connection; - nested throwable: (java.sql.SQLException:
    Listener refused the connection with the following error:
    ORA-12516, TNS:listener could not find available handler with matching protocol stack
    The Connection descriptor used by the client was:
    192.168.1.8:1521
            at org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory.createManagedConnection(LocalManagedConnectionFa
    ctory.java:177)
            at org.jboss.resource.connectionmanager.InternalManagedConnectionPool.createConnectionEventListener(InternalManagedConn
    ectionPool.java:539)
            at org.jboss.resource.connectionmanager.InternalManagedConnectionPool.fillToMin(InternalManagedConnectionPool.java:486)
            at org.jboss.resource.connectionmanager.PoolFiller.run(PoolFiller.java:74)
            at java.lang.Thread.run(Thread.java:595)
    Caused by: java.sql.SQLException: Listener refused the connection with the following error:
    ORA-12516, TNS:listener could not find available handler with matching protocol stack
    The Connection descriptor used by the client was:
    192.168.1.8:1521
            at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
            at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:261)
            at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:387)
            at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:414)
            at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:165)
            at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:35)
            at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:801)
            at org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory.createManagedConnection(LocalManagedConnectionFa
    ctory.java:169)
            ... 4 moreI M using JBoss 4.0, With OracleXE. I had defined my DataSource-> msgds in mydb-ds.xml of deploy folder of JBoss.
    which is like this:
    <?xml version="1.0" encoding="UTF-8"?>
    <datasources>
      <local-tx-datasource>
        <jndi-name>msgds</jndi-name>
        <connection-url>jdbc:oracle:thin:@192.168.1.8:1521</connection-url>   
        <driver-class>oracle.jdbc.OracleDriver</driver-class>
        <!-- The login and password -->
        <user-name>ashish</user-name>
        <password>ashish</password>
        <min-pool-size>5</min-pool-size>
        <max-pool-size>100</max-pool-size>
        <idle-timeout-minutes>0</idle-timeout-minutes>
      </local-tx-datasource>
    </datasources>I want to know whether This is a right approach to do Connection Pooling. How can I implement this Using Commons.
    What changes i need to made in my mydb-ds.xml if I use Commons Package and also in the code.

    never ask for help to be sent to your email, always post in this thread so that if someone else has the same question they can get the help too.
    this should help get you started... just make sure you get the apache dbcp package (you may need some commons things too, like commons pool)
    private BasicDataSource dataSource;
    * This function actually initializes the datasource, which is
    * in charge of setting up the BasicDataSource, which handles
    * all the database pooling.
    protected synchronized void initDataSource() {
         loadProperties(); // this loads my database properties from a config file
         try {
              dataSource = new BasicDataSource();
              dataSource.setDefaultAutoCommit(true);
              dataSource.setDefaultCatalog(catalogName);
              dataSource.setDriverClassName(jdbcDriver);
              dataSource.setUsername(jdbcUserID);
              dataSource.setPassword(jdbcPassword);
              dataSource.setUrl(jdbcURL);
              dataSource.setMinIdle(minCons);
              dataSource.setMaxIdle(maxCons);
              dataSource.setMaxActive(maxCons);
              dataSource.setMaxWait(5000); // milliseconds to wait for connection if none are available
              dataSource.setAccessToUnderlyingConnectionAllowed(true);
              // will validate each connection before handing it out
              dataSource.setTestOnBorrow(true);
              dataSource.setValidationQuery("select getDate()");
              // setup to test idle objects in the pool
              dataSource.setTestWhileIdle(true);
              dataSource.setTimeBetweenEvictionRunsMillis(600000); // run every 10 minutes
              dataSource.setMinEvictableIdleTimeMillis(60000);  // only examine connections idle for more than 10 minutes
              dataSource.setNumTestsPerEvictionRun(-3); // when this is negative one Nth of connections will be examined
         } catch (Exception e) {
              //whatever you want
    public Connection getConnection() {
         try {
              Connection con = dataSource.getConnection();
              if(con == null) {
                   throw new Exception("Error: DataSource gave a null connection object");
              return con;
         } catch (Exception e) {
              // whatever
    public void freeConnection(Connection con) {
         freeConnection(con, false);
    public void freeConnection(Connection con, boolean isError) {
         try {
              if(con == null) return;
              if(!con.isClosed()) {
                   if(isError && !con.getAutoCommit()) {
                        con.rollback();
                   con.clearWarnings();
                   con.close(); // this adds the con back to the pool
         } catch(Exception e) {
              // whatever
    }     

  • Problem with Datasource for SQL Server Express

    I have set up a development environment to develop some processes for the HCSO client and have a question.  I have a turnkey install on my laptop with MYSQL.  The liveCycle databases are in MYSQL.  I have also installed SQL Server Express on this machine and created a table to query that will control workflow.  I added a datasource configuration in the adobe-ds.xml configuration file.  That configuration is:
    <local-tx-datasource>
                <jndi-name>HCSO</jndi-name>
                <connection-url>jdbc:sqlserver://localhost:1433;DatabaseName=DBName</connection-url>
                <driver-class>com.microsoft.sqlserver.jdbc.SQLServerDriver</driver-class>
                <user-name>username</user-name>
                <password>password</password>
                <min-pool-size>1</min-pool-size>
                <max-pool-size>30</max-pool-size>
                <blocking-timeout-millis>60000</blocking-timeout-millis>
                <autoReconnect>true</autoReconnect>
                <idle-timeout-minutes>15</idle-timeout-minutes>
                <prepared-statement-cache-size>100</prepared-statement-cache-size>
                <transaction-isolation>TRANSACTION_READ_COMMITTED</transaction-isolation>
                <new-connection-sql>Select id from HCSOUser.eric</new-connection-sql>
                <check-valid-connection-sql>Select id from HCSOUser.eric</check-valid-connection-sql>
                <metadata>
                      <type-mapping>MS SQLSERVER2000</type-mapping>
                </metadata>
          </local-tx-datasource>
    In SQL Server, I created a user and a schema with the same name in a database.  I created a simple table called "eric" with one column called "id".  The user was given the appropriate default schema and given full permissions on the database and table.
    In workbench, I added a JDBC query single row activity.  I have configured the datasource as java:/HCSO and also tried java:HCSO.  I then entered the query as "Select id from HCSOUser.eric" and hit test.  Nothing appears in the results area.  I see the following in the server.log:
    2009-09-24 14:44:26,437 ERROR [org.jboss.ejb.plugins.LogInterceptor] RuntimeException in method: public abstract java.lang.Object com.adobe.idp.dsc.transaction.impl.ejb.adapter.EjbTransactionBMTAdapterLocal.doBMT(com.ad obe.idp.dsc.transaction.TransactionCallback) throws com.adobe.idp.dsc.DSCException:
    java.lang.RuntimeException: A result set was generated for update.
          at com.adobe.idp.dsc.jdbc.JDBCService.testExecute(JDBCService.java:616)
          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:592)
          at com.adobe.idp.dsc.component.impl.DefaultPOJOInvokerImpl.invoke(DefaultPOJOInvokerImpl.jav a:118)
          at com.adobe.idp.dsc.interceptor.impl.InvocationInterceptor.intercept(InvocationInterceptor. java:140)
          at com.adobe.idp.dsc.interceptor.impl.RequestInterceptorChainImpl.proceed(RequestInterceptor ChainImpl.java:60)
          at com.adobe.idp.dsc.transaction.interceptor.TransactionInterceptor$1.doInTransaction(Transa ctionInterceptor.java:74)
          at com.adobe.idp.dsc.transaction.impl.ejb.adapter.EjbTransactionBMTAdapterBean.doBMT(EjbTran sactionBMTAdapterBean.java:197)
          at sun.reflect.GeneratedMethodAccessor573.invoke(Unknown Source)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
          at java.lang.reflect.Method.invoke(Method.java:592)
          at org.jboss.invocation.Invocation.performCall(Invocation.java:345)
          at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionConta iner.java:214)
          at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionI nterceptor.java:149)
          at org.jboss.webservice.server.ServiceEndpointInterceptor.invoke(ServiceEndpointInterceptor. java:54)
          at org.jboss.ejb.plugins.CallValidationInterceptor.invoke(CallValidationInterceptor.java:48)
          at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:106)
          at org.jboss.ejb.plugins.AbstractTxInterceptorBMT.invokeNext(AbstractTxInterceptorBMT.java:1 58)
          at org.jboss.ejb.plugins.TxInterceptorBMT.invoke(TxInterceptorBMT.java:62)
          at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstance Interceptor.java:154)
          at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:153)
          at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:192)
          at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor. java:122)
          at org.jboss.ejb.SessionContainer.internalInvoke(SessionContainer.java:624)
          at org.jboss.ejb.Container.invoke(Container.java:873)
          at org.jboss.ejb.plugins.local.BaseLocalProxyFactory.invoke(BaseLocalProxyFactory.java:415)
          at org.jboss.ejb.plugins.local.StatelessSessionProxy.invoke(StatelessSessionProxy.java:88)
          at $Proxy270.doBMT(Unknown Source)
          at com.adobe.idp.dsc.transaction.impl.ejb.EjbTransactionProvider.execute(EjbTransactionProvi der.java:95)
          at com.adobe.idp.dsc.transaction.interceptor.TransactionInterceptor.intercept(TransactionInt erceptor.java:72)
          at com.adobe.idp.dsc.interceptor.impl.RequestInterceptorChainImpl.proceed(RequestInterceptor ChainImpl.java:60)
          at com.adobe.idp.dsc.interceptor.impl.InvocationStrategyInterceptor.intercept(InvocationStra tegyInterceptor.java:55)
          at com.adobe.idp.dsc.interceptor.impl.RequestInterceptorChainImpl.proceed(RequestInterceptor ChainImpl.java:60)
          at com.adobe.idp.dsc.interceptor.impl.InvalidStateInterceptor.intercept(InvalidStateIntercep tor.java:37)
          at com.adobe.idp.dsc.interceptor.impl.RequestInterceptorChainImpl.proceed(RequestInterceptor ChainImpl.java:60)
          at com.adobe.idp.dsc.interceptor.impl.AuthorizationInterceptor.intercept(AuthorizationInterc eptor.java:132)
          at com.adobe.idp.dsc.interceptor.impl.RequestInterceptorChainImpl.proceed(RequestInterceptor ChainImpl.java:60)
          at com.adobe.idp.dsc.interceptor.impl.JMXInterceptor.intercept(JMXInterceptor.java:48)
          at com.adobe.idp.dsc.interceptor.impl.RequestInterceptorChainImpl.proceed(RequestInterceptor ChainImpl.java:60)
          at com.adobe.idp.dsc.engine.impl.ServiceEngineImpl.invoke(ServiceEngineImpl.java:115)
          at com.adobe.idp.dsc.routing.Router.routeRequest(Router.java:118)
          at com.adobe.idp.dsc.provider.impl.base.AbstractMessageReceiver.invoke(AbstractMessageReceiv er.java:315)
          at com.adobe.idp.dsc.provider.impl.soap.axis.sdk.SoapSdkEndpoint.invokeCall(SoapSdkEndpoint. java:138)
          at com.adobe.idp.dsc.provider.impl.soap.axis.sdk.SoapSdkEndpoint.invoke(SoapSdkEndpoint.java :81)
          at sun.reflect.GeneratedMethodAccessor710.invoke(Unknown Source)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
          at java.lang.reflect.Method.invoke(Method.java:592)
          at org.apache.axis.providers.java.RPCProvider.invokeMethod(RPCProvider.java:397)
          at org.apache.axis.providers.java.RPCProvider.processMessage(RPCProvider.java:186)
          at org.apache.axis.providers.java.JavaProvider.invoke(JavaProvider.java:323)
          at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)
          at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
          at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
          at org.apache.axis.handlers.soap.SOAPService.invoke(SOAPService.java:454)
          at org.apache.axis.server.AxisServer.invoke(AxisServer.java:281)
          at org.apache.axis.transport.http.AxisServlet.doPost(AxisServlet.java:699)
          at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
          at org.apache.axis.transport.http.AxisServletBase.service(AxisServletBase.java:327)
          at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.j ava:252)
          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
          at com.adobe.idp.dsc.provider.impl.soap.axis.InvocationFilter.doFilter(InvocationFilter.java :43)
          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.j ava:202)
          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
          at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:81)
          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.j ava:202)
          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
          at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
          at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
          at org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipalValve.java:39)
          at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.ja va:159)
          at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:59)
          at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
          at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
          at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
          at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
          at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)
          at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11P rotocol.java:744)
          at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
          at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
          at java.lang.Thread.run(Thread.java:595)
    Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: A result set was generated for update.
          at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDriverError(Unknown Source)
          at com.microsoft.sqlserver.jdbc.SQLServerStatement.doExecuteStatement(Unknown Source)
          at com.microsoft.sqlserver.jdbc.SQLServerStatement$StatementExecutionRequest.executeStatemen t(Unknown Source)
          at com.microsoft.sqlserver.jdbc.CancelableRequest.execute(Unknown Source)
          at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeRequest(Unknown Source)
          at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeUpdate(Unknown Source)
          at org.jboss.resource.adapter.jdbc.WrappedStatement.executeUpdate(WrappedStatement.java:161)
          at com.adobe.idp.dsc.jdbc.helper.SqlHelper.executeTestUpdate(SqlHelper.java:117)
          at com.adobe.idp.dsc.jdbc.JDBCService.testExecute(JDBCService.java:610)
          ... 82 more

    Thanks fot the tip, but now I got a different message in the "Test" results of "Query Single Row":
    Exception: Could not create connection; - nested throwable: (com.microsoft.sqlserver.jdbc.SQLServerException: The TCP/IP connection to the host  has failed. java.net.ConnectException: Connection refused: connect); - nested throwable: (org.jboss.resource.JBossResourceException: Could not create connection; - nested throwable: (com.microsoft.sqlserver.jdbc.SQLServerException: The TCP/IP connection to the host  has failed. java.net.ConnectException: Connection refused: connect))
    My datasource xml is like this:
    <?xml version="1.0" encoding="UTF-8"?>
            <datasources>
            <local-tx-datasource>
            <jndi-name>MSSQL</jndi-name>
            <connection-url>jdbc:sqlserver://localhost:1433;DatabaseName=ADOBE</connection-url>
              <use-java-context>false</use-java-context>
            <driver-class>com.microsoft.sqlserver.jdbc.SQLServerDriver</driver-class>
            <user-name>sa</user-name>
            <password>adobe</password>
              <min-pool-size>10</min-pool-size>
              <max-pool-size>50</max-pool-size>
              <blocking-timeout-millis>60000</blocking-timeout-millis>
              <idle-timeout-minutes>15</idle-timeout-minutes>
              <prepared-statement-cache-size>100</prepared-statement-cache-size>
              <transaction-isolation>TRANSACTION_READ_COMMITTED</transaction-isolation>
            <check-valid-connection-sql>SELECT 1 FROM sysobjects</check-valid-connection-sql>
            <metadata>
              <type-mapping>MS SQLSERVER2005</type-mapping>
            </metadata>
            </local-tx-datasource>
            </datasources>        
    Where is the problem and how to fix it?
    Thank you.

  • Problem in Connection pooling after deploying BC4J App Module as EJB

    Hi,
    We have deployed the application modules on standalone OC4J as stateful EJB session beans.
    The problem is that with each user, the number of database connections seem to increase. This is making the application unscalable, which defeats the purpose of using EJB!
    Can someone please suggest how to limit the number of database conections in this scenario?
    Can this be solved by application module pooling? How can we use the PoolMgr to work with the session beans?
    We have tried to invoke disconnect on the application module after calling methods(using appmodule.disconnect(true)) and reconnect (appmodule.reconnect()) on entering the method. This keeps the number of connections low and works the first time the method is invoked. But subsequently, it gives nullpointerexception when the Row is accessed in the JSP.
    The exception we are getting is :
    java.lang.NullPointerException
         at oracle.jbo.client.remote.ViewUsageImpl.getStructDef(ViewUsageImpl.java:241)
         at oracle.jbo.client.remote.ViewUsageImpl.findAttributeDef(ViewUsageImpl.java:275)
         at oracle.jbo.client.remote.RowImpl.getAttributeIndexOf(RowImpl.java:368)
         at oracle.jbo.client.remote.RowImpl.getAttribute(RowImpl.java:144)
         at Supplier.client.ejb.beanmanaged.SupplierAM_IntPaymtVORowBeanManagedClient.getMdid(SupplierAM_IntPaymtVORowBeanManagedClient.java:63)
         at supplier.sccPayCheq._jspService(_sccPayCheq.java:102)
         [SRC:/Supplier/sccPayCheq.jsp:44]
    The Application module configuration (in bc4j.xcfg) is:
    <AppModuleConfig name="SupplierAM9iAS">
    <AppServerConnectionName>StandaloneOC4JConnection</AppServerConnectionName>
    <AppModuleJndiName>Supplier.SupplierAM</AppModuleJndiName>
    <java.naming.security.credentials>admin</java.naming.security.credentials>
    <DeployPlatform>EjbIas</DeployPlatform>
    <java.naming.security.principal>admin</java.naming.security.principal>
    <DtMiddleTierDeploymentProfile>ProjectMiddleTier.deploy</DtMiddleTierDeploymentProfile>
    <ApplicationName>Supplier.SupplierAM</ApplicationName>
    <DtDeploymentProfile>ProjectEJB.deploy</DtDeploymentProfile>
    <DtCommonDeploymentProfile>ProjectCommon.deploy</DtCommonDeploymentProfile>
    <JDBCDataSource>jdbc/ConnectionCoreDS</JDBCDataSource>
    <jbo.server.internal_connection>jdbc/ConnectionCoreDS</jbo.server.internal_connection>
    <jbo.ejb.txntype>local</jbo.ejb.txntype>
    <jbo.doconnectionpooling>true</jbo.doconnectionpooling>
    <ApplicationPath>ProjectEJB</ApplicationPath>
    </AppModuleConfig>
    The Datasource used (in $ORACLE_HOME/j2ee/home/config/data-sources.xml) is:
    <data-source
              class="oracle.jdbc.pool.OracleConnectionCacheImpl"           connection-driver="oracle.jdbc.driver.OracleDriver"
              ejb-location="jdbc/ConnectionDS"
              inactivity-timeout="30"
              location="jdbc/ConnectionCoreDS"
              name="ConnectionDS"
              password="*******"
              pooled-location="jdbc/ConnectionPooledDS"
              url="jdbc:oracle:thin:@<IPADDESS>:<SID>"
              username="USER"
              xa-location="jdbc/xa/ConnectionXADS"
              max-connections="5"
              min-connections="1"/>

    Can this be solved by application module pooling? How
    can we use the PoolMgr to work with the session
    beans?You can use a stateless checkout/checkin appmodule.
    Take a look at the following help topics which explain this in good detail.
    "About Application Module Pooling"
    "About JSP Pages and Application Module Pooling"
    The pool can help reuse the appmodule instance across requests thus reducing the number of concurrent db sessions.
    Dhiraj

  • Problem in datasource in embedded oc4j 10.1.3

    Hi,
    I have created a data source with following details.
    Connection Pool Name: jdbc/pool/xyz and enter all details in the connection Factory.
    Then am trying to create a connection as follows
    javax.naming.InitialContext ic = new javax.naming.InitialContext();
    DataSource dd= (javax.sql.DataSource)ic.lookup("jdbc/pool/xyz");
    But it is not creating any connection getting following error.
    javax.naming.NoInitialContextException:
    This is am trying from stand alone program..even tried in the web application by placing (<resource-ref>
    <res-ref-name>jdbc/OracleDS</res-ref-name>
    <res-type>javax.sql.DataSource</res-type>
    <res-auth>Container</res-auth>
    </resource-ref>) then also
    also same problem...
    please help me how to setup in data srouce and access it.
    Regards,
    Phani

    Hello,
    A connection pool is only the start, once you created a pool you need to create a datasource which uses this pool.
    This datasource will have a JNDI name, this is the name you want in your code:
    DataSource dd= (javax.sql.DataSource)ic.lookup("jdbc/<yourdatasourcejndiname>");The pool bame, is only a name. Its about the JNDI name for the datasource.
    Hope this helps
    -Anton

  • Problem creating connection pool to mysql database

    Please, do not ignore this message and help me, if you have any Idea
    I have Sun Java System Application Server 8.1 installed on my computer, I installed also MySQL Connector/J to access MySql Databases through JDBC
    But now when I try to create new connection pool, an error comes:
    Following parameter were used:
    Name: MYSQL1
    Resource Type: javax.sql.XADataSource
    Database Vendor: mysql
    Datasource Classname: com.mysql.jdbc.Driver
    serverName 192.168.0.152
    port 3306
    networkProtocol
    user testuser
    password ***
    databaseName test
    datasourceName
    After saving and then klicking on Ping button, following error comes: "An error has occurred.
    Operation 'pingConnectionPool' failed in 'resources' Config Mbean. Target exception message: com.mysql.jdbc.Driver"
    I checked the logs of MySql, there was no attempt to access given Database or MYSQL-server at all
    What Am I doing wrong? How can I create MySql connection under Sun Java System Application Server 8.1?
    Any help will be appreciated

    The driver is in right place
    Originally I placed him in wrong directory and got an error, indicationg, that Driver class is not found, but then I corrected it, The problem is in connection to database - it doesn't work.
    I tired to load the same driver into Netbeans and could easyli create a connection to database, but I get it not working ander Sun Application server

  • Facing problem with connectio pooling

    i am using the websphere app server. oracle 8i as DB.
    we have configured the datasource and jndi wiht min connections as 1 and max connections as 10.
    everything is working fine. but when we are giving more requests its keep on waiting for connections.
    how can we solve this problem.
    im very much thankful if any one give us a solution

    you are obviously draining the pool of connections somewhere. Check that you "close" the connection when you are done with it, this returns it to the pool so another thread can use it.

  • Limit datasource/pool to use by EJBs only

    In an enterprise application database access is done via entity ejbs. You
    normally don't want users to bypass the ejbs and use the datasource or
    connection pool directly.
    Is there some configuration option to restrict the use of datasources or
    connection pools to calls from within the server ?
    Thanks for your hints / ideas.
    Dirk

    Hi Dirk,
    You will need to set up corresponding ACLs and users to limit
    access to DataSources from cetain callers anly, and then set
    up security definitions for EJBs.
    The problem is, it's not true that access to DS is limited by EJBs
    only. You may what to acces it from let say servlets and jsps while
    impelementig fast lane reading, etc...
    Regards,
    Slava Imeshev
    "Dirk Weil" <[email protected]> wrote in message
    news:[email protected]..
    In an enterprise application database access is done via entity ejbs. You
    normally don't want users to bypass the ejbs and use the datasource or
    connection pool directly.
    Is there some configuration option to restrict the use of datasources or
    connection pools to calls from within the server ?
    Thanks for your hints / ideas.
    Dirk

Maybe you are looking for