public static void disconnectFromDatabase(LogicObject database) {
    { Stella_Object connection = Logic.accessBinaryValue(database, RDBMS.SGT_RDBMS_DB_CONNECTION);

      if (Surrogate.subtypeOfP(Stella_Object.safePrimaryType(connection), RDBMS.SGT_RDBMS_CONNECTION_WRAPPER)) {
        { ConnectionWrapper connection000 = ((ConnectionWrapper)(connection));

          if (connection000.wrapperValue != null) {
            edu.isi.sdbc.Connection.disconnect(connection000.wrapperValue);
          }
          { Object old$Module$000 = Stella.$MODULE$.get();
            Object old$Context$000 = Stella.$CONTEXT$.get();

            try {
              Native.setSpecial(Stella.$MODULE$, ((Context)(Stella.$CONTEXT$.get())).baseModule);
              Native.setSpecial(Stella.$CONTEXT$, ((Module)(Stella.$MODULE$.get())));
              edu.isi.powerloom.PLI.retractNaryProposition(Cons.cons(Logic.getRelation(RDBMS.SGT_RDBMS_DB_CONNECTION), Cons.cons(database, Cons.cons(connection000, Stella.NIL))), null, null);

            } finally {
              Stella.$CONTEXT$.set(old$Context$000);
              Stella.$MODULE$.set(old$Module$000);
            }
          }
        }
      }
      else {
      }
    }
  }