private final String postCommit(String status){
  log.info("Sta=" + status + " DT="+ getDocumentType()+ " ID="+ p_po.get_ID());
  p_Status=status;
  Trx trx=Trx.get(getTrxName(),true);
  try {
    if (status.equals(STATUS_Posted)) {
      for (int i=0; i < m_fact.size(); i++) {
        Fact fact=m_fact.get(i);
        if (fact == null)         ;
 else         if (fact.save(getTrxName()))         ;
 else {
          log.log(Level.SEVERE,"(fact not saved) ... rolling back");
          if (m_manageLocalTrx) {
            trx.rollback();
            trx.close();
          }
          unlock();
          return STATUS_Error;
        }
      }
    }
    if (!save(getTrxName())) {
      log.log(Level.SEVERE,"(doc not saved) ... rolling back");
      if (m_manageLocalTrx) {
        trx.rollback();
        trx.close();
      }
      unlock();
      return STATUS_Error;
    }
    if (m_manageLocalTrx) {
      trx.commit(true);
      trx.close();
      trx=null;
    }
  }
 catch (  Exception e) {
    log.log(Level.SEVERE,"... rolling back",e);
    status=STATUS_Error;
    if (m_manageLocalTrx) {
      try {
        if (trx != null)         trx.rollback();
      }
 catch (      Exception e2) {
      }
      try {
        if (trx != null)         trx.close();
        trx=null;
      }
 catch (      Exception e3) {
      }
    }
    unlock();
  }
  p_Status=status;
  return status;
}

private final String postCommit ( String status ) { log . info ( "Sta=" + status + " DT=" + getDocumentType ( ) + " ID=" + p_po . get_ID ( ) ) ; p_Status = status ; Trx trx = Trx . get ( getTrxName ( ) , true ) ; try { if ( status . equals ( STATUS_Posted ) ) { for ( int i = 0 ; i < m_fact . size ( ) ; i ++ ) { Fact fact = m_fact . get ( i ) ; if ( fact == null ) ; else if ( fact . save ( getTrxName ( ) ) ) ; else { log . log ( Level . SEVERE , "(fact not saved) ... rolling back" ) ; if ( m_manageLocalTrx ) { trx . rollback ( ) ; trx . close ( ) ; } unlock ( ) ; return STATUS_Error ; } } } if ( ! save ( getTrxName ( ) ) ) { log . log ( Level . SEVERE , "(doc not saved) ... rolling back" ) ; if ( m_manageLocalTrx ) { trx . rollback ( ) ; trx . close ( ) ; } unlock ( ) ; return STATUS_Error ; } if ( m_manageLocalTrx ) { trx . commit ( true ) ; trx . close ( ) ; trx = null ; } } catch ( Exception e ) { log . log ( Level . SEVERE , "... rolling back" , e ) ; status = STATUS_Error ; if ( m_manageLocalTrx ) { try { if ( trx != null ) trx . rollback ( ) ; } catch ( Exception e2 ) { } try { if ( trx != null ) trx . close ( ) ; trx = null ; } catch ( Exception e3 ) { } } unlock ( ) ; } p_Status = status ; return status ; }
post commit . save facts & document
