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/odmg TransactionImpl.java
Date Fri, 14 Mar 2003 01:35:06 GMT
arminw      2003/03/13 17:35:06

  Modified:    src/java/org/apache/ojb/odmg TransactionImpl.java
  Log:
  remove uncommented lines,
  use checkOpen() instead isOpen()
  in getBroker()
  
  Revision  Changes    Path
  1.36      +14 -43    db-ojb/src/java/org/apache/ojb/odmg/TransactionImpl.java
  
  Index: TransactionImpl.java
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/java/org/apache/ojb/odmg/TransactionImpl.java,v
  retrieving revision 1.35
  retrieving revision 1.36
  diff -u -r1.35 -r1.36
  --- TransactionImpl.java	2 Feb 2003 16:18:48 -0000	1.35
  +++ TransactionImpl.java	14 Mar 2003 01:35:06 -0000	1.36
  @@ -124,6 +124,7 @@
       protected PersistenceBroker broker = null;
       private HashMap registeredForLock = new HashMap();
       private OJBTxManager txManager;
  +
       /**
        * The status of the current transaction, as specified by the
        * javax.transaction package.
  @@ -796,7 +797,7 @@
                   && (ref != null))
                  // && (!(ref instanceof VirtualProxy))
                  // && (!(ref instanceof Proxy)))
  -            {  
  +            {
               	Object refInstance = ref;
               	if (ref instanceof VirtualProxy)
               	{
  @@ -805,10 +806,10 @@
               	else if (ref instanceof Proxy)
               	{
               		IndirectionHandler ih = (IndirectionHandler) Proxy.getInvocationHandler(ref);
  -            		refInstance = ih.getRealSubject();	
  +            		refInstance = ih.getRealSubject();
               	}
  -            	                         
  -                ClassDescriptor refCld = this.getBroker().getClassDescriptor(refInstance.getClass());
               
  +
  +                ClassDescriptor refCld = this.getBroker().getClassDescriptor(refInstance.getClass());
                   Object[] refPkValues = getBroker().serviceBrokerHelper().getKeyValues(refCld,
refInstance, false);
   
                   ClassDescriptor objCld = this.getBroker().getClassDescriptor(obj.getClass());
  @@ -1106,25 +1107,17 @@
       {
           if (broker == null)
           {
  -            if (this.isOpen())
  +            checkOpen();
  +            try
               {
  -                try
  -                {
  -                    checkForDB();
  -                    broker = PersistenceBrokerFactory.createPersistenceBroker(curDB.getPBKey());
  -                }
  -                catch (PBFactoryException e)
  -                {
  -                    log.error("Cannot obtain PersistenceBroker from PersistenceBrokerFactory,
" +
  -                            "found PBKey was " + curDB.getPBKey(), e);
  -                    throw new PersistenceBrokerException(e);
  -                }
  +                checkForDB();
  +                broker = PersistenceBrokerFactory.createPersistenceBroker(curDB.getPBKey());
               }
  -            else
  +            catch (PBFactoryException e)
               {
  -                throw new TransactionNotInProgressException(
  -                        "Cannot obtain a broker from a transaction that is not open. TX
Status: " +
  -                        TxUtil.getStatusString(getStatus()));
  +                log.error("Cannot obtain PersistenceBroker from PersistenceBrokerFactory,
" +
  +                        "found PBKey was " + curDB.getPBKey(), e);
  +                throw new PersistenceBrokerException(e);
               }
           }
           return broker;
  @@ -1140,26 +1133,4 @@
           useWriteLocks = odmgConfig.lockAssociationAsWrites();
           useImplicitLocking = odmgConfig.useImplicitLocking();
       }
  -
  -// arminw: commented out unused methods
  -//    private void internalBegin()
  -//    {
  -//
  -//    }
  -//
  -//    private void internalCommit()
  -//    {
  -//
  -//    }
  -//
  -//    private void internalClose()
  -//    {
  -//
  -//    }
  -//
  -//    private void internalPrepare()
  -//    {
  -//
  -//    }
  -
   }
  
  
  

Mime
View raw message