Spring配置,事务使用

1、spring redis session超时配置

<bean class="org.springframework.session.data.redis.config.annotation.web.http.RedisHttpSessionConfiguration">

<!-- 过期时间4小时 -->
     <property name="maxInactiveIntervalInSeconds" value="14400"></property>
 </bean>

2、spring 事物使用

public void doDel(){
final List<Object[]> list = new ArrayList<Object[]>();
TsJdbcTemplate template = TsJdbcSingletonProvider.get().getTsJdbcTemplateByTable(TicketHelper.PLUGIN_ID, "TABLE");
template.execute(new TransactionCallbackWithoutResult() { @Override
protected void doInTransactionWithoutResult(TransactionStatus status) { TsJdbcSingletonProvider.get().getTsJdbcTemplateByTable(TicketHelper.PLUGIN_ID, "TABLE").batchUpdate("", list);
// 批量操作
}
});
}
上一篇:洛谷 P4168 [Violet] 蒲公英


下一篇:vuejs - the component is a fragment instance