db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From olegn...@apache.org
Subject cvs commit: jakarta-ojb/src/java/org/apache/ojb/broker/metadata ConnectionDescriptorXmlHandler.java
Date Thu, 09 Jan 2003 23:53:11 GMT
olegnitz    2003/01/09 15:53:11

  Modified:    src/java/org/apache/ojb/broker/metadata
                        ConnectionDescriptorXmlHandler.java
  Log:
  Added check for duplicated default-connections
  
  Revision  Changes    Path
  1.3       +14 -1     jakarta-ojb/src/java/org/apache/ojb/broker/metadata/ConnectionDescriptorXmlHandler.java
  
  Index: ConnectionDescriptorXmlHandler.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ojb/src/java/org/apache/ojb/broker/metadata/ConnectionDescriptorXmlHandler.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- ConnectionDescriptorXmlHandler.java	9 Jan 2003 16:58:36 -0000	1.2
  +++ ConnectionDescriptorXmlHandler.java	9 Jan 2003 23:53:11 -0000	1.3
  @@ -85,6 +85,7 @@
       private JdbcConnectionDescriptor m_CurrentJCD;
       private SequenceDescriptor currentSequenceDescriptor;
       private List conDesList;
  +    private boolean defaultConnectionFound = false;
   
       /**
        * All known xml tags are kept in this table.
  @@ -159,6 +160,18 @@
                           String defaultConnection = atts.getValue(tags.getTagById(DEFAULT_CONNECTION));
                           if (isDebug) logger.debug("     " + tags.getTagById(DEFAULT_CONNECTION)
+ ": " + defaultConnection);
                           m_CurrentJCD.setDefaultConnection(Boolean.valueOf(defaultConnection).booleanValue());
  +                        if (m_CurrentJCD.isDefaultConnection())
  +                        {
  +                            if (defaultConnectionFound)
  +                            {
  +                                throw new MetadataException("Found two jdbc-connection-descriptor
elements with default-connection=\"true\"");
  +                            }
  +                            else
  +                            {
  +                                defaultConnectionFound = true;
  +                            }
  +                        }
  +
   
                           // set platform attribute
                           String platform = atts.getValue(tags.getTagById(DBMS_NAME));
  
  
  

Mime
View raw message