/** * Convenience accessor for setting a transaction option. * @param option option name * @param value The value */ public void setOption(String option, int value) { om.getTransaction().setOption(option, value); }
/** * Convenience accessor for setting a transaction option. * @param option option name * @param value The value */ public void setOption(String option, String value) { om.getTransaction().setOption(option, value); }
/** * Indicate whether a transaction is in progress. * @throws PersistenceException if an unexpected error condition is encountered. */ public boolean isActive() { return om.getTransaction().isActive(); }
/** * Convenience accessor for setting a transaction option. * @param option option name * @param value The value */ public void setOption(String option, int value) { om.getTransaction().setOption(option, value); }
/** * Convenience accessor for setting a transaction option. * @param option option name * @param value The value */ public void setOption(String option, boolean value) { om.getTransaction().setOption(option, value); }
/** * Indicate whether a transaction is in progress. * @throws PersistenceException if an unexpected error condition is encountered. */ public boolean isActive() { return om.getTransaction().isActive(); }
/** * Convenience accessor for setting a transaction option. * @param option option name * @param value The value */ public void setOption(String option, boolean value) { om.getTransaction().setOption(option, value); }
/** * Convenience accessor for setting a transaction option. * @param option option name * @param value The value */ public void setOption(String option, String value) { om.getTransaction().setOption(option, value); }
/** * Convenience method to throw an exception if the transaction is active. * @throws IllegalStateException Thrown if the transaction is active. */ protected void assertNotActive() { if (om.getTransaction().isActive()) { throw new IllegalStateException(LOCALISER.msg("015032")); } } }
/** * Convenience method to throw an exception if the transaction is not active. * @throws IllegalStateException Thrown if the transaction is not active. */ protected void assertActive() { if (!om.getTransaction().isActive()) { throw new IllegalStateException(LOCALISER.msg("015040")); } } }
/** * Convenience method to throw an exception if the transaction is not active. * @throws IllegalStateException Thrown if the transaction is not active. */ protected void assertActive() { if (!om.getTransaction().isActive()) { throw new IllegalStateException(LOCALISER.msg("015040")); } }
/** * Determine whether the current transaction has been marked for rollback. * @throws IllegalStateException if isActive() is false. */ public boolean getRollbackOnly() { assertActive(); return om.getTransaction().getRollbackOnly(); }
/** * Determine whether the current transaction has been marked for rollback. * @throws IllegalStateException if isActive() is false. */ public boolean getRollbackOnly() { assertActive(); return om.getTransaction().getRollbackOnly(); }
/** * Mark the current transaction so that the only possible outcome of the transaction is for the transaction to be rolled back. * @throws IllegalStateException Thrown if the transaction is not active */ public void setRollbackOnly() { assertActive(); om.getTransaction().setRollbackOnly(); }
/** * Mark the current transaction so that the only possible outcome of the transaction is for the transaction to be rolled back. * @throws IllegalStateException Thrown if the transaction is not active */ public void setRollbackOnly() { assertActive(); om.getTransaction().setRollbackOnly(); }
/** * Method to transition when serialised. * @param sm State Manager * @return The new LifeCycle state */ public LifeCycleState transitionSerialize(StateManager sm) { Transaction tx = sm.getObjectManager().getTransaction(); if (tx.isActive() && !tx.getOptimistic()) { return changeState(sm, P_CLEAN); } return this; }
/** * Method to transition to write-field state. * @param sm StateManager. * @return new LifeCycle state. **/ public LifeCycleState transitionWriteField(StateManager sm) { Transaction tx = sm.getObjectManager().getTransaction(); if (tx.getRestoreValues()) { sm.saveFields(); } return changeState(sm, P_DIRTY); }
/** * * Constructor for instantiating the Force.com object manager. * * @param apmf Persistence Manager Factory * @param userName Username for the datastore * @param password Password for the datastore */ public ForceJDOPersistenceManager(JDOPersistenceManagerFactory apmf, String userName, String password) { super(apmf, userName, password); this.objectMgr = new ForceObjectManagerImpl(apmf, this, userName, password); fetchPlan = new JDOFetchPlan(objectMgr.getFetchPlan()); setTransaction(objectMgr.getTransaction()); } }
/** * Method to transition to write-field state. * @param sm StateManager. * @return new LifeCycle state. */ public LifeCycleState transitionWriteField(StateManager sm) { Transaction tx = sm.getObjectManager().getTransaction(); if (!tx.isActive() && !tx.getNontransactionalWrite()) { throw new NucleusUserException(LOCALISER.msg("027001"), sm.getInternalObjectId()); } return changeState(sm, tx.isActive() ? P_DIRTY : P_NONTRANS); }
/** * Method to transition to write-field state. * @param sm StateManager. * @return new LifeCycle state. */ public LifeCycleState transitionWriteField(StateManager sm) { Transaction tx = sm.getObjectManager().getTransaction(); if (!tx.isActive() && !tx.getNontransactionalWrite()) { throw new NucleusUserException(LOCALISER.msg("027001"), sm.getInternalObjectId()); } return changeState(sm, tx.isActive() ? P_DIRTY : P_NONTRANS); }