同一个事务的读未提交

在同一个事务里面, 若是是 保存或者更新一个 对象数据, 而后 再次执行查询,java

那么获取的是  该对象 未提交的值。code

FreeMarketGoodsItemPriceLog log = freeMarketGoodsItemPriceLogService.getObjById(1L);
		log.setModifiedTime(new Date());
		freeMarketGoodsItemPriceLogService.update(log);

		FreeMarketGoodsItemPriceLog log2 = freeMarketGoodsItemPriceLogService.getObjById(1L);
		System.out.println(">>>>>" + log2.getModifiedTime());// 能够获取当前 未提交的事务的 时间值

我一直觉得  事务未提交,在同一个事务里面就不能查询获取未提交的值了,实际上是能够的。 对象

相关文章
相关标签/搜索