db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From arm...@apache.org
Subject cvs commit: jakarta-ojb/src/java/org/apache/ojb/broker/metadata RepositoryPersistor.java
Date Fri, 10 Jan 2003 17:04:36 GMT
arminw      2003/01/10 09:04:36

  Modified:    src/test/org/apache/ojb/odmg OQLOrOnForeignKeyTest.java
               src/java/org/apache/ojb/broker/ta
                        PersistenceBrokerFactoryDefaultImpl.java
               src/java/org/apache/ojb/broker/singlevm
                        PersistenceBrokerImpl.java
               src/java/org/apache/ojb/broker/metadata
                        RepositoryPersistor.java
  Log:
  workaround for crimson parser when setFeature(..)
  was called (fix jboss xml-parsing failure),
  add check for 'null' argument
  
  Revision  Changes    Path
  1.3       +4 -3      jakarta-ojb/src/test/org/apache/ojb/odmg/OQLOrOnForeignKeyTest.java
  
  Index: OQLOrOnForeignKeyTest.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ojb/src/test/org/apache/ojb/odmg/OQLOrOnForeignKeyTest.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- OQLOrOnForeignKeyTest.java	9 Jan 2003 17:25:19 -0000	1.2
  +++ OQLOrOnForeignKeyTest.java	10 Jan 2003 17:04:34 -0000	1.3
  @@ -158,13 +158,14 @@
   		father.setId(fatherID);
   		mother.setFirstname("mom");
   		father.setFirstname("dad");
  +
   		jimmy.setMother(mother);
   		jimmy.setFirstname("jimmy");
   		jimmy.setId(jimmyID);
   
   		joe.setFather(father);
  -		jimmy.setFirstname("joe");
  -		jimmy.setId(joeID);
  +		joe.setFirstname("joe");
  +		joe.setId(joeID);
   
   
   		Implementation odmg = OJB.getInstance();
  @@ -187,7 +188,7 @@
   		query.bind(new Integer(motherID));
   		query.bind(new Integer(fatherID));
   		List persons = (List) query.execute();
  -		assertTrue(persons.size() == 2);
  +		assertEquals(2, persons.size());
   		tx.commit();
   
   	}
  
  
  
  1.31      +4 -1      jakarta-ojb/src/java/org/apache/ojb/broker/ta/PersistenceBrokerFactoryDefaultImpl.java
  
  Index: PersistenceBrokerFactoryDefaultImpl.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ojb/src/java/org/apache/ojb/broker/ta/PersistenceBrokerFactoryDefaultImpl.java,v
  retrieving revision 1.30
  retrieving revision 1.31
  diff -u -r1.30 -r1.31
  --- PersistenceBrokerFactoryDefaultImpl.java	9 Jan 2003 17:08:45 -0000	1.30
  +++ PersistenceBrokerFactoryDefaultImpl.java	10 Jan 2003 17:04:34 -0000	1.31
  @@ -145,6 +145,8 @@
                   return new PBKey(descriptor.getJcdAlias(),descriptor.getUserName(), descriptor.getPassWord());
               }
           }
  +        log.warn("### No 'default' jdbc-connection-descriptor defined," +
  +                " you could not use the 'defaultPersistenceBroker()' method ###");
           return null;
       }
   
  @@ -173,6 +175,7 @@
        */
       protected PersistenceBroker createNewBrokerInstance(PBKey key) throws PBFactoryException
       {
  +        if(key == null) throw new PBFactoryException("Could not create new broker with
PBkey argument 'null'");
           if (log.isEnabledFor(Logger.INFO))
           {
               // only count created instances when INFO-Log-Level
  
  
  
  1.109     +2 -1      jakarta-ojb/src/java/org/apache/ojb/broker/singlevm/PersistenceBrokerImpl.java
  
  Index: PersistenceBrokerImpl.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ojb/src/java/org/apache/ojb/broker/singlevm/PersistenceBrokerImpl.java,v
  retrieving revision 1.108
  retrieving revision 1.109
  diff -u -r1.108 -r1.109
  --- PersistenceBrokerImpl.java	9 Jan 2003 17:08:44 -0000	1.108
  +++ PersistenceBrokerImpl.java	10 Jan 2003 17:04:35 -0000	1.109
  @@ -186,6 +186,7 @@
       public PersistenceBrokerImpl(PBKey key, PersistenceBrokerFactoryIF pbf)
       {
           refresh();
  +        if(key == null) throw new PersistenceBrokerException("Could not instantiate broker
with PBKey 'null'");
           this.pbf = pbf;
           this.pbKey = key;
           brokerHelper = new BrokerHelper(this);
  
  
  
  1.14      +10 -2     jakarta-ojb/src/java/org/apache/ojb/broker/metadata/RepositoryPersistor.java
  
  Index: RepositoryPersistor.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ojb/src/java/org/apache/ojb/broker/metadata/RepositoryPersistor.java,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- RepositoryPersistor.java	4 Jan 2003 00:52:34 -0000	1.13
  +++ RepositoryPersistor.java	10 Jan 2003 17:04:36 -0000	1.14
  @@ -258,10 +258,18 @@
           /**
            * MBAIRD: It's possible that the SAX implementation doesn't support this feature
            * so we try and catch the SAXNotSupportedException and just ignore it.
  +         *
  +         * arminw:
  +         * this ugly workaround if()-statement was necessary, because when setFeature(..)
was
  +         * called on crimson parser does not find any relative path
  +         * TODO better solution
            */
   		try
   		{
  -	        reader.setFeature("http://xml.org/sax/features/validation", true);
  +	        if(reader.getClass().getName().indexOf("crimson") != -1)
  +            {
  +                reader.setFeature("http://xml.org/sax/features/validation", true);
  +            }
   		}
   		catch (SAXNotSupportedException snse)
   		{
  
  
  

Mime
View raw message