db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mattba...@apache.org
Subject cvs commit: db-ojb/src/java/org/apache/ojb/otm/transaction LocalTransactionFactory.java
Date Mon, 18 Aug 2003 16:28:44 GMT
mattbaird    2003/08/18 09:28:44

  Modified:    src/java/org/apache/ojb/otm/transaction
                        LocalTransactionFactory.java
  Log:
  better error message
  
  Revision  Changes    Path
  1.6       +9 -3      db-ojb/src/java/org/apache/ojb/otm/transaction/LocalTransactionFactory.java
  
  Index: LocalTransactionFactory.java
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/java/org/apache/ojb/otm/transaction/LocalTransactionFactory.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- LocalTransactionFactory.java	25 Jul 2003 00:22:00 -0000	1.5
  +++ LocalTransactionFactory.java	18 Aug 2003 16:28:44 -0000	1.6
  @@ -54,14 +54,14 @@
    * <http://www.apache.org/>.
    */
   
  -import java.util.HashMap;
  -
   import org.apache.ojb.broker.PBKey;
   import org.apache.ojb.otm.OTMConnection;
   import org.apache.ojb.otm.core.BaseConnection;
   import org.apache.ojb.otm.core.Transaction;
   import org.apache.ojb.otm.core.TransactionException;
   
  +import java.util.HashMap;
  +
   /**
    *
    * Factory for local transactions. Each OTMConnection is associated with exactly one transaction.
  @@ -86,7 +86,13 @@
       {
           if (!(connection instanceof BaseConnection))
           {
  -            throw new TransactionFactoryException("Unknown connection type");
  +			StringBuffer msg = new StringBuffer();
  +			msg.append("Unknown connection type: ");
  +			if (connection != null)
  +				msg.append(connection.getClass().getName());
  +			else
  +				msg.append(" null. Make sure you pass a non-null OTMConnection to this method. An OTMConnection
can be acquired by calling acquireConnection (PBKey pbKey)");
  +            throw new TransactionFactoryException(msg.toString());
           }
   
           Transaction tx = (Transaction) _transactionMap.get(connection);
  
  
  

---------------------------------------------------------------------
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