Jun Inamori wrote:
> 
> Hello,
> Thank you for your enthusiastic development.
> 
> In the 18th April, I posted the patch for the following problem:
> 
> PROBLEM: Closing the actual JDBC connection at shutdown
> The current implementation of ConnectionManager is responsible for
> closing the actual JDBS connection after the specified time passed. It
> is the great improvement since version 1.x . But there is the
> possibility that some connections remain opened at the server shutdown.
> This doesn't matter for most RDB, but as for InstantDB, it results in
> the problem. Anymore, it is desirable to close all the actual JDBC
> connection when the server is shutdown.
> 
> And I found the mistake about my patch. It is in:
> 
>     CLASS: org.objectweb.jonas.dbm.ConnectionManager
>     INNER_CLASS: Pool
>     METHOD: public void closeAllConnection()
> 
> My old code was:
>     /**
>      * Adm.stopServer()
>      * -->DataBaseManager.unbindDataSources()
>      * -->ConnectionManager.closeAllConnection()
>      * -->Pool.closeAllConnection()
>      */
>     public void closeAllConnection(){
>         Trace.outln(trace,"Pool.closeAllConnection()");
>         Enumeration e=hXAC2Item.keys();
>         try{
>             while(e.hasMoreElements()) {
>                 XAConnection xc=(XAConnection)e.nextElement();
>                 Connection conn=xc.getConnection();
>                 if(!conn.isClosed()){
>                     conn.close();
>                 }
>             }
>         }catch(java.sql.SQLException ex) {
>             Trace.errln(ex.toString());
>         }
>     }
> 
> But it should be:
>     /**
>      * Adm.stopServer()
>      * -->DataBaseManager.unbindDataSources()
>      * -->ConnectionManager.closeAllConnection()
>      * -->Pool.closeAllConnection()
>      */
>     public void closeAllConnection(){
>         Trace.outln(trace,"Pool.closeAllConnection()");
>         Enumeration e=hXAC2Item.keys();
>         try{
>             while(e.hasMoreElements()) {
>                 XAConnection xc=(XAConnection)e.nextElement();
>                 Connection conn=xc.getConnection();
>                 if(!conn.isClosed()){
>                     xc.close();
>                 }
>             }
>         }catch(java.sql.SQLException ex) {
>             Trace.errln(ex.toString());
>         }
>     }
> 
> Note that we should invoke XAConnection.close() rather than
> Connection.close().
> Sorry for my mistake.
> Any questions and comments are welcome.
> 
> PS:
> I'm not the member of this mailing list. I wish to join the list, but at
> this time, I have enough time to participate in.
> So, please mail to me([EMAIL PROTECTED]) directly!
> 
> Happy Java programming!
> Jun Inamori
> E-mail: [EMAIL PROTECTED]
> URL:    http://www.oop-reserch.com

Hi Jun,
We have seen the problem in your code, so it's already fixed in the CVS
tree.

Best regards,
-- 
        Philippe

Philippe Coq  Groupe Bulll/BullSoft/OpenMaster  Phone: (33) 04 76 29 78
49
Bull S.A  - 1 rue de Provence - 38432 Echirolles Cedex France
[EMAIL PROTECTED]  http://www-frec.bull.com
Download our EJBServer at http://www.bullsoft.com/ejb
----
This list is cross-posted to two mail lists.  To unsubscribe,
follow the instructions below for the list you subscribed to.
For objectweb.org: send email to [EMAIL PROTECTED] and
include in the body of the message "unsubscribe ejb-container-group".
For enhydra.org: send email to [EMAIL PROTECTED] and include
in the body of the message "unsubscribe ejb-container-group".

Reply via email to