code: private void registerSynchronization(TransactionImpl odmgTrans, Transaction transaction)
      {
          // todo only need for development
          if (odmgTrans == null || transaction == null)
          {
              log.error("One of the given parameters was null --> cannot do synchronization!" +
                      " omdg transaction was null: " + (odmgTrans == null) +
                      ", external transaction was null: " + (transaction == null));
              return;
          }
  
          int status = -1; // default status.
          try
          {
              status = transaction.getStatus();
              if (status != Status.STATUS_ACTIVE)
              {
                  throw new OJBRuntimeException(
                          "Transaction synchronization failed - wrong status of external container tx: " +
                          getStatusString(status));
              }
          }
          catch (SystemException e)
          {
              throw new OJBRuntimeException("Can't read status of external tx", e);
          }
  
          try
          {
              //Sequence of the following method calls is significant
              // 1. register the synchronization with the ODMG notion of a transaction.
              transaction.registerSynchronization((J2EETransactionImpl) odmgTrans);
              // 2. mark the ODMG transaction as being in a JTA Transaction
              // Associate external transaction with the odmg transaction.
              txRepository.set(new TxBuffer(odmgTrans, transaction));
          }
          catch (Exception e)
          {
              log.error("Cannot associate PersistenceBroker with running Transaction", e);
              throw new OJBRuntimeException(
                      "Transaction synchronization failed - wrong status of external container tx", e);
          }
      }
docs: Do synchronization of the given J2EE ODMG Transaction