try {
Base.openTransaction();
Base.exec("start transaction");
List<Map> res = Base.findAll("select 1 from example_table where table_id = 1");
Logger.info("get the lock: " + res);
Base.commitTransaction();
Logger.info("done commit");
} catch (Exception e) {
e.printStackTrace();
Base.rollbackTransaction();
throw e;
}
List<Map> res = Base.findAll("select 1 from example_table where table_id = 1 for update");