maven
<!-- https://mvnrepository.com/artifact/org.nutz/nutz-integration-quartz -->
<dependency>
<groupId>org.nutz</groupId>
<artifactId>nutz-integration-quartz</artifactId>
<version>1.r.63.r5</version>
</dependency>
public class MainSetupBy implements Setup {
@Override
public void init(NutConfig nc) {
nc.getIoc().get(Scheduler.class);
Dao dao = nc.getIoc().get(Dao.class, "dao");
NutTxDao tx1 = new NutTxDao(dao).setDebug(true);
Record re = dao.fetch("book", Cnd.where("id", "=", 3));
System.out.println(re.getString("name"));
try {
tx1.beginRC();
tx1.update(Book.class, Chain.make("name", "化学"), Cnd.where("id", "=", "3"));
tx1.update(Book.class, Chain.make("name", "化学"), Cnd.where("id", "=", "4"));
tx1.commit();
} catch (Throwable e) {
tx1.rollback();
} finally {
tx1.close();
}
}
}
@IocBy(type=ComboIocProvider.class, args={
"*js", "ioc/",
"*anno", "com.lx.demo",
"*tx",
"*quartz"})