You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ojb-dev@db.apache.org by ar...@apache.org on 2003/03/14 02:35:06 UTC
cvs commit: db-ojb/src/java/org/apache/ojb/odmg TransactionImpl.java
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()
-// {
-//
-// }
-
}