/**
   * Save Selection
   *
   * @return asi which was saved or null
   * @return true if saved
   */
  private MAttributeSetInstance saveSelection() {
    final IMutable<MAttributeSetInstance> asiRef = new Mutable<>();
    trxManager.run(
        new TrxRunnableAdapter() {
          @Override
          public void run(String localTrxName) throws Exception {
            final MAttributeSetInstance asi = saveSelection0();
            asiRef.setValue(asi);
          }
        });

    return asiRef.getValue();
  }
  private boolean addGLJournalLine(final I_GL_JournalLine glJournalLine) {
    final AtomicBoolean addedRef = new AtomicBoolean(false);
    trxManager.run(
        getTrxNameInitial(),
        new TrxRunnable() {

          @Override
          public void run(final String localTrxName) throws Exception {
            final boolean added = addGLJournalLine0(glJournalLine);
            addedRef.set(added);
          }
        });

    return addedRef.get();
  }
예제 #3
0
  @Test
  public void test_GuaranteedPOBufferedIterator_changingData() throws Exception {
    final ITrxManager trxManager = Services.get(ITrxManager.class);
    final String trxName = trxManager.createTrxName("Test");
    trxManager.run(
        trxName,
        new TrxRunnable() {

          @Override
          public void run(final String localTrxName) throws Exception {
            test_GuaranteedPOBufferedIterator_changingData(localTrxName);
          }
        });

    DB.rollback(true, trxName);
  }