Connection pool running out of connections
Hi all,
I am using Oracle's connection pool implementation:
OracleConnectionPoolDataSource dbConnection;
OracleConnectionCacheImpl connectionPool;
and tomcat 3 and 4. Sometimes on Tomcat 4 (Linux) I see that the connections are not being reutilized and therefore I run out of free connections. The same application runs fine on NT and Tomcat 3 and 4. I checked all my methods and all have a close(connection) in my finally{} and besides this the problem only happens once in a while and the program is using the same methods all the time. Anybody has a clue about what could the issue be?
Thanks,
A.
have u tried setCacheScheme?
Similar Messages
-
The connection pool DIMT_DB is running out of connections
I am facing an issue, the process instances created in activity are not getting routed to my work item. I found the following exception logged in engine DB at the time process instance was created,
The connection pool DIMT_DB is running out of connections ( 100 % of the pool is in use).
It is recommendable to expand the size through the Process Administrator.
can anyone provide me a solution to this issue?
the maximum pool size is 10. should it be increased?
does this issue occur when database connection is not closed properly?Can anyone please share your ideas?
Thanks, -
Re:Running out of connection pools one server
Hi,
We are running out of connection pools on one weblogic server only everytime in a 2 node cluster.
But the sessions are very less in the database when we faced the issue.
But this doesn't happen all the time it happens once in a month.
our configuration
<jdbc-connection-pool-params>
<initial-capacity>10</initial-capacity>
<max-capacity>150</max-capacity>
<capacity-increment>5</capacity-increment>
<shrink-frequency-seconds>300</shrink-frequency-seconds>
<connection-creation-retry-frequency-seconds>300</connection-creation-retry-frequency-seconds>
<test-connections-on-reserve>true</test-connections-on-reserve>
<Sep 27, 2010 4:14:11 PM EDT> <Info> <JDBC> <BEA-001128> <Connection for pool "kdbDS" closed.>
<Sep 27, 2010 4:14:11 PM EDT> <Info> <Common> <BEA-000627> <Reached maximum capacity of pool "kdbDS", making "0" new resource instances instead of "5".>
2010-09-27 16:14:11,0722, SEVERE: kdb - com.cvc.kdb.appcontext.AppContext(logSevere)DynamicContent: SearchDynamicContentManager.getDynamicContent() evaluating template id=2005
java.net.SocketException: Broken pipe
2010-09-27 16:14:11,0724, INFO: kdb - com.cvc.kdb.appcontext.AppContext(logInfo)User session established: nkpLMg7TKQTz3vllmYKKdXyf7lFcLZBvtjnppnJdGQT97TssnLz2!1568862676!1563294179!1285618451720
<Sep 27, 2010 4:14:11 PM EDT> <Info> <Common> <BEA-000627> <Reached maximum capacity of pool "kdbDS", making "0" new resource instances instead of "5".>
<Sep 27, 2010 4:14:11 PM EDT> <Info> <Common> <BEA-000627> <Reached maximum capacity of pool "kdbDS", making "0" new resource instances instead of "5".>
2010-09-27 16:14:11,0725, SEVERE: kdb - com.cvc.kdb.appcontext.AppContext(logSevere) ConceptGuidedSearch.jsp: java.net.SocketException: Broken pipe
java.net.SocketException: Broken pipe
at java.net.SocketOutputStream.socketWrite0(Native Method)
at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:92)
at java.net.SocketOutputStream.write(SocketOutputStream.java:136)
at weblogic.servlet.internal.ChunkOutput.writeChunkTransfer(ChunkOutput.java:525)
at weblogic.servlet.internal.ChunkOutput.writeChunks(ChunkOutput.java:504)
at weblogic.servlet.internal.ChunkOutput.flush(ChunkOutput.java:382)
at weblogic.servlet.internal.ChunkOutput.checkForFlush(ChunkOutput.java:469)
at weblogic.servlet.internal.ChunkOutput.print(ChunkOutput.java:344)
at weblogic.servlet.internal.ChunkOutputWrapper.print(ChunkOutputWrapper.java:146)
at weblogic.servlet.jsp.JspWriterImpl.print(JspWriterImpl.java:151)
at weblogic.servlet.jsp.JspWriterImpl.println(JspWriterImpl.java:205)
at jsp_servlet._jsp._search._cda.__conceptguidedsearch._jspService(__conceptguidedsearch.java:411)
at weblogic.servlet.jsp.JspBase.service(JspBase.java:34)
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:283)
at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
at com.cvc.kdb.filter.CookieFilter.doFilter(CookieFilter.java:73)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3242)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2010)
at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:1916)
at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1366)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:181)
<Sep 27, 2010 4:14:11 PM EDT> <Info> <Common> <BEA-000627> <Reached maximum capacity of pool "kdbDS", making "0" new resource instances instead of "5".>
<Sep 27, 2010 4:14:11 PM EDT> <Info> <JDBC> <BEA-001128> <Connection for pool "kdbDS" closed.>
<Sep 27, 2010 4:14:11 PM EDT> <Info> <Common> <BEA-000627> <Reached maximum capacity of pool "kdbDS", making "0" new resource instances instead of "5".>
<Sep 27, 2010 4:14:11 PM EDT> <Notice> <Stdout> <000000> <7808-515177-2>
<Sep 27, 2010 4:14:11 PM EDT> <Notice> <Stdout> <000000> <1>
2010-09-27 16:14:11,0732, SEVERE: kdb - com.cvc.kdb.appcontext.AppContext(logSevere)no cookie:notoriousdbp wrote:
You'd still be renting the line too, which is handy because it means BT still own it.
Well if I have to still pay the line rental, I will take the free number that comes with it.. Thankyou.
toekneem
http://www.no2nuisancecalls.net
(EASBF) -
Connection leaks and application is running out of connection
Hi All,
We have configured the SQL Database external resource for OBPM specific connection pool. All the business processes are using the Fuego.Sql package for the data base transaction calls. I have no clue how this package is managing the database connections. If more than 25 users perform concurrent testing, the application is running out of connections. Connection pool configuration details as below.
Maximum Pool Size : 500
Maximum connections per user : 50
Minimun Pool Size : 0
Connection Idle Time (mins). : 5
Maximum Opened Cursors : 1000
Please share your thoughts on how I can track and fix this issue. Also please let me know the answers below.
1. Is there any way to find out the stats about the connection pool
2. If I configure the remote JDBC that points to J2EE datasource, would that fix this issue.
I appreciate your help.
Thanks,Can anyone please share your ideas?
Thanks, -
Running out of connections...
Hello,
I think I'm having the same problem ..
Did you solve it ? How ?
Thanks a lot.
Franco
Francesco Costa
BEA Systems Italia
[email protected]
Phone +39 02 3327 3000
Mobile + 39 335 1246931
Fax +39 02 3327 3001
"Gerhard Henning" <[email protected]> ha scritto nel messaggio
news:[email protected]...
>
Hi,
we seem to have a similar problem. Can you please tell me,
which service pack solves the problem.
We are using SP8 but the problem seems to be still there!
Thanks
Gerhard
Joseph Weinstein <[email protected]> wrote:
Gene Chuang wrote:
Hi Joe,
Good news; bug ISOLATED and FIXED! First off, I was able to determinethis bug only manifests if
we are running clustered apps. under a single app server, this bugdoes not appear, and under
clustered app this bug always appears.
Furthermore, I appologize if I may have lead you on a wild goosechasewith all the subsequent
patches you sent me. As it turns out, when I received each patch Ihanded it off to our tester, who
applied the patch and probably only bounced a node in our server
cluster
before testing, hence
getting negative results. Today I applied your latest patch,
clean-bounced
all the nodes, and the
bug disappeared! Thanks Joe!
Now the 2 questions of the day:
1) Is your latest patch production worthy? Can I apply it on ourlive site?
Yes.
2) If not, when's the next service pack coming out with this fix?It will be in future service packs.
Joe
Gene
"Joseph Weinstein" <[email protected]> wrote in message
news:[email protected]...
>>>>
>>>>
Gene Chuang wrote:
Hi Joe,
We tried it and found the same exception raised, except for this
time it took a lot longer to
bug
out; the server hung for almost 2 minutes before dumping the
following.
However I was just
informed by another developer that we may have a recursive bugon our side, and that we are
doing a
non-terminating db search. Perhaps this is causing this
out-of-resource
allocation bug, i.e.
our
bug exposed your bug! I'm sure once we fix our recursion bug we
won't see this again, but maybe
something should also be done on your side that'll handle thismore gracefully...
I'll let you know what happens once we fix our bug; thanks forthe help!
DO let me know. In fact, please use the attached jar (in place ofall the others:-)
because the line ResourceAllocator.java:561 is not executable code.There may be a
JVM problem... I'm fairly sure there's no way our code can causean NPE in this
area...
Joe
javax.ejb.FinderException: Couldn't build CallableStatement from
JDBCCommandImpl:
java.sql.SQLException: Exception raised by connection pool
:java.lang.NullPointerException
atweblogic.common.internal.ResourceAllocator.reserve(ResourceAllocator.java:56
1)
atweblogic.common.internal.ResourceAllocator.reserve(ResourceAllocator.java:55
5)
atweblogic.common.internal.ResourceAllocator.reserve(ResourceAllocator.java:50
2)
atweblogic.jdbc.common.internal.ConnectionPool.reserve(ConnectionPool.java:172
atweblogic.jdbc.common.internal.ConnectionPool.reserveWaitSecs(ConnectionPool.
java:145)
atweblogic.jdbcbase.jts.Connection.openConnectionIfNecessary(Connection.java:5
87)
atweblogic.jdbcbase.jts.Connection.prepareCall(Connection.java:159)
atweblogic.jdbc20.rmi.internal.ConnectionImpl.prepareCall(ConnectionImpl.java:
89)
atweblogic.jdbc20.rmi.SerialConnection.prepareCall(SerialConnection.java:71)
atcom.kiko.db.JDBCConnection.getCallableStatement(JDBCConnection.java:158)
>>>>>
Gene Chuang
Join Kiko.com!
"Joseph Weinstein" <[email protected]> wrote in message
news:[email protected]...
>>>>>>
>>>>>>
Gene Chuang wrote:
Hi Joe,
We were finally able to consistently replicate the
ResourceAllocator.reserve()
stacktrace,
although
from a slightly different route. I tried your jar, and now
have a slightly different
exception:
Hi Gene. Thank you for your patience. Here's one last jar file.
Ditch the previous one. I appreciate your energy and willingness
to help. Let me know,
Joe
javax.ejb.EJBException: Failed to select row 0: Exception
raised
by connection pool
:java.lang.NullPointerException
at
weblogic.common.internal.ResourceAllocator.reserve(ResourceAllocator.java:56
1)
atweblogic.common.internal.ResourceAllocator.reserve(ResourceAllocator.java:55
5)
atweblogic.common.internal.ResourceAllocator.reserve(ResourceAllocator.java:50
2)
atweblogic.jdbc.common.internal.ConnectionPool.reserve(ConnectionPool.java:172
atweblogic.jdbc.common.internal.ConnectionPool.reserveWaitSecs(ConnectionPool.
java:145)
atweblogic.jdbcbase.jts.Connection.openConnectionIfNecessary(Connection.java:5
87)
atweblogic.jdbcbase.jts.Connection.prepareStatement(Connection.java:135)
atweblogic.jdbc20.rmi.internal.ConnectionImpl.prepareStatement(ConnectionImpl.
java:80)
atweblogic.jdbc20.rmi.SerialConnection.prepareStatement(SerialConnection.java:
55)
atcom.kiko.db.JDBCConnection.getPreparedStatement(JDBCConnection.java:141)
>>>>>>>
Gene Chuang
Join Kiko.com!
"Joseph Weinstein" <[email protected]> wrote in message
news:[email protected]...
Hi Gene.
Would you put the attached jar to the head of your
weblogic.classpath,
and let me know if this fixes the problem? thanks,
Joe
Gene Chuang wrote:
WL 5.1 sp 6, running on Solaris 2.7 over Oracle 8i
Gene Chuang
Join Kiko.com!
"Joseph Weinstein" <[email protected]> wrote in message
news:[email protected]...
Gene Chuang wrote:
Hi Joe,
Now I'm getting this slightly different stack trace...
do u think it's the same
"out of
connection"
error, or something else?It's something else. What version of the product is this?
Joe
Couldn't build PreparedStatement from JDBCCommandImpl:
java.sql.SQLException:
Exception
raised
by
connection pool :java.lang.NullPointerException
at
weblogic.common.internal.ResourceAllocator.reserve(ResourceAllocator.java:56
1)
atweblogic.common.internal.ResourceAllocator.reserve(ResourceAllocator.java:55
5)
atweblogic.common.internal.ResourceAllocator.reserve(ResourceAllocator.java:50
2)
atweblogic.jdbc.common.internal.ConnectionPool.reserve(ConnectionPool.java:172
atweblogic.jdbc.common.internal.ConnectionPool.reserveWaitSecs(ConnectionPool.
java:145)
atweblogic.jdbcbase.jts.Connection.openConnectionIfNecessary(Connection.java:5
87)
atweblogic.jdbcbase.jts.Connection.prepareStatement(Connection.java:135)
atweblogic.jdbc20.rmi.internal.ConnectionImpl.prepareStatement(ConnectionImpl.
java:80)
atweblogic.jdbc20.rmi.SerialConnection.prepareStatement(SerialConnection.java:
55)
>>>>>>>>>>>
Gene Chuang
Join Kiko.com!
"Joseph Weinstein" <[email protected]> wrote in message
news:[email protected]...
Hi.
The server won't let an EJB wait indefinitely for
a connection to become
available in a pool. All the while it waits, it iscommandeering one
of the fixed number of execute-threads, doing nothingwhile the thread
could possibly run another task which already hasit's pool connection,
and could release it if it ran. The default waitallowed is 5 seconds
the server decides to devote it's resources to thework it can do, and
not let overflow requests cause an unintentionalor malicious denial-
of-service attack. The fundamental solution is tosupply enough DBMS
connections to serve the load you have.
Joe
Gene Chuang wrote:
Hi,
Here's our pool init info:
weblogic.jdbc.connectionPool.oraclePool=\
driver=oracle.jdbc.driver.OracleDriver,\
url=jdbc:oracle:oci8:@xxx,\
loginDelaySecs=0,\
initialCapacity=4,\
maxCapacity=10,\
capacityIncrement=2,\
allowShrinking=true,\
shrinkPeriodMins=15,\
refreshMinutes=10,\
testTable=dual,\
props=user=xxx;password=xxxx;server=xxx
I run a db-intensive data migration program on
my ejbs (hence JDBC connection
requests
are
made
on
the serverside). After a while, I run out of
connections,
and the exception
pasted
below is
thrown.
Why is this exception thrown? If the pool is at
maxCapacity and all connections
are
taken,
shouldn't weblogic place the connection-requestor
on wait until a connection is
available?
And
I'm
pretty sure I return the connections because I
wrap connection.close() on a
finally
block...
JDBCPoolConnection.connect: Problem connecting
Exception:
java.sql.SQLException: Pool connect failed: Noneavailable
java.sql.SQLException: Pool connect failed: Noneavailable
at
weblogic.jdbcbase.pool.Driver.connect(Driver.java:184)
atweblogic.jdbcbase.jts.Driver.connect(Driver.java:233)
at
weblogic.jdbc20.common.internal.RmiDataSource.getConnection(RmiDataSourc
e.java:55)
at
weblogic.jdbc20.common.internal.RmiDataSource_ServiceStub.getConnection(
RmiDataSource_ServiceStub.java:179)
at
com.kiko.db.JDBCPoolConnection.connect(JDBCPoolConnection.java:24)ABMEB.
ejbActivate: Getting bean out of pooled state.
Gene Chuang
Join Kiko.com!--
PS: Folks: BEA WebLogic is in S.F. with both entryand advanced positions for
people who want to work with Java and E-Commerceinfrastructure products. Send
resumes to [email protected]
The Weblogic Application Serverfrom BEA
JavaWorld Editor's Choice Award: Best WebApplication Server
Java Developer's Journal Editor's Choice Award:Best Web Application Server
Crossroads A-List Award: Rapid Application
Development
Tools for Java
Intelligent Enterprise RealWare: Best ApplicationUsing a Component Architecture
>
http://www.bea.com/press/awards_weblogic.html
>>>>>>>>>>
PS: Folks: BEA WebLogic is in S.F. with both entry andadvanced positions for
people who want to work with Java and E-Commerce
infrastructure
products. Send
resumes to [email protected]
The Weblogic Application Server fromBEA
JavaWorld Editor's Choice Award: Best Web
Application
Server
Java Developer's Journal Editor's Choice Award: BestWeb Application Server
Crossroads A-List Award: Rapid Application
Development
Tools for Java
Intelligent Enterprise RealWare: Best Application Usinga Component Architecture
>
http://www.bea.com/press/awards_weblogic.html
>>>>>>>>
PS: Folks: BEA WebLogic is in S.F. with both entry andadvanced
positions for
people who want to work with Java and E-Commerce
infrastructure
products. Send
resumes to [email protected]
The Weblogic Application Server fromBEA
JavaWorld Editor's Choice Award: Best Web
Application
Server
Java Developer's Journal Editor's Choice Award: Best WebApplication Server
Crossroads A-List Award: Rapid Application DevelopmentTools for Java
Intelligent Enterprise RealWare: Best Application Using aComponent Architecture
>
http://www.bea.com/press/awards_weblogic.html
>>>>>>
PS: Folks: BEA WebLogic is in S.F. with both entry and advancedpositions for
people who want to work with Java, XML, SOAP and E-Commerce
infrastructure
products. Send resumes to [email protected]
The Weblogic Application Server from BEA
JavaWorld Editor's Choice Award: Best Web ApplicationServer
Java Developer's Journal Editor's Choice Award: Best Web
Application
Server
Crossroads A-List Award: Rapid Application Development Toolsfor Java
Intelligent Enterprise RealWare: Best Application Using a
Component
Architecture
http://www.bea.com/press/awards_weblogic.html--
PS: Folks: BEA WebLogic is in S.F. with both entry and advanced
positions
for
people who want to work with Java, XML, SOAP and E-Commerce
infrastructure
products. Send resumes to [email protected]
The Weblogic Application Server from BEA
JavaWorld Editor's Choice Award: Best Web Application Server
Java Developer's Journal Editor's Choice Award: Best WebApplication
Server
Crossroads A-List Award: Rapid Application Development Toolsfor Java
Intelligent Enterprise RealWare: Best Application Using a ComponentArchitecture
http://www.bea.com/press/awards_weblogic.html--
PS: Folks: BEA WebLogic is in S.F. with both entry and advanced positions
for
people who want to work with Java, XML, SOAP and E-Commerceinfrastructure
products. Send resumes to [email protected]
The Weblogic Application Server from BEA
JavaWorld Editor's Choice Award: Best Web Application Server
Java Developer's Journal Editor's Choice Award: Best Web Application
Server
Crossroads A-List Award: Rapid Application Development Tools for
Java
Intelligent Enterprise RealWare: Best Application Using a ComponentArchitecture
http://www.bea.com/press/awards_weblogic.html -
ConnectionPoolDataSource - running out of Connections..
Hi
I have a same problem as described in this thread
http://forum.java.sun.com/thread.jsp?forum=136&thread=560645&tstart=0&trange=15
I have Q42004 Beta J2EE SDK, and am using MS SQL 2000 databse server with jTDS 0.9 (jtds.sourceforge.net) JDBC driver...
I have a very simple servlet that gets a DataSource from the JNDI, gets connection , does some stuff, closes connection....Pretty basic....After a while I get the following error
[#|2004-10-08T19:19:08.053-0400|INFO|sun-appserver-pe8.1|javax.enterprise.system.stream.out|_ThreadID=28;|
[2004-10-08 19:19:08,053] [ERROR] [org.nemours.webapps.coi.COIServlet]
[MSG] java.sql.SQLException: Error in allocating a connection. Cause: In-use connections equal max-pool-size and expired max-wait-time. Cannot allocate more connections.
at com.sun.gjc.spi.DataSource.getConnection(DataSource.java:74)
at org.nemours.webapps.coi.COIServlet.getDBConnection(Unknown Source)
at org.nemours.webapps.coi.COIServlet.doProcess(Unknown Source)
at org.nemours.webapps.coi.COIServlet.doPost(Unknown Source)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:767)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:860)
at sun.reflect.GeneratedMethodAccessor248.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:246)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAsPrivileged(Subject.java:500)
at org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:273)
at org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:162)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:236)
at org.apache.catalina.core.ApplicationFilterChain.access$000(ApplicationFilterChain.java:55)
at org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChain.java:145)
at java.security.AccessController.doPrivileged(Native Method)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:141)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:262)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:551)
at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:225)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:173)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:551)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:161)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:551)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:132)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:551)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:933)
at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
at com.sun.enterprise.web.connector.grizzly.ProcessorTask.process(ProcessorTask.java:618)
at com.sun.enterprise.web.connector.grizzly.ProcessorTask.process(ProcessorTask.java:500)
at com.sun.enterprise.web.connector.grizzly.ProcessorTask.doTask(ProcessorTask.java:375)
at com.sun.enterprise.web.connector.grizzly.WorkerThread.run(WorkerThread.java:55)
Error in allocating a connection. Cause: In-use connections equal max-pool-size and expired max-wait-time. Cannot alloca
te more connections.
|#]the configuration of the pool in my domain.xml is as follwing...
<jdbc-resource enabled="true" jndi-name="jdbc/coiDB" object-type="user" pool-name="coi_Pool"/>
<jdbc-connection-pool connection-validation-method="auto-commit" datasource-classname="net.sourceforge.jtds.jdbcx.JtdsConnectionPoolDataSource" fail-all-connections="true" idle-timeout-in-seconds="300" is-connection-validation-required="false" is-isolation-level-guaranteed="false" max-pool-size="32" max-wait-time-in-millis="60000" name="coi_Pool" pool-resize-quantity="2" res-type="javax.sql.ConnectionPoolDataSource" steady-pool-size="8">
<description>jTDS 0.9 Type 4 JDBC Driver</description>
<property name="DatabaseName" value="coi"/>
<property name="Password" value="******"/>
<property name="User" value="*******"/>
<property name="ServerName" value="localhost"/>
</jdbc-connection-pool>
...After few WAR redeployments I run out of connections....I have noticed also the following:
1. On MS SQL Enterprise Manager - Management console there are no processes/locks associated with jTDS meaning there are no outstanding connection when I get an error...
2. After a restart of MSSQL services i still get an error
3. After an application redeployment I still get an error
4. After a domain restart the error goes away untill i redeploy the app several times....
Can someone PLEASE let me know if this is a bug in Q42004 or am I doing something bad...
I spent hours debugging the code trying to figure this one out....
Thanks
ZHi
jTDS 0.9 does not have XADataSource implementation but it has DataSource implementation.
If I use the DataSource imlementation I still get the "out of connections" problem....
This same application did not exibit any problems on Updte 1.
The code of my servlet is pretty big but here are the relevant snippets:
private Connection getDBConnection() {
DataSource ds = null;
Connection conn = null;
try {
Log.info(this.getClass(), "Attempting to use ServiceLocator to get DS from JNDI...");
ds = ServiceLocator.getInstance().getDataSource("jdbc/coiDB");
Log.info(this.getClass(), "Attempting to get connection...");
conn = ds.getConnection();
} catch (Exception e) {
Log.error(this.getClass(),"failure...!");
Log.exception(this.getClass(), e);
return conn;
private Employee getEmployee(int empID) {
Employee existingEmp = null;
PreparedStatement pstmt = null;
ResultSet rset = null;
Connection conn = getDBConnection();
try {
pstmt = conn.prepareStatement("SELECT * FROM EMPLOYEE WHERE ID = ?");
pstmt.setInt(1, empID);
rset = pstmt.executeQuery();
if (rset.next()) {
existingEmp = new Employee(rset.getInt("id"), rset.getString("fname"), rset.getString("lname"), rset.getString("location"), rset.getString("department"), rset.getString("phone"));
existingEmp.setCreateTS(rset.getTimestamp("create_ts"));
} catch (SQLException e) {
Log.error(this.getClass(), "Failed DB operation while checking for existing employee");
Log.exception(this.getClass(), e);
} finally {
DBUtils.closeResultSet(rset);
DBUtils.closeStatement(pstmt);
DBUtils.closeConnection(conn);
return existingEmp;
}The DBUtils I use is just convenience static class that wraps regular JDBC calls into try catch block and ServiceLocator is a BluePrints pattern straight from AdventureBUilder 1.0.1. Employee is a my model/subject class.....
Thanks
Z... -
Oc4j connection pool: too much INACTIVE connections
I am publishing an application - developed using Eclipse and previously published in Tomcat (where it works perfectly for a long time) - within corporate servers using Oc4j version 10.1.3. The database server is Oracle 9g.
After the deployment operation, the application seems to work, but that happens during the work by users, there are still many connections whith status "INACTIVE", until to complete all the available connections.
The datasource is set as follows:
<connection-pool name="ConnectionPoolRichiestaPubblicazione">
<connection-factory factory-class="oracle.jdbc.pool.OracleDataSource"
user="REDAZIONE"
password="password"
url="jdbc:oracle:thin:@(DESCRIPTION=(FAILOVER=ON)
(ADDRESS_LIST=(LOAD_BALANCE=ON)
(ADDRESS=(PROTOCOL=TCP)
(HOST=10.146.2.86)(PORT=1521))
(ADDRESS=(PROTOCOL=TCP)(HOST=10.146.2.86)(PORT=1521)))
(CONNECT_DATA=
(SERVER=DEDICATED)
(SERVICE_NAME=XE)
(FAILOVER_MODE=(TYPE=SELECT)(METHOD=BASIC)(RETRIES=180)(DELAY=5))))">
</connection-factory>
</connection-pool>
<managed-data-source
jndi-name="jdbc/RichiestaPubblicazioneDS"
name="RichiestaPubblicazioneDS"
connection-pool-name="ConnectionPoolRichiestaPubblicazione" />
The java code to establish a connection is as follows:
private Connection creaConnessioneDataSource(String nomedatasource) throws ConnessioneException{
LOGGER.debug("START");
try {
InitialContext context = new InitialContext();
DataSource ds = (DataSource)context.lookup(nomedatasource);
LOGGER.debug("URL DATASOURCE : " + ds.getConnection().getMetaData().getURL());
LOGGER.debug("USERNAME : " + ds.getConnection().getMetaData().getUserName());
this.conn = ds.getConnection();
catch( Exception e ) {
LOGGER.error("Errore nella connessione tramite datasource : " + StringUtils.getCustomStackTrace(e));
LOGGER.debug("END");
return this.conn;
Connections and statements are closed using the following methods:
public boolean chiudi(Connection conn){
LOGGER.debug("START");
boolean esito = false;
if (conn != null){
try {
conn.close();
esito = true;
LOGGER.debug("Connessione chiusa");
catch (SQLException e) {
LOGGER.error("Eccezione nella chiusura della connessione : " + e);
LOGGER.debug("END");
return esito;
public boolean chiudi(Statement stmt){
LOGGER.debug("START");
boolean esito = false;
if (stmt != null){
try {
stmt.close();
esito = true;
LOGGER.debug("Statement chiuso");
} catch (SQLException e) {
LOGGER.error("Eccezione nella chiusura dello statement : " + e);
e.printStackTrace();
LOGGER.debug("END");
return esito;
Here are a couple of examples of code that interact with the database:
public List<StatoRichiestaSintesi> getElencoStatiRichieste() throws ConnessioneException{
LOGGER.debug("START");
List<StatoRichiestaSintesi> listaStati=new LinkedList<StatoRichiestaSintesi>();
LOGGER.debug("Apriamo connessione e statement");
Connection conn = databaseManager.creaConnessioneDataSource(datasource);
Statement stmt = databaseManager.creaStatement(conn, false);
String sql="SELECT * FROM STATORICHIESTA";
try {
ResultSet rs = stmt.executeQuery(sql);
while(rs.next()){
StatoRichiestaSintesi temp=new StatoRichiestaSintesi();
temp.setIdStato(rs.getString(1));
temp.setDescrizioneStato(rs.getString(2));
listaStati.add(temp);
LOGGER.debug("Numero record trovati : " + listaStati.size());
} catch (SQLException e) {
LOGGER.error("Eccezione di tipo SQL : " + StringUtils.getCustomStackTrace(e));
finally{
LOGGER.debug("Chiusura di statement e connessione");
databaseManager.chiudi(stmt);
databaseManager.chiudi(conn);
LOGGER.debug("END");
return listaStati;
Below is another example using PreparedStatement:
private synchronized void aggiungiIndicazioneProgetto(String idprogetto, String idrichiesta) {
LOGGER.debug("START");
LOGGER.debug("Creo un oggetto di tipo connessione");
Connection conn = databaseManager.creaConnessioneDataSource(datasource);
LOGGER.debug("Definisco una query sql");
String sql = "INSERT INTO RICHIESTAPROGETTO (IDRICHIESTA,IDPROGETTO) VALUES (?,?)";
LOGGER.debug("Dichiaro un oggetto di tipo preparedstatement");
PreparedStatement stmt = null;
try {
LOGGER.debug("Istanzio l'oggetto statement");
stmt = conn.prepareStatement(sql);
LOGGER.debug("Imposto i segnalibri della query");
stmt.setString(1, idrichiesta);
stmt.setString(2, idprogetto);
LOGGER.debug("Eseguo la query di inserimento del progetto");
stmt.executeUpdate();
} catch (SQLException e) {
LOGGER.error("Eccezione di tipo SQL : " + StringUtils.getCustomStackTrace(e));
finally {
LOGGER.debug("Chiusura di statement e connessione");
databaseManager.chiudi(stmt);
databaseManager.chiudi(conn);
LOGGER.debug("END");
Which may be the cause for the described behavior?
I hope someone help me..My problem is the following.
If I deploy my application with the illustred datasource in my local OC4J (10.1.3 in a Standalone Environment) all work fine.
The application creates a reasonable number of connections (in ORACLE - 10g Enterprise Edition Release 10.2.0.4.0 - db I run the query verification "select count(*) from v$session where username='MYAPPLICATION'"), and overall performance is very good.
If, however, to deploy on the production machine of corporate (always 10.1.3, but obviously in Oracle Application Server Environment) the
number of connections (status 'INACTIVE') grows massively, and this is saturated in a short time.
The exception that at the end from the application is that:
java.sql.SQLException: ORA-01034: ORACLE not available
ORA-27101: shared memory realm does not exist
Linux Error: 2: No such file or directory
oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:138)
oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:316)
oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:277)
oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:272)
oracle.jdbc.driver.T4CTTIoauthenticate.receiveOsesskey(T4CTTIoauthenticate.java:243)
oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:304)
oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:430)
oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:151)
oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:32)
oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:608)
oracle.jdbc.pool.OracleDataSource.getConnection(OracleDataSource.java:218)
oracle.jdbc.pool.OracleConnectionPoolDataSource.getPhysicalConnection(OracleConnectionPoolDataSource.java:114)
oracle.jdbc.pool.OracleConnectionPoolDataSource.getPooledConnection(OracleConnectionPoolDataSource.java:77)
oracle.jdbc.pool.OracleImplicitConnectionCache.makeCacheConnection(OracleImplicitConnectionCache.java:1361)
oracle.jdbc.pool.OracleImplicitConnectionCache.getCacheConnection(OracleImplicitConnectionCache.java:441)
oracle.jdbc.pool.OracleImplicitConnectionCache.getConnection(OracleImplicitConnectionCache.java:336)
oracle.jdbc.pool.OracleDataSource.getConnection(OracleDataSource.java:286)
oracle.jdbc.pool.OracleDataSource.getConnection(OracleDataSource.java:179)
oracle.jdbc.pool.OracleDataSource.getConnection(OracleDataSource.java:159)
oracle.oc4j.sql.DataSourceConnectionPoolDataSource.getPooledConnection(DataSourceConnectionPoolDataSource.java:57)
oracle.oc4j.sql.xa.EmulatedXADataSource.getXAConnection(EmulatedXADataSource.java:92)
oracle.oc4j.sql.spi.ManagedConnectionFactoryImpl.createXAConnection(ManagedConnectionFactoryImpl.java:211)
oracle.oc4j.sql.spi.ManagedConnectionFactoryImpl.createManagedConnection(ManagedConnectionFactoryImpl.java:170)
com.evermind.server.connector.ApplicationConnectionManager.createManagedConnection(ApplicationConnectionManager.java:1377)
oracle.j2ee.connector.ConnectionPoolImpl.createManagedConnectionFromFactory(ConnectionPoolImpl.java:327)
oracle.j2ee.connector.ConnectionPoolImpl.access$800(ConnectionPoolImpl.java:98)
also I add the other attributes of Connection Pool of the Datasource:
Connections:
Initial size of Connection Cache = 0
Minimum Number of Connections = 0
Maximum Number of Connections = -1
Connection Retry Interval (seconds) = 1
Maximum Connection Attempts = 3
Maximum Number of Statements Cached = 0
Lower Threshold Limit On Pool (%)= 20
Validate Connection = False
What I can do?
many thanks.. -
i get " itunes cannot connect to the itunes store. the network connection has timed out" im connected to the internet no doubt. whats up?
Try temporarily disabling your firewall and see if you are then able to access the iTunes store.
-
Sybase ASE 12.5.4 EBF 14124 ESD#4 running out of connections
I am working on a web application which works on SQL sever back end as well as Sybase ASE 12.5.4 EA server. Our project main focus was to move everything to sybase backend.
Earlier there were 2 databases, the app was connecting to - db1 on sql server, and db2 on sybase. Now we have created a separate namespace within db2 in sybase. So application only connects with db2, but with different users and in separate schemas.
Application is in java and connecting to db server using jcon3 driver library. It is using SybXADataSource driver class (provided by jcon3 jar) to connect to the server. Till last week application was able to connect to the server, everything was working fine (though I must say that code is still not optimized to use connection pools etc., I am opening a connection, and closing it for every request).
For sometime, I have been facing an issue from the server- login failed, try again. In the server error logs I found it was throwing an error- "Error 1601 Severity 17 state 3: no user connections available to run the process" I checked for available connections (using sp_configure), allowed connections are 900, and total active connection at the time this error shows up is typically between 30- 100 (using sp_monitorconfig). Seems like this is well within limits.
Also yesterday, I did one more exercise, I restarted the server and logged in as sa from isql console only. Logged out and logged in again afimeter 20 minutes (no application connection was made), and isql login again gave this error. So I am inclined to think that something could be wrong with server configuration as well. Server is on linux red hat.
I have searched all the db forums and SCN website as well, and all of these refer to one resolution of increasing the number of connections, but as from my observation regarding that, I do not think it is an issue.
Any help would be greatly appreciated!!During your sa/isql test, how did you exit from your sessions? Did you type 'exit + go', hit ^S, hit ^C, something else?
Are you running your sa/isql test from the same linux host where the ASE is runing, or from another host on the network?
Is your isql session connecting directly to the dataserver or are you going through an intermediary service?
Are there any login triggers on your sa account? (See the output from sp_displaylogin sa)
Could you run your sa/isql test again, but this time:
session #1: log in as sa using isql; stay logged in
session #2: perform your login/logout test using sa + isql
session #1: periodically run 'sp_who' to see the active connections; does the list of connections grow over time? -
Connection pool not re-establishing connections, throwing exception instead
Hello,
I've just set up a connection pool on the sun java system application server 8 for a MySQL database using the official mysql-connector/j 5.0. Everything is working great, except when the connections timeout (or i kill them all manually from the database server) and then request a page that needs to use the DataSource object, the following exception is thrown:
Exception thrown: com.mysql.jdbc.CommunicationsException -- Communications link failure due to underlying exception:
** BEGIN NESTED EXCEPTION **
java.io.EOFException
STACKTRACE:
java.io.EOFException
at com.mysql.jdbc.MysqlIO.readFully(MysqlIO.java:1913)
at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:2304)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2803)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1573)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1665)
at com.mysql.jdbc.Connection.execSQL(Connection.java:3118)
at com.mysql.jdbc.Connection.execSQL(Connection.java:3047)
at com.mysql.jdbc.Statement.executeQuery(Statement.java:1166)
at com.mysql.jdbc.jdbc2.optional.StatementWrapper.executeQuery(StatementWrapper.java:705)
at beans.MySessionBean.businessMethod(MySessionBean.java:73)
at org.apache.jsp.index_jsp._jspService(index_jsp.java:70)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:105)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:860)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:336)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:301)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:251)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:860)
at sun.reflect.GeneratedMethodAccessor98.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:249)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAsPrivileged(Subject.java:517)
at org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:282)
at org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:165)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:257)
at org.apache.catalina.core.ApplicationFilterChain.access$000(ApplicationFilterChain.java:55)
at org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChain.java:161)
at java.security.AccessController.doPrivileged(Native Method)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:263)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:551)
at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:225)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:173)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:551)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:161)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:551)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:132)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:551)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:933)
at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:185)
at com.sun.enterprise.web.connector.grizzly.ProcessorTask.process(ProcessorTask.java:653)
at com.sun.enterprise.web.connector.grizzly.ProcessorTask.process(ProcessorTask.java:534)
at com.sun.enterprise.web.connector.grizzly.ProcessorTask.doTask(ProcessorTask.java:403)
at com.sun.enterprise.web.connector.grizzly.WorkerThread.run(WorkerThread.java:55)
** END NESTED EXCEPTION **
Last packet sent to the server was 16 ms ago.What could be wrong?
Thank you.The code is here:
public String businessMethod() {
//TODO implement businessMethod
try
InitialContext ic = new InitialContext();
Object obj = ic.lookup("jdbc/MyDS");
System.out.println("Object is: " + obj + " | Class is: " + obj.getClass().getName());
DataSource ds = (DataSource)obj;
Connection conn = ds.getConnection();
Statement stmt = conn.createStatement();
ResultSet rs = stmt.executeQuery("SELECT a,b FROM test");
String ret = "";
while(rs.next())
ret += rs.getString(1) + " - " + rs.getString(2) + "<br/>";
conn.close();
return ret;
catch(Exception e)
return "Exception thrown: " + e.getClass().getName() + " -- " + e.getMessage();
}On the server, it is set up as XADataSource. I don't really have a big need for distributed transactions, but does it hurt badly to use it anyways? Could it be causing this problem? -
How to purge connection pool on stale on connections
Hello
Our problem is when we are required to reboot the database then we have to reboot all application servers.
Is there a way we can avoid app servers reboot.
app server code is in VB 6.0 and .NET 1.1 (using odp.net for .net)
in a sample application what we found that the ADO (using OraOLEDB) returns a connection where the connection state is open even after database reboot, but when try to use the connection object it throws an exception like end-of-line etc.
so is there a way to clean up the connection pool or reset ole db connection manger.
Any help will be greatly appreciated
ThanksYou're using both ODP and OLEDB then?
ODP has a ClearPool method on a connection you can call, useful for just this situation.
OLEDB connection pooling is done by the OLEDB framework provided by Microsoft, not by the provider itself. I dont know of any way to clear out the pool apart from restarting the application.
Hope it helps, corrections/comments welcome
Greg -
Connection Pool - unable to establish connection for one or more OC4J inst.
Hi.
I'm using Oracle JDeveloper 10.1.3.1 to develop some app. Database is Oracle XE 10.2.0. Application server is Oracle Aplication Server 10.1.3.1
After create a needed code, I' v tried establish Connection Pool. When I' v tested connection, next errors was occurred:
Unable to establish connection for one or more OC4J instances<<
Home on admin.FRIEND-6843859F - Failed due to error: "Exception occurred testing connection. Exception: java.sql.SQLException: invalid arguments in call."<<"FRIEND-6843859F " is Computer name where Application server is installed.
--Database is started.
--App.server processes are started.
How can I solve this problem?
ThanxIf you are using ADF "BC" Jdev will not support more than one connection
I've tryied and always gives a errors. -
Struts and Connection pooling my servlet DB connections ...
I have done extensive work using the MVC approach to application development and i am ready to move on to the nextlevel. THis next level, for me, is the STRUTS frame work of web application design. For the model portion of STRUTS, is there connection pooling contained with in the class structure or do we have to add this connection pooling ourselves. I have already develpoed DB / servlet connection pooling classes and i am looking to incorporate them into the STRUTS frame work, do i need to or is there some thing there already?
Well, to be J2EE you could use an implementation of javax.sql.DataSource which also implements connection pooling.
I use the one that's packaged in tomcat : exolab's tyrex. http://tyrex.exolab.org -
Connection pooling is not really connection pooling? Right?
Here's what I don't understand, I'm trying to pool connections but everywhere I look I see the following code:
Connection con = null;
try {
con = dataSource.getConnection("username", "password");
} catch (Exception ex}
finally {
con.close();
Why is the connection closed? Isn't it supposed to be "pooled"? I have read that connections need to be closed to be reused, then what's the point of "pooling connections"? I mean, I have closely followed MySQL server connections and appears that connections are indeed closed, apparently, what "connection pooling" does is save some connection information (which is what apparently is the only thing that is "pooled") which is used to establish connections instead of reusing them.
When I start my Java application, DataSource.getConnection() creates a connection and MySQL Administrator shows a new connection in a list of connections to MySQL. I get com.mysql.jdbc.Connection@13e6657 for that connection. After con.close() is called, that connection is removed from the list of connections and when DataSource.getConnection() is called again, I get com.mysql.jdbc.Connection34o3422 and a new connection shows up in MySQL Administrator.
So what's the point in calling this "connection pooling"? I mean, this isn't really pooling connection but rather saving some data in the memory that is used to create connections, not saving them.^ The fact that a connection is pooled is usually abstracted away from the client, such that a call to the Connection's close() method doesn't actually close the connection, but instead returns it to the pool. The example you cited above says as much. The code that @OP posted could very easily be pooled behind the scenes.
Message was edited by:
bckrispi -
Connection Pooling: how many active connections?
Hi, everybody.
I have a very simple question about connection pooling...
How many active connections should a database see once a connection pool has been opened?
I mean, it should see only one connection (the pool itself) at any time, or the number of "logical" active connections in that moment?
Thanks for any answer.Sorry...
This is the wrong forum, I posted again my question in the JDBC Forum...
Maybe you are looking for
-
I have a new HP LaserJet M1217nfw MFP that is supposed to have air print. My iPad isn't reading it. Is there something special I need to do? Both are on the same network and my laptop is working fine with it. Any suggestions?
-
How to display an indication of unprintable Ascii code in Lookout 5.0
Hi, I am receving response telegram in unprintable Ascii characters such as correct response is ACK(hex06) or resonse in case of error NAK(hex15). I want to display such responses in signal indicator. For example response is ACK, the LED is on, other
-
In FF only, my mouse pointer (arrow or hand) dissapears and re-appears when I move the mouse
-
After I updated my N8 to Anna I had a new program called 'Nokia Signal Booster' but when I clicked it, the icon disappeared. What was this and how do I get it back? Solved! Go to Solution.
-
Multiple action buttons in same CFFORM
I've read previous posts, but the solutions there didn't prove successful. So here we go again. I have a form called from a module called menu.cfm. On this form, I have three buttons: Reset, Continue and Return to Main Menu. Reset and Continue wor