For BMP:

I set the connection through:

  private Connection getDBConnection() throws SQLException, RemoteException
{
      Connection con = null;
      try{
                        InitialContext iCtx = new InitialContext();
                        DataSource ds = (DataSource)iCtx.lookup
("java:/OracleDS");
                        con = ds.getConnection();
                } catch(Exception e) {
                        System.out.println("getDBConnection : " +
e.toString());
                }

                return con;
        }

   public void setEntityContext(EntityContext ctx) {
        //System.out.println ("====== start setEntityContext ");
        context = ctx;
                try {
                conn = getDBConnection();
                } catch(SQLException se) {
                        System.out.print("SQLException Found : " +
se.toString());
                } catch(RemoteException re) {
                        System.out.print("RemoteException Found : " +
re.toString());
                }
    }

    public void unsetEntityContext() {
        System.out.println ("====== start unsetEntityContext ");
        context = null;
    }

In every ejbFindxxx method, I have, e.g.:
public ArrayList ejbFindByDate(String d) {
    try {
      .....
   }
   catch(Exception e) {...}
   finally {
      if(conn!=null)
        conn.close() ;
   }

}



Is that the proper way to do open / close connection getting from the
connection pool for a BMP ?




-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:jboss-user-admin@;lists.sourceforge.net]On Behalf Of Dmitri Colebatch
Sent: Monday, October 21, 2002 11:44 AM
To: [EMAIL PROTECTED]
Subject: Re: [JBoss-user] Running out of connections


> Could you kindly tell me which configuration files and parameters which
are
> related to the pool as I am afraid that if I am missing some of them ? One
> more is that the status is marked *INACTIVE* and logon_time was lasted for
> over 24-hour (in v$session),  and *ESTABLISHED* when using "netstat -an |
> grep 1521".

do you open connections yourself?  This suggests to me that there are
connections not being closed.  Make sure that you always close your
connections inside a finally block.

hth
dim

>
> Sorry, I don't know anything about the testsuite. Where could I have it ?
>
> Thanks,
> Camus
>
> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:jboss-user-admin@;lists.sourceforge.net]On Behalf Of David Jencks
> Sent: Monday, October 21, 2002 10:18 AM
> To: [EMAIL PROTECTED]
> Subject: Re: [JBoss-user] Running out of connections
>
>
> Sorry, I am highly sceptical of these problems.  I think if there were a
> problem in jboss the testsuite wouldn't run.
>
> What is different between your setup and the testsuite setup?
>
> david jencks
>
> On 2002.10.20 22:10:53 -0400 Camus Chan wrote:
> > Hi,
> >
> > I am using JBoss 3.0.3, Tomcat 4.1.12, Oracle8i and all running on
> > Solaris.
> >
> > Here is the problem:
> > I have set up successfully a connection pool for using in my
> > applications.
> > Everytime I call an CMP/BMP bean, a *NEW* db connection gets from the
> > pool,
> > and seems not being moved back to the pool nor reused. From v$session, I
> > can
> > see that the connection keeps increased but not shrinked. Eventually the
> > max. no of processes allowed (set in init.ora) is reached and jboss
> > raises
> > exception. It is an headache problem since I have to restart jboss
> > *FREQUENTLY* to clean up all these *INACTIVE* connections (marked in the
> > status field of v$session).
> >
> > This question is asked so many times in jboss forum for myself as well
as
> > I
> > can see such problem from others as well but seems without any idea /
> > solutions. This is a buring issue. Please help !
> >
> > Thanks,
> > Camus
> >
> >
> >
> >
> > -------------------------------------------------------
> > This sf.net email is sponsored by:
> > Access Your PC Securely with GoToMyPC. Try Free Now
> > https://www.gotomypc.com/s/OSND/DD
> > _______________________________________________
> > JBoss-user mailing list
> > [EMAIL PROTECTED]
> > https://lists.sourceforge.net/lists/listinfo/jboss-user
> >
> >
>
>
> -------------------------------------------------------
> This sf.net email is sponsored by:
> Access Your PC Securely with GoToMyPC. Try Free Now
> https://www.gotomypc.com/s/OSND/DD
> _______________________________________________
> JBoss-user mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/jboss-user
>
>
>
> -------------------------------------------------------
> This sf.net email is sponsored by:
> Access Your PC Securely with GoToMyPC. Try Free Now
> https://www.gotomypc.com/s/OSND/DD
> _______________________________________________
> JBoss-user mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/jboss-user



-------------------------------------------------------
This sf.net email is sponsored by:
Access Your PC Securely with GoToMyPC. Try Free Now
https://www.gotomypc.com/s/OSND/DD
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user



-------------------------------------------------------
This sf.net email is sponsored by:
Access Your PC Securely with GoToMyPC. Try Free Now
https://www.gotomypc.com/s/OSND/DD
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to