Ok, guys, I have a good news. After modifications, the problem goes away.
Thanks very much for dm and david for pointing out and giving me directions
to solve the long-lasted problem and my bug-ful programs.

For CMP, we observed that the connection is lasted for some minutes after
completing the request and then auto-closed. Is there parameter to configure
this auto-close time ?

Camus

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:jboss-user-admin@;lists.sourceforge.net]On Behalf Of Camus Chan
Sent: Monday, October 21, 2002 1:28 PM
To: [EMAIL PROTECTED]
Subject: RE: [JBoss-user] Running out of connections


OK, so let me try to lookup the datasource within setentitycontext while
getting and closing method within each method. FYI, right now, I don't have
the "connection is closed" style exception ? It seems no problem accessing
the database. Let me try and come back to you.

How about CMP ?


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


So, in setEntityContext you obtain a connection, and you close it in every
find method?  Ordinarily this would lead to "connection is closed" style
exceptions because setEntiyContext is called once, and the find*** methods
are obviously called many times.  However, in EJB, calling conn.close simply
disassociates the conn with the current thread.

Ok, basically, dont call getDBConnection in setEntityContext, call it in the
ejbFind*** methods.  And dont have it as a class member, just have a var in
the method - although you could have a class member, this is my preference.

hth
dim

----- Original Message -----
From: "Camus Chan" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, October 21, 2002 2:29 PM
Subject: RE: [JBoss-user] Running out of connections


> 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



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user



-------------------------------------------------------
This sf.net emial is sponsored by: Influence the future 
of  Java(TM) technology. Join the Java Community 
Process(SM) (JCP(SM)) program now. 
http://ad.doubleclick.net/clk;4699841;7576298;k?http://www.sun.com/javavote
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to