User: mulder  
  Date: 00/09/27 06:38:15

  Modified:    src/main/org/jboss/jdbc XADataSourceLoader.java
  Log:
  Try to avoid the URL errors - save the URL that was used, even it was
  invalid.  I'm not convinced this won't just shift the problem to another
  variable, but it's worth a try.
  
  Revision  Changes    Path
  1.10      +9 -3      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.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- XADataSourceLoader.java   2000/09/13 12:14:01     1.9
  +++ XADataSourceLoader.java   2000/09/27 13:38:14     1.10
  @@ -29,12 +29,13 @@
    * 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.9 $
  + * @version $Revision: 1.10 $
    * @author Aaron Mulder ([EMAIL PROTECTED])
    */
   public class XADataSourceLoader extends ServiceMBeanSupport
           implements XADataSourceLoaderMBean {
       private XAPoolDataSource source;
  +    private String url;
   
       public XADataSourceLoader() {}
   
  @@ -53,6 +54,7 @@
       }
   
       public void setURL(String url) {
  +        this.url = url == null ? "" : url;  // Save URL, so it doesn't disappear 
from the JCML file
           XADataSource vendorSource = (XADataSource)source.getDataSource();
           try {
               Class cls = vendorSource.getClass();
  @@ -66,14 +68,18 @@
       }
   
       public String getURL() {
  +        String result = "";
           XADataSource vendorSource = (XADataSource)source.getDataSource();
           try {
               Class cls = vendorSource.getClass();
               Method getURL = cls.getMethod("getURL", new Class[0]);
  -            return (String) getURL.invoke(vendorSource, new Object[0]);
  +            result =  (String) getURL.invoke(vendorSource, new Object[0]);
           } catch(Exception e) {
  -            return "";
  +            log.error("There seems to be a problem with the JDBC URL: "+e);
           }
  +        if(result == null || result.length() == 0)
  +            result = url;
  +        return result;
       }
   
       public void setProperties(String properties) {
  
  
  

Reply via email to