db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From arm...@apache.org
Subject cvs commit: db-ojb/src/java/org/apache/ojb/broker/core PersistenceBrokerHandle.java DelegatingPersistenceBroker.java
Date Thu, 09 Oct 2003 14:59:46 GMT
arminw      2003/10/09 07:59:46

  Modified:    src/test/org/apache/ojb/broker PersistenceBrokerTest.java
               src/java/org/apache/ojb/broker/core
                        PersistenceBrokerHandle.java
                        DelegatingPersistenceBroker.java
  Log:
  let the base delegate handle
  isClosed and isInTransaction method
  
  Revision  Changes    Path
  1.30      +3 -1      db-ojb/src/test/org/apache/ojb/broker/PersistenceBrokerTest.java
  
  Index: PersistenceBrokerTest.java
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/test/org/apache/ojb/broker/PersistenceBrokerTest.java,v
  retrieving revision 1.29
  retrieving revision 1.30
  diff -u -r1.29 -r1.30
  --- PersistenceBrokerTest.java	14 Aug 2003 18:42:40 -0000	1.29
  +++ PersistenceBrokerTest.java	9 Oct 2003 14:59:46 -0000	1.30
  @@ -220,18 +220,20 @@
       {
           PersistenceBroker pb = PersistenceBrokerFactory.defaultPersistenceBroker();
   
  +        assertFalse(pb.isClosed());
           pb.beginTransaction();
           assertTrue(pb.isInTransaction());
           pb.commitTransaction();
           assertFalse(pb.isInTransaction());
   
           pb.beginTransaction();
  +        assertTrue(pb.isInTransaction());
           pb.abortTransaction();
           assertFalse(pb.isInTransaction());
   
           pb.close();
           assertTrue(pb.isClosed());
  -
  +        assertFalse(pb.isInTransaction());
           try
           {
               pb.beginTransaction();
  
  
  
  1.7       +2 -5      db-ojb/src/java/org/apache/ojb/broker/core/PersistenceBrokerHandle.java
  
  Index: PersistenceBrokerHandle.java
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/java/org/apache/ojb/broker/core/PersistenceBrokerHandle.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- PersistenceBrokerHandle.java	4 Sep 2003 21:59:41 -0000	1.6
  +++ PersistenceBrokerHandle.java	9 Oct 2003 14:59:46 -0000	1.7
  @@ -19,10 +19,7 @@
   
       public boolean isClosed()
       {
  -        if (getDelegate() == null)
  -            return true;
  -        else
  -            return super.isClosed();
  +        return super.isClosed();
       }
   
       public boolean isInTransaction() throws PersistenceBrokerException
  
  
  
  1.8       +8 -8      db-ojb/src/java/org/apache/ojb/broker/core/DelegatingPersistenceBroker.java
  
  Index: DelegatingPersistenceBroker.java
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/java/org/apache/ojb/broker/core/DelegatingPersistenceBroker.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- DelegatingPersistenceBroker.java	11 Aug 2003 13:43:42 -0000	1.7
  +++ DelegatingPersistenceBroker.java	9 Oct 2003 14:59:46 -0000	1.8
  @@ -59,8 +59,8 @@
   		else
           {
               throw new IllegalStateException(
  -                    "This PersistenceBroker instance is already closed."+
  -                    " It's not possible to re-use closed instance.");
  +                    "This PersistenceBroker instance is already closed and no longer useable."
+
  +                    " It's not possible to re-use a closed instance.");
           }
   
   	}
  @@ -108,9 +108,14 @@
   		return broker;
   	}
   
  +    public boolean isInTransaction() throws PersistenceBrokerException
  +    {
  +        return m_broker != null ? getBroker().isInTransaction() : false;
  +    }
  +
   	public boolean isClosed()
   	{
  -		return getBroker().isClosed();
  +		return m_broker != null ? getBroker().isClosed() : true;
   	}
   
   	public void setClosed(boolean closed)
  @@ -133,11 +138,6 @@
   	public void abortTransaction() throws TransactionNotInProgressException
   	{
   		getBroker().abortTransaction();
  -	}
  -
  -	public boolean isInTransaction() throws PersistenceBrokerException
  -	{
  -		return getBroker().isInTransaction();
   	}
   
   	public boolean close()
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-dev-help@db.apache.org


Mime
View raw message