I think you will have to read the castor code to find out why it is not
closing connections when it is done with them.

david jencks

On 2002.08.29 00:09:30 -0400 Arijit Ghosh wrote:
> There is no connection timeout error.... Connection remains there
> (status =INACTIVE). If I restart Jboss, then a new set of connections
> are being created which again become INACTIVE and never reused. When the
> no of maximum connections reached, "No Managed Connection" error is
> thrown. So if I have no of MAX connections as 3 then after RESTARTING
> Jboss and making few database transactions, I will have 6 INACTIVE
> connections. (3 from the last and 3 now).
> 
> Here is the sample code of what I am doing ----
> 
> 
>  InitialContext  ctx;
>  DataObjects     dobj;
>  Database db;
> 
> //Initializing the context
>  ctx = new InitialContext();
> 
> //Looking up for for the dataobject
>  dobj = (DataObjects) ctx.lookup( "java:/comp/env/jdo/mydb" );
> 
> 
> 
>  try
>     {
>        //performing a getDatabase()
>       db = dobj.getDatabase();
> 
>        //No need for db.begin() No need for transaction.begin()
>       findOql = db.getOQLQuery(aQuery);
> 
>       // Executing the Query
>       results = findOql.execute(Database.ReadOnly);
> 
>     //No need for transaction.commit() or db.commit()
> 
>     }
>     catch(Exception e)
>     {
>       if(e instanceof java.lang.IllegalStateException)
>         throw new CastorException("error.jdoIllegalState", e);
>       else
>         throw new CastorException("error.generalJDOError", e);
>     }finally{
>       try
>       {
>         //database connection is being closed here
>         if(db!=null) db.close();
>       }
>       catch(PersistenceException e)
>       {
>         throw new CastorException("error.generalJDOError",e);
>       }
>     }
> 
> Any suggestions ???
> 
> Regards,
>   Arijit
> 
> --------------------
> Hi,
> 
>   I am using Jboss 3.0 with Castor. I am using CMT.
> 
> As the transaction is Container Managed, I am not opening any
> transaction explicitly nor am I closing it. Neither am I opening a
> database connection or doing a database.begin().
> 
> Also, I am not performing database.commit().
> 
> However, I am performing database.close() and this statement always gets
> 
> executed as I have put it in "finally"
> 
> I find that if I make any database call, the database gets updated
> correctly. However, the connnection remains with status = INACTIVE.
> 
> As a result, if I have set Max number of Connections to "3" in my
> Oracle-service.xml file then I am getting a "No Managed Connection"
> error after 3 successful connections are met.
> 
> Can anyone help ? Why are the connections not being reused ? or removed
> ?
> 
> 
> 
> 
> 
> -------------------------------------------------------
> This sf.net email is sponsored by: Jabber - The world's fastest growing 
> real-time communications platform! Don't just IM. Build it in! 
> http://www.jabber.com/osdn/xim
> _______________________________________________
> 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

Reply via email to