1 21 package oracle.toplink.essentials.internal.ejb.cmp3.transaction.base; 23 24 import oracle.toplink.essentials.exceptions.TransactionException; 25 import oracle.toplink.essentials.internal.ejb.cmp3.base.*; 26 import oracle.toplink.essentials.internal.sessions.UnitOfWorkImpl; 27 28 public abstract class TransactionWrapperImpl { 29 30 protected EntityManagerImpl entityManager = null; 31 32 protected RepeatableWriteUnitOfWork localUOW; 35 36 protected Object txnKey; 38 39 40 public TransactionWrapperImpl(EntityManagerImpl entityManager){ 41 this.entityManager = entityManager; 42 } 43 44 50 public abstract Object checkForTransaction(boolean validateExistence); 51 52 56 public void clear(){ 57 if (this.localUOW != null){ 58 this.localUOW.clear(); 59 } 60 } 61 62 70 public abstract RepeatableWriteUnitOfWork getTransactionalUnitOfWork(Object transaction); 71 72 public abstract void registerUnitOfWorkWithTxn(UnitOfWorkImpl uow); 73 74 public UnitOfWorkImpl getLocalUnitOfWork(){ 75 return localUOW; 76 } 77 78 public void setLocalUnitOfWork(RepeatableWriteUnitOfWork uow){ 79 this.localUOW = uow; 80 } 81 82 88 public void setRollbackOnlyInternal(){ 89 } 92 93 97 public abstract boolean shouldClose(); 98 99 103 public abstract boolean shouldFlushBeforeQuery(UnitOfWorkImpl uow); 104 105 110 public abstract void markLastTransaction(); 111 public abstract boolean hasLastTransactionCompleted(); 112 } 113 | Popular Tags |