code: public void closeContext()
          throws EFapsException
      {
          if (isLogedIn()) {
              try {
                  if (!Context.isTMNoTransaction()) {
                      if (Context.isTMActive()) {
                          Context.commit();
                      } else {
                          Context.rollback();
                      }
                  }
              } catch (final SecurityException e) {
                  throw new EFapsException("SecurityException", e);
              } catch (final IllegalStateException e) {
                  throw new EFapsException("IllegalStateException", e);
              }
          }
      }
docs: Method that closes the opened Context {@link #openContext()}, by
  committing or rollback it.
  @throws EFapsException on error
  
  @see #detach()