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/08/09 15:58:30 UTC
cvs commit: db-ojb/src/java/org/apache/ojb/odmg OJBJ2EE_2.java NarrowTransaction.java
arminw 2003/08/09 06:58:30
Modified: src/java/org/apache/ojb/odmg OJBJ2EE_2.java
NarrowTransaction.java
Log:
fix bug,
allow proprietary extensions of the
Transaction interface in managed environments
too, thus we use TransactionExt
Revision Changes Path
1.8 +6 -2 db-ojb/src/java/org/apache/ojb/odmg/OJBJ2EE_2.java
Index: OJBJ2EE_2.java
===================================================================
RCS file: /home/cvs/db-ojb/src/java/org/apache/ojb/odmg/OJBJ2EE_2.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- OJBJ2EE_2.java 14 Mar 2003 01:38:15 -0000 1.7
+++ OJBJ2EE_2.java 9 Aug 2003 13:58:30 -0000 1.8
@@ -54,8 +54,12 @@
public Transaction currentTransaction()
{
beginInternTransaction();
- // we wrap the intern odmg transaction to avoid unauthorised calls
- return new NarrowTransaction(super.currentTransaction());
+ /*
+ we wrap the intern odmg transaction to avoid unauthorised calls
+ since we use proprietary extensions for Transaction interface
+ do cast to enhanced interface
+ */
+ return new NarrowTransaction((TransactionExt) super.currentTransaction());
}
public EnhancedOQLQuery newOQLQuery()
1.4 +20 -4 db-ojb/src/java/org/apache/ojb/odmg/NarrowTransaction.java
Index: NarrowTransaction.java
===================================================================
RCS file: /home/cvs/db-ojb/src/java/org/apache/ojb/odmg/NarrowTransaction.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- NarrowTransaction.java 20 Dec 2002 02:13:39 -0000 1.3
+++ NarrowTransaction.java 9 Aug 2003 13:58:30 -0000 1.4
@@ -7,18 +7,34 @@
import org.apache.ojb.broker.PersistenceBrokerException;
/**
+ * Wraps {@link org.odmg.Transaction} in managed environments.
*
* @author <a href="mailto:armin@codeAuLait.de">Armin Waibel</a>
*/
-public class NarrowTransaction implements Transaction, HasBroker
+public class NarrowTransaction implements TransactionExt
{
- private Transaction tx;
+ private TransactionExt tx;
- public NarrowTransaction(Transaction tx)
+ public NarrowTransaction(TransactionExt tx)
{
this.tx = tx;
}
+ public void markDelete(Object anObject)
+ {
+ this.tx.markDelete(anObject);
+ }
+
+ public void markDirty(Object anObject)
+ {
+ this.tx.markDirty(anObject);
+ }
+
+ public void flush()
+ {
+ tx.flush();
+ }
+
/**
* Return associated PB instance, or null if not found.
*/
@@ -106,7 +122,7 @@
{
return tx.tryLock(obj, lockMode);
}
-
+
public Object getObjectByIdentity(Identity id)
throws PersistenceBrokerException
{
---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-dev-help@db.apache.org