User: mulder  
  Date: 00/07/03 17:16:00

  Modified:    src/main/org/jboss/jdbc XADataSourceLoader.java
  Log:
  Close pools when jBoss is closed (before, just removed them from JNDI)
  
  Revision  Changes    Path
  1.4       +9 -6      jboss/src/main/org/jboss/jdbc/XADataSourceLoader.java
  
  Index: XADataSourceLoader.java
  ===================================================================
  RCS file: 
/products/cvs/ejboss/jboss/src/main/org/jboss/jdbc/XADataSourceLoader.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- XADataSourceLoader.java   2000/06/20 03:22:04     1.3
  +++ XADataSourceLoader.java   2000/07/04 00:15:59     1.4
  @@ -22,7 +22,7 @@
    * pool generates connections that are registered with the current Transaction
    * and support two-phase commit.  The constructors are called by the JMX engine
    * based on your MLET tags.
  - * @version $Revision: 1.3 $
  + * @version $Revision: 1.4 $
    * @author Aaron Mulder ([EMAIL PROTECTED])
    */
   public class XADataSourceLoader extends ServiceMBeanSupport
  @@ -38,9 +38,9 @@
           try {
               Class cls = Class.forName(xaDataSourceClass);
               vendorSource = (XADataSource)cls.newInstance();
  -            PrintWriter writer = new LogWriter(log);
  -            vendorSource.setLogWriter(writer);
  -            source.setLogWriter(writer);
  +//            PrintWriter writer = new LogWriter(log);
  +//            vendorSource.setLogWriter(writer);
  +//            source.setLogWriter(writer);
           } catch(Exception e) {
               e.printStackTrace();
               throw new RuntimeException("Unable to initialize XA database pool 
'"+poolName+"': "+e);
  @@ -221,8 +221,11 @@
       public void stopService() {
           // Unbind from JNDI
           try {
  -            new InitialContext().unbind("xa."+source.getPoolName());
  -            log.log("XA Connection pool "+source.getPoolName()+" removed from 
JNDI");
  +            String name = source.getPoolName();
  +            new InitialContext().unbind("xa."+name);
  +            log.log("XA Connection pool "+name+" removed from JNDI");
  +            source.close();
  +            log.log("XA Connection pool "+name+" shut down");
           } catch (NamingException e) {
               // Ignore
           }
  
  
  

Reply via email to