public static synchronized void addSpecialCommand(Command command) {
    AndroidTransaction transaction = new AndroidTransaction();
    transaction.getCommands().add(command);

    ObjectContainer sess = Database.OpenDB();
    sess.store(transaction);
    sess.commit();
  }
 public static synchronized boolean StartTransaction() {
   if (!Opened) { // can enter/can start a transaction
     transaction = new AndroidTransaction();
     session = Database.OpenDB();
     Opened = true;
     TransactionCanceled = false;
     return Opened;
   } else return !Opened;
 }
 public static synchronized void removeTransaction(AndroidTransaction x) {
   Database.OpenDB().delete(x);
   Database.OpenDB().commit();
 }
 public static synchronized ObjectSet<AndroidTransaction> getAllInstances() {
   return Database.allInstancesOrdered(AndroidTransaction.class);
 }