1 23 24 27 28 package com.sun.jdo.spi.persistence.support.sqlstore.state; 29 30 import com.sun.jdo.spi.persistence.utility.I18NHelper; 31 import com.sun.jdo.spi.persistence.support.sqlstore.ActionDesc; 32 33 import java.util.ResourceBundle ; 34 35 public class PersistentNonTransactional extends LifeCycleState { 36 39 private final static ResourceBundle messages = I18NHelper.loadBundle( 40 "com.sun.jdo.spi.persistence.support.sqlstore.Bundle", PersistentNonTransactional.class.getClassLoader()); 42 43 public PersistentNonTransactional() { 44 isPersistent = true; 49 isPersistentInDataStore = true; 50 isTransactional = false; 51 isDirty = false; 52 isNew = false; 53 isDeleted = false; 54 isNavigable = true; 55 isRefreshable = false; 56 isBeforeImageUpdatable = false; 57 needsRegister = false; 58 needsReload = false; 59 needsRestoreOnRollback = false; 60 updateAction = ActionDesc.LOG_NOOP; 61 stateType = P_NON_TX; 62 } 63 64 67 public LifeCycleState transitionDeletePersistent() { 68 return changeState(P_DELETED); 69 } 70 71 public LifeCycleState transitionWriteField(boolean transactionActive) { 72 if (transactionActive) { 73 return changeState(P_DIRTY); 74 } else { 75 return this; 76 } 77 } 78 79 public LifeCycleState transitionReload(boolean transactionActive) { 80 if (!transactionActive) { 81 return this; 82 } else { 83 return changeState(P_CLEAN); 84 } 85 } 86 87 public boolean needsReload(boolean optimistic, 88 boolean nontransactionalRead, 89 boolean transactionActive) { 90 if (optimistic || !transactionActive) { 94 return false; 95 } 96 97 return true; 98 } 99 100 } 101 102 103 104 | Popular Tags |