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.

Similar Messages

  • Problem using connection pooling on netbeans with mysql

    Hi everyone,
    I use Apache Tomcat server 5.0 and Mysql as back end. I have done connection pooling in tomcat server installation folder and everything works fine.But when I tried the same on netbeans I could not connect using connection pooling and it's throwing error as
    'Name jdbc is not bound in this Context'.
    When I checked the tomcat server in netbeans it says a version of tomcat 5.5.9(May be netbean's tomcat).So is there anything to be changed for server.xml of higher version tomcat above 5.0?
    I need your help to solve this issue.
    thanks in advance
    -Jegan

    Hi everyone,
    I use Apache Tomcat server 5.0 and Mysql as back end. I have done connection pooling in tomcat server installation folder and everything works fine.But when I tried the same on netbeans I could not connect using connection pooling and it's throwing error as
    'Name jdbc is not bound in this Context'.
    When I checked the tomcat server in netbeans it says a version of tomcat 5.5.9(May be netbean's tomcat).So is there anything to be changed for server.xml of higher version tomcat above 5.0?
    I need your help to solve this issue.
    thanks in advance
    -Jegan

  • Using Connection Pooling in a WLS 5.1.x - Cluster

    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 for CP?
              I have a WLS-Cluster with 2 instances and my webApp uses connection pooling.
              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-instance will
              be lost.
              How do I have to configure my cluster to work well with that stuff ?
              Thank a lot,
              Markus.
              

    Clustering with connection pools works fine in WLS 5.1. If connections are
              not being release, you have bugs in your code.
              When a connection is retrieved from a pool on one instance, a corresponding
              connection is NOT retrieved on another instance.
              Mike
              "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 for
              CP?
              >
              > I have a WLS-Cluster with 2 instances and my webApp uses connection
              pooling.
              > 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-instance
              will
              > be lost.
              > How do I have to configure my cluster to work well with that stuff ?
              >
              > Thank a lot,
              >
              > Markus.
              >
              >
              >
              

  • Problem in using connection pool in netbeans

    Hi,
    I am using Net Beans and Sun java application server and Derby as database.
    I have created data connnection and also configure JDBC resources (ie. DataResource and connectionPool).
    Now i want to use this connection pool in my class, I have create one DataConnection class and put this code
    private javax.sql.DataSource getMyDatabase () throws javax.naming.NamingException {
            javax.naming.Context c = new javax.naming.InitialContext();
            return (javax.sql.DataSource) c.lookup("java:comp/env/jdbc/myDatabase");
        }I got this code by right click and selecting Enterprise Resources->Use Data, But while running i got the exception
    javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial
    Plz tell me How can we overcome this exception and is there any other way do use connection pool.
    Thanks.

    Thanks bamkin-ov-lesta,
    DbConnectionBroker is good for servlet or other java application. If i use this class, it is like i am writing code for connection pool. I am using NetBeans and sun java application server which provide its default connection pool configuration and i want to use that only.
    And I am not getting which class name to be set in environment variable under what name in the following exception.
    javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial
    Help me plz.

  • IO Exception Broken Pipe ORA-17002 while using connection pooling

    Hi
    We are experiencing "broken pipe ORA-17002 error" when using connection pooling. This seems to be a common error when implementing connection pooling, but I didn't find any solution anywhere.
    we are using Oracle 9i 9.2.0.1 JDBC thin driver
    Our database is Oracle 8.1.7 running on HP Unix
    The middle tier(Tomcat) runs on RedHat linux server
    We are using JDK1.3
    It seems the connections automatically get stale or bad after certain period of time.Iam checking to see if the connection is closed, before giving the connection from the pool to the appilcation.It seems its still open.But when I start using the connection to open a callable statement or setAutocommit to false, it says Broken pipe or No more data to read from the socket.
    We are implementing our own connection pooling class(we experimented with OracleConnectionCacheImpl but it too gave the same errors).
    Does anybody have a solution for this problem??
    Is there a workaround for this?I would like to know how connection pooling is implemented in most of the applications that use oracle database?Or do we need to explicitly test the connection before using it, and reopen a connection if that is bad??
    Thanks
    Anil

    kalle
    Thank you very much for your advice!!!
    Like you said, I started to check whether the connections are fine before giving them from the pool.I am executing a simple "select 'anil' from dual" and if its fine only then I return the connection. So far it seems to be fine. Also I am reopening the connections(closing the old ones and opening new connections) after every 12 hours.
    As far as the JDBC driver is concerned, I already tried with Oracle 8i driver, it gave the same problems. I read that 9i driver might solve this problem, so I changed to the latest 9i driver (classes12_g.zip).
    Sometimes before(before I started checking whether the connection is good )the application used to hang up at the point where I am issuing setAutoCommit(false).It never comes out from that statement.Is this something to do with theconnections being closed?
    What I am afraid is, will the appilation get hung up even after I check the connection with select query and then issue autocommit(false)??
    Or will it hang up while I check with a select query??
    As long as it doesn't hung up, I am fine. Because i am cathching the exceptions.
    Thanks In ADVANCE
    Anil

  • ORA-22990 ( Cannot span lob... ) while using connection pooling...

    Hi all, I am maintaining a web site that has lots of requests ( about 10 requests a second ) to an Oracle table that has a BLOB field. Those requests create new blobs, updates them and reads them... My program worked fine until I started using connection pooling ( Before that, I used a single connection that was initialized at startup ). Although I had to synchronized the methods that interact with blob field, everything worked great. So now, to optimize my site, I want to use connection pooling so that even if my methods are synchonized on the connection object, there will be more than one connection available so it will not affect performance.
    So once I introduced my connection pooling system with the oracle.jdbc.pool.OracleConnectionCacheImpl class, I started getting ORA-22990 ( Cannot span lob objects... ). I get the error on the flush() method when I try to write the blob to the database. Here is my function that writes a row in the databse.
      private synchronized void writeSession(CapSession pSession) throws Exception
            javax.sql.PooledConnection pc = pool.getPooledConnection();
            Connection conn = pc.getConnection();
            CallableStatement stmt=conn.prepareCall(writeObjSQL);
            stmt.setString(1,pSession.getSessionId()+pSession.getPassword());
            stmt.setLong(2,pSession.getLastAccess());
            stmt.setLong(3,pSession.getTimeout());
            stmt.registerOutParameter(4,java.sql.Types.BLOB);
            stmt.executeUpdate();
            oracle.sql.BLOB blob=(BLOB)stmt.getBlob(4);
            OutputStream os=blob.getBinaryOutputStream();
            ObjectOutputStream oop=new ObjectOutputStream(os);
            oop.writeObject(pSession);
            oop.flush();
            oop.close();
            os.close();
            stmt.close();
            conn.commit();
            conn.close();
            pc.close();
      } If anyone could help me, I would deeply appreciate it!
    Thank you for your time.

    kalle
    Thank you very much for your advice!!!
    Like you said, I started to check whether the connections are fine before giving them from the pool.I am executing a simple "select 'anil' from dual" and if its fine only then I return the connection. So far it seems to be fine. Also I am reopening the connections(closing the old ones and opening new connections) after every 12 hours.
    As far as the JDBC driver is concerned, I already tried with Oracle 8i driver, it gave the same problems. I read that 9i driver might solve this problem, so I changed to the latest 9i driver (classes12_g.zip).
    Sometimes before(before I started checking whether the connection is good )the application used to hang up at the point where I am issuing setAutoCommit(false).It never comes out from that statement.Is this something to do with theconnections being closed?
    What I am afraid is, will the appilation get hung up even after I check the connection with select query and then issue autocommit(false)??
    Or will it hang up while I check with a select query??
    As long as it doesn't hung up, I am fine. Because i am cathching the exceptions.
    Thanks In ADVANCE
    Anil

  • How to access database from applet using connection pooling.

    Hi,
    I am using tomcat 4.1, JRE 1.4.2_10, MySQL 5.0, and IE 6.0. I can access the database using connection pooling from JSP without problems. But, if I try to acess from the applet, I get the following exception (related to JNDI.):
    javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial
    at javax.naming.spi.NamingManager.getInitialContext(Unknown Source)
    at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source)
    at javax.naming.InitialContext.getURLOrDefaultInitCtx(Unknown Source)
    at javax.naming.InitialContext.lookup(Unknown Source)
    I know what this acception means, but I don't know how to fix it. I set up connection pooling in my Tomcat 4.1 that talks to MySQL 5.0. As I said, when I access from jsp, JNDI works. But, applet complains. Please help. In my applet, the following code accesses the database:
    ArrayList toolTipData =
          access.getToolTipData (projectName,interfac);This is the snipet of my Access class:
    public ArrayList getToolTipData (String projectName, String interfac) {
        System.out.println("In getToolTipData");
        ArrayList toolTipData = new ArrayList();
       try{
        Context ctx = new InitialContext();
        if(ctx == null )
            throw new Exception("No Context");
        DataSource ds = (DataSource)ctx.lookup("java:comp/env/jdbc/interfacesDB");
        if (ds != null) {
          Connection conn = ds.getConnection();
          if(conn != null)  {
              Statement s = conn.createStatement();
              //For some reason paramtized queries don't work, so I am forced
              //to this in slighly less eficient way.
              ResultSet rst = s.executeQuery("select * from interfaces");
              while (rst.next()) {
                 if (rst.getString("Project_Name").equals(projectName) &&
                     rst.getString("Interface").equals(interfac)) {
                   System.out.println("getToolTipData: ITG #" + rst.getString("ITG"));
                   toolTipData.add("ITG #: " + rst.getString("ITG"));
                   toolTipData.add("SPNE Prime Name: " +
                                   rst.getString("SPNE_Prime_Name"));
                   toolTipData.add("PD Prime Name: " +
                                   rst.getString("PD_Prime_Name"));
                   toolTipData.add("IT Prime Name: " +
                                   rst.getString("IT_Prime_Name"));
                   toolTipData.add("MLC Priority: " +
                                   rst.getString("MLC_Priority"));
                   toolTipData.add("Gary's Prime: " + rst.getString("Garys_Prime"));
                   toolTipData.add("QA Prime: " + rst.getString("QA_Prime"));
                   toolTipData.add("Brief Description: " +
                                   rst.getString("Brief_Description"));
                   toolTipData.add("Project_Status: " +
                                   rst.getString("Project_Status"));
              conn.close();
      }catch(Exception e) {
        e.printStackTrace();
      return toolTipData;
    ....

    The jsp runs on the server, whereas the applet runs on the client so
    you must package with your applet any jndi implementation specific classes
    and
    Properties props = new Properties();
    props.setProperty("java.naming.factory.initial", "org.jnp.interfaces.NamingContextFactory" );
    props.setProperty("java.naming.provider.url", "url:1099");
    Context ctx = new InitialContext(props);
    Object ref = ctx.lookup("...");

  • Calling a RFC using connection pool

    Can I use connection pool to call a RFC from my R3? I'm using SAP Enterprise Connector but I don't want to pass user/password hardcoded.
    Thanks in advance.

    Hi Kiran,
    Yes I used SAP JRA and it works.
    You need JRA deployed and configured on WAS, your basis guy can do it for you. The next step is download this PDF  <a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/ad09cd07-0a01-0010-93a9-933e247d3ba4">Accessing BAPIs Using the SAP Java Resource Adapter</a>.
    Follow this document, it's very easy to do so.

  • How do i use Connection pool in JSP pages

    Hey everyone,
    I am using a connection pool in my web application. I am using DbConnectionBroker from Javaexchange.com. It has a class that creates a connection pool available for the servlets. I am trying to figure out that how to use connection pool within the JSP pages if I want to connect to the database. In the servlets i am using DBConnectionBroker pool = (DbConnectionBroker) getServletContext().getAttribute("dbPool") to get database connection. How Can i use this in JSP page to get a db connection.
    Thanks

    If the reference to the connection pool is already stored as an ServletContex attribute, try:
    <jsp:useBean id="dbPool" scope="application" class="com.javaexchange.dbConnectionBroker" />
    <%
    Connection con = dbPool.getConnection();
    %>

  • How to use Connection Pool in ADF ear file creaion from jDev 10.1.3

    Hi,
    We are developing big application in ADF with 10 different modules. We are creating ear file with data source setting.
    How to use connection pool while creating ear file from jDev. Connection pool is alreday created in Application Server 10g.
    What all the setting we need do to make use of connection pool while creating ear file jDev.
    Thanks

    User,
    If you are using ADF Business Components, you can right-click each application module, select "configurations" and edit the configuration you are using. On the initial page of the configuration dialog, you can specify to use either a JDBC URL or a Datasource - you just need to choose Datasource and then provide the name by which to access it.
    John

  • How to use connection pool of datasource to make applications run faster?

    Hi, erveryone
    I prepare to implement a servlet that access database and do sync with client.
    When I access database, I would like to configure a datasource in weblogic and use connection pool.
    In order to make servlet application run significantly faster, my servet how to use connection poo is much moreresonable?
    For example, my servlet has many times database access. Is it true that geting and close a connection whenever
    one time database access finished?
    If from the servlet begins, the db connection is hold till servlet finalize. Will the solution affect the servlet performance? Is there any official document to introduce connection pool program? I search some documents.
    <The Java EE 6Tutorial> introduce some simple intruduction about connection pool.

    1. Use WebLogic Servers Data Source for Database Connections.
    2. Open and close the connections where you need it. Dont open it in begin and close in finalise. That is bad practice.
    3. Even when you invoke Connection.close () webLogic will not close the connection. it will commit the transaction and return it back to the pool rather than physically closing the DB connection.
    4. You can tune data source for minimum, maximum and increments of connections that you need based on your application requirement.

  • How To Use Connection Pooling in Struts.

    Can Somebody have the idea how to use connection pooling. i want to use jakarta commons dbcp, pool.
    using these packages how can i implement the connection pooling for my web application. If Anybody have some idea plz contect me.
    If Somebody have sample code plz send.
    Thks in Advance,

    Read the documentation...?

  • Repost-Best way of using connection pooling

    I am reposting this, seems best suitable in this category.
    I am using Eclipse 3.1 along with Tomcat 5.0, MySQL 4.1, J2EE1.4. I could set up the JNDI Dataresource connection pooling and tested with small test servlet. Now thinking of having common methods for getting connection / closing / commiting ....etc.
    I wrote following. [Please let me know whether it is correct way of doing it - as i am not very sure]
    package common;
    import java.sql.*;
    import javax.sql.*;
    import javax.naming.*;
    import org.apache.log4j.Logger;
    public final class connectionManager {
         private static Logger logger = Logger.getLogger(common.connectionManager.class);
         public connectionManager() {}
         public static Connection getConn () throws NamingException, SQLException
    //JNDI DataSource connection pooling
              Connection conn = null;
              try{
                   Context initContext = new InitialContext();
                   Context envContext  = (Context)initContext.lookup("java:/comp/env");
                   DataSource ds = (DataSource)envContext.lookup("jdbc/TQ3DB");
                   conn = ds.getConnection();
              }catch (NamingException ne) {
                  new GlobalExceptionHandler(logger, ne);
                   conn = null;
                   throw new NamingException();
              }catch (SQLException e){
                   new GlobalExceptionHandler(logger, e);
                   conn = null;
                   throw new SQLException();
              return conn;
           }//getConnection
         public static void commit(Connection conn) throws SQLException
              conn.commit();
         public static void rollback(Connection conn) throws SQLException
              conn.rollback();
           public static void setAutoCommit(Connection conn, boolean autoCommit)
                                        throws SQLException
                conn.setAutoCommit(autoCommit );
         public static void closeConnection(Connection conn) throws SQLException{
              if (conn != null) {
                   conn.close();
                   conn = null;
         }//closeConnection
         public static void closeResources(ResultSet oRS, PreparedStatement pstmt) throws SQLException
              if (oRS != null) {
                   oRS.close();
                   oRS = null;
              if (pstmt != null) {
                        pstmt.close();
                        pstmt = null;
         } // closeResources
    }//ConnectionManager
    I am having a login form which submits user name and password. I am checking this against the database. Following is the servlet to do that.
    package login;
    import java.io.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.sql.*;
    import common.*;
    public class loginServlet extends HttpServlet {
         public void doGet(HttpServletRequest request, HttpServletResponse response)
                   throws ServletException, IOException {          
              doPost(request, response);
         }//doGet
         public void doPost(HttpServletRequest request, HttpServletResponse response)
                   throws ServletException,IOException{
              String userId = request.getParameter("userId");
              String password = request.getParameter("password");
              ** call a method to validate the password which will return the
              ** User Name for authorized users and null string for un-authorised.
              String uName = validateUser(userId, password);
              //if uName is null .. user is not authorized.
              if (uName == null){
                   //redirect to jsp page with error message
                  RequestDispatcher rd =
                       getServletContext().getRequestDispatcher("/jsps/mainmenu.jsp");
                  if (rd != null){
                       rd.forward(request,response);
              else{
                   // the user is valid - create a seesion for this user.
                   HttpSession userSession = request.getSession(true);
                   // put the user name session variable.
                   userSession.setAttribute("userName", uName);
                   //redirect to Main menu page
                   RequestDispatcher rd =
                        getServletContext().getRequestDispatcher("/jsps/mainmenu.jsp");
                   if (rd != null){
                        rd.forward(request,response);
         }// end of doPost
         private String validateUser(String userId, String password)
                   throws SQLException{
              String returnVal = null;
              connectionManager cm = new connectionManager();
              Connection conn = null;
              PreparedStatement pstmt = null;
              ResultSet oRS = null;
              try{
                   //get the connection
                   conn = cm.getConn ();
                   //get records from user table for this user id and password
                   String sQry = "SELECT  user_login FROM user "
                             + "where user_login = ? AND user_pwd = ? ";
                   pstmt = conn.prepareStatement(sQry);
                   pstmt.setString(1, userId);
                   pstmt.setString(2, password);
                   oRS = pstmt.executeQuery();
                   //check for record
                   if (oRS.next()) {
                        returnVal = oRS.getString("user_login");
                   }else {returnVal = null;}
                 }catch (Exception e){            
                      returnVal = null;
              }finally{
                   cm.closeResources(oRS, pstmt);
                   cm.closeConnection(conn);
              return returnVal;
    }// end of servlet class
    But i am unable to compile it and i am also getting lots of warnings.
    I am getting error at line
    1)String uName = validateUser(userId, password);
    Unhandled exception type SQLException loginServlet.java TQ3/WEB-INF/src/login line
    Following warnings:
    2)For loginServlet Declaration
    The serializable class DBTest does not declare a static final serialVersionUID field of type long loginServlet.java
    3)The static method getConn() from the type connectionManager should be accessed in a static way
    4)The static method closeResources(ResultSet, PreparedStatement) from the type connectionManager should be accessed in a static way
    5)The static method closeConnection(Connection) from the type connectionManager should be accessed in a static way
    Definitely I am doing it wrong but exactly where? I am having very strong doubt the way i am using connections is not the correct way. Pls help me.
    regards
    Manisha

    I am in a search of best way to use connection pooling. Initially was using simple JDBC call, then modified to JNDI, afterwards tried to have common class. Later came accross the idea of Singleton/Static. I wanted to have a common class which will handle all connection related issues and at the same time give good performance.
    With due respect to all Java Gurus: i got all from web articles/tutorials/java forum etc. There is a long discussion regarding Singlet vs static in this forum. But finally got confused and could not figure out in my case which method shall i make use of, so tried both.
    What I want is somebody pointing out flwas inside my 2 code snippets and guide me about which method shall i adopt in future.
    Static way:
    package common;
    import java.sql.Connection;
    import javax.sql.DataSource;
    import java.sql.SQLException;
    import javax.naming.InitialContext;
    import javax.naming.NamingException;
    public final class ConnectionManager_Static {
         private static InitialContext ctx = null;
         private static DataSource ds = null;
         public ConnectionManager_Static(){     }
         //as the staic method is updating static var i am synchonizing it
         private static synchronized void getDatasource () throws NamingException, SQLException
              if (ds == null){
                   ctx = new InitialContext();
                   ds = (DataSource)ctx.lookup("java:comp/env/jdbc/MySql");
         //making getConnection() also static as it is not instance specific     
         public static Connection getConnection () throws NamingException, SQLException, Exception
              Connection conn = null;
              try{     
                   if (ds == null) {getDatasource ();}
                   if (ds != null) {
                        conn = ds.getConnection();                 
              }catch (Exception e){
                   throw new Exception("From ConnectionManager_Static",e);
              return conn;
           }//getConnection
    }Singleton:
    package common;
    import java.sql.*;
    import javax.sql.*;
    import javax.naming.*;
    public final class ConnectionManager_Singleton {
             private static ConnectionManager_Singleton INSTANCE = null;
              private DataSource datasource = null;
              // Private constructor for singleton pattern
             private ConnectionManager_Singleton() throws NamingException{
                   Context ctx = new InitialContext();
                   datasource = (DataSource)ctx.lookup("java:comp/env/jdbc/MySql");
             //synchronized creator for  multi-threading issues
             //another if check to avoid multiple instantiation
             private synchronized static void createInstance() throws NamingException{
                 if (INSTANCE == null) {
                     INSTANCE = new ConnectionManager_Singleton();
             public static ConnectionManager_Singleton getInstance() throws NamingException {
                 if (INSTANCE == null) createInstance();
                 return INSTANCE;
              public Connection getConnection() throws Exception
                   Connection con = null;
                   try{
                        con = datasource.getConnection();
                   }catch(Exception e){
                        throw new Exception("From connection manager singleton ", e);
                   return con;
    }Sorry, It's becoming long.
    Thanaks in advance,
    Manisha

  • Strange behaviour when using connection pooling with proxy authentication

    All
    I have developed an ASP.NET 1.1 Web application that uses ODP.NET 9.2.0.4 accessing Oracle Database 8i (which is to be upgraded to 10g in the coming months). I have enabled connection pooling and implemented proxy authentication.
    I am observing a strange behaviour in the live environment. If two users (User 1 and User 2) are executing SQL statements at the same time (concurrent threads in IIS), the following is occurring:
    * User 1 opens a new connection, executes a SELECT statement, and closes this connection. The audit log, which uses the USER function, shows User 1 executed this statement.
    * User 2 opens the same connection (before it is released to the connection pool?), excutes an INSERT statement, and closes this connection. The audit log shows User 1, not User 2, executed this statement.
    Is this a known issue when using connection pooling with proxy authentication? I appreciate your help.
    Regards,
    Chris

    Hi Chris,
    I tried to reproduce your complaint, but was unable to. I didnt use auditting however, just a series of "select user from dual" with proxy authentication. You might want to see if you can put together a small complete testcase for this and open a sr with support.
    Cheers
    Greg

  • How to use Connection Pool on WLS 10.0 MP2?

    Hello there!
    I have a WS and i use ibatis to talk iwth a Oracle DB, but i have a requirement to use connection pool by wls and i dont where should i do this to my application.
    I just have this method to the connection
    private static void initDb() throws IOException, SQLException {
              log.info("Conectando a bd");
              String sqlMapResource = "com/app/activacion/db/sqlMapConfig.xml";
              Reader reader = Resources.getResourceAsReader(sqlMapResource);
              SqlMapClient sqlMapClientIbatis =
                   SqlMapClientBuilder.buildSqlMapClient(reader,properties);
              List<String> n = (List<String>) sqlMapClientIbatis.queryForList("test");
              log.debug("n: " + n);
              log.info("Conexion a BD realizada.");
    And my sqlMapConfig.xml is
    <sqlMapConfig>
         <settings cacheModelsEnabled="true"
              enhancementEnabled="true"
              lazyLoadingEnabled="true"
              maxRequests="320"
              maxSessions="128"
              maxTransactions="32"/>
         <transactionManager type="JDBC">
              <dataSource type="DBCP">
                   <property name="driverClassName" value="oracle.jdbc.OracleDriver" />
                   <property name="url" value="${db.connectionURL}" />
    <property name="username" value="${db.username}" />
    <property name="password" value="${db.password}" />
              </dataSource>
         </transactionManager>
         <sqlMap resource="com/epcs/facturacionpostpago/activacionbb/db/statements.xml" />
    </sqlMapConfig>
    Can u give me an advice to set the connection pool please?
    Thanx in advance!
    Edited by: mgaldames on 02-jun-2010 10:54

    According to a google hit, it looks like you should be able to do something like this:
    http://www.j2eegeek.com/blog/2005/01/31/ibatis-where-have-you-been-all-my-life/
    First, configure a datasource in the wls console, the example uses:
    jdbc/jpetstoreDS
    as the JNDI name.
    Then it looks like the following syntax works for the mapping that refers to that datasource, keep in mind your servername/port may be different.
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE sqlMapConfig PUBLIC "-//iBATIS.com//DTD SQL Map Config 2.0//EN" "http://www.ibatis.com/dtd/sql-map-config-2.dtd"?>
    <sqlmapconfig>
    <settings cacheModelsEnabled="false" enhancementEnabled=" true" lazyLoadingEnabled="true"
    maxRequests="32" maxSessions="100" maxTransactions="100" useStatementNamespaces="false"/>
    <transactionmanager type="JDBC">
    <datasource type="JNDI">
    <property name="context.java.naming.factory.initial" value="weblogic.jndi.WLInitialContextFactory"/>
    <property name="context.java.naming.provider.url" value="t3://localhost:7001"/>
    <property name="DataSource" value="jdbc/jpetstoreDS"/>
    </datasource>
    </transactionmanager>
    <sqlmap resource="com/j2eegeek/ibatis/dao/maps/Account.xml"/>
    </sqlmapconfig>

Maybe you are looking for

  • Macbook Pro won't SD card :(

    I have tried absolutely everything! I don't know what happened as this has always worked for me, I am using Sandisk Ultra 32GB Micro SD card with an adapter and the Mac doesn't recognise it anywhere, even Disk Utility. I have tried connecting my came

  • PS CC 2014 requires less than what my laptop is capable of, but still says "not enough ram". Help?

    I have an Acer Aspire with Windows 7. I downloaded Photoshop CC 2014, which said it's requirements were less than what my laptop has, plus I upgraded the ram to 8 already. If I go to lighting, it opens, stalls, then says not enough ram, and another m

  • Simple Query with subquery returns the 'wrong' result

    DB version: 11.2 We created about 27 schemas in the last 4 days. The below query confirms that. SQL > select username, created from dba_users where created > sysdate-4; USERNAME                       CREATED MANHSMPTOM_DEV_01              12 Jul 2012

  • When connecting to database in SQL* plus giving Error

    hi, I am using Oracle 10g. My problem is when i connecting to database in Server through SQL * Plus giving the Error: ORA-12514: TNS:listerner does not currently know of service requested in connect descriptor. Why this is happening i don't know. I c

  • Managing components

    Hi Gurus, Issue is like this. My client has procured one equipment eg:say turbine which is having material code and they procured through PO. Now according to them the turbine will have sub components(they are not mainatining any item codes ) which w