-
1. Re: No ManagedConnections available
informsantosh Mar 3, 2005 8:02 AM (in response to chakrapani001)Hi you need to increase the value of block out time from 30000 to say 70000
<blocking-timeout-millis >30000 </blocking-timeout-millis >
Another thing is make sure you are closing all connections in the custom code you have written -
2. Re: No ManagedConnections available and Connections are not
snvkgram Apr 7, 2005 8:59 AM (in response to chakrapani001)Hi,
I am also getting the same problem. I am using Jboss 3.2.3 and Postgresql 8.0 windows version. I found that connections are not getting closed or they are returned to pool even though my code is seems to be right. Ultimately all connections are open and finally i need to restart the jboss. I am writing the code for getting connection like this:
import java.sql.Connection;
import javax.naming.InitialContext;
import javax.naming.Context;
import javax.naming.NamingException;
import javax.sql.DataSource;
public class DBConnection{
static javax.sql.DataSource DataSrc = null;
static SQLQueryProperties sqlQueryObj = null;
static int no_connections=0;
static
{
try
{
sqlQueryObj = SQLQueryProperties.getInstance();
DataSrc = (DataSource)sqlQueryObj.getContext().lookup(sqlQueryObj.getProperty("DataSourceJNDI"));
}
catch(Exception e)
{
e.printStackTrace();
}
}
public DBConnection() throws Exception
{
}
public Connection getDBConnection() throws Exception
{
Connection cn=DataSrc.getConnection();
no_connections++;
return cn;
}
public Connection getConnection() throws Exception
{
Connection cn=DataSrc.getConnection();
no_connections++;
return cn;
}
public void returnDBConnection(Connection con) throws Exception
{
if(!con.isClosed()) {con.close(); no_connections--;}
}
public void returnConnection(Connection con) throws Exception
{
System.out.println("NO OF CONNECTIONS OPENED IS :"+no_connections);
if(!con.isClosed()) {con.close(); no_connections--;}
System.out.println("AFTER CLOSE NO OF CONNECTIONS REMAINED IS :"+no_connections);
}
public static int countConnections(){
return no_connections;
}
}
There is some piece of code to count the no of connections open and closed. And my postgres-ds.xml is like this:
<local-tx-datasource>
<jndi-name>PostgresDS</jndi-name>
<connection-url>jdbc:postgresql://ipaddress:5432/database
</connection-url>
<driver-class>org.postgresql.Driver</driver-class>
<transaction-isolation>TRANSACTION_SERIALIZABLE</transaction-isolation>
<user-name>user</user-name>
<min-pool-size>2</min-pool-size>
<max-pool-size>10</max-pool-size>
<blocking-timeout-millis>20000</blocking-timeout-millis>
<idle-timeout-minutes>0</idle-timeout-minutes>
</local-tx-datasource>
I don't what to do to close the opened connections. Because of this i am facing a lot of problem in development environment.
Please let me know what should i do to get rid of this problem.
Thanks and Regards
Ram -
3. Re: No ManagedConnections available
schrouf Apr 8, 2005 7:59 AM (in response to chakrapani001)Upgrade to at least 3.2.6 as all previous JBoss versions have a connection leak bug within the ManagedConnectionPool code.
Regrads
Ulf -
4. Re: No ManagedConnections available
rodrigo.baptista May 16, 2005 2:25 PM (in response to chakrapani001)Hi,
I cannot do an upgrade in my jboss (3.0.4), is there any patch to solve the connection leak bug?
Thanks,
Rodrigo