use of com.dangdang.ddframe.rdb.sharding.example.jdbc.service.OrderService in project sharding-jdbc by dangdangdotcom.
the class Main method main.
public static void main(final String[] args) {
// CHECKSTYLE:ON
ApplicationContext applicationContext = new ClassPathXmlApplicationContext("META-INF/mybatisContext.xml");
OrderService orderService = applicationContext.getBean(OrderService.class);
orderService.clear();
orderService.fooService();
orderService.select();
//[order_id: , user_id: 10, status: UPDATED, order_id: , user_id: 11, status: UPDATED]
orderService.clear();
try {
orderService.fooServiceWithFailure();
} catch (final IllegalArgumentException e) {
System.out.println("roll back");
}
//[]
orderService.select();
}
Aggregations