Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to share connection Pool between war projects

Status
Not open for further replies.

outis

Programmer
Jun 20, 2001
21
MX
Hi, all I need to share a connection pool between four
war projects, can anybody helpme whith some informacion about do this. Thanks in advance

P.D. at the moment i create a connection pool per project
but i think this is not correct.
 
Hi, sedj, I'm used the oracle connection pooling
in a PoolConnection Class that I wrote:

package com.urbi.db;
import java.sql.SQLException;
import oracle.jdbc.pool.OracleConnectionCacheImpl;

public class ConnPool
{
private static oracle.jdbc.pool.OracleConnectionCacheImpl con;
private static String driverType;
private static String user;
...
public ConnPool()
{
}


public void setSID(String SID)
{
this.SID = SID;
}
...
public static void createConnectionPool() throws SQLException {
try {
con = new OracleConnectionCacheImpl();
con.setDriverType(driverType);
con.setUser(user);
con.setPassword(password);
con.setServerName(serverName);
con.setDatabaseName(databaseName);
con.setNetworkProtocol(networkProtocol);
con.setPortNumber(portNumber);
con.setMinLimit(minLimit);
con.setMaxLimit(maxLimit);
con.setCacheScheme(con.FIXED_WAIT_SCHEME);
System.out.println("ConnectionPoolOracle (Global) created...");


} catch (SQLException e) {
e.printStackTrace();
throw new SQLException("Failed connection to database");
}
}
}

But I read the link's that you send me, and I decide to use the Free Database Connection Pooling Software instead of default tomcat connection pool. otherwise if you recomend me the default tomcat connection pool ,
because we manage a huge number of transacion and i need to know what connection pool of those have better performance.
thanks in advance.


 
outis,

Of course I would recommend primrose - I wrote it :)

Let me know how you get on with it ...

--------------------------------------------------
Free Database Connection Pooling Software
 
sedj,

I put work whit primrose but i have this exception:

javax.naming.NameNotFoundException: Name webmap is not bound in this Context
at org.apache.naming.NamingContext.lookup(NamingContext.java:811)
at org.apache.naming.NamingContext.lookup(NamingContext.java:181)
at org.apache.naming.NamingContext.lookup(NamingContext.java:822)
at org.apache.naming.NamingContext.lookup(NamingContext.java:181)
at org.apache.naming.NamingContext.lookup(NamingContext.java:822)
at org.apache.naming.NamingContext.lookup(NamingContext.java:194)
at org.apache.naming.SelectorContext.lookup(SelectorContext.java:183)
at javax.naming.InitialContext.lookup(InitialContext.java:347)
at afc.reportes.beans.GraficaBarras.getData(GraficaBarras.java:105)
at afc.reportes.beans.GraficaGrupo.getPxmlFlujo(GraficaGrupo.java:50)
at afc.reportes.beans.GeneraGrafica.crearGrafica(GeneraGrafica.java:292)

at org.apache.jsp.irProspeccionCenter_jsp._jspService(irProspeccionCente
r_jsp.java:143)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:137)
...
 
outis,

Did you configure the poolConfig.properties file, and add the appropriate sections to server.xml as outlined in the installation guide ?

Are there any other errors - does primrose start up correctly ?

Maybe post your server.xml and poolConfig.properties file .

--------------------------------------------------
Free Database Connection Pooling Software
 
outis, on second thoughts if you contact me via :


and I can help you via email - as this forum is really specifically for tomcat problems, not as a forum for primrose.
I am in the process of setting up a forum on the primrose web site, but for now, I'll help you out via email.

Cheers

sedj.

--------------------------------------------------
Free Database Connection Pooling Software
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top