java - Hibernate 耗尽结果集
问题描述
我有一个名为 AsyncFcmNotification 的表,该表已在时间戳列上进行了分区。当我想执行这个查询时。
do {
try (HibernateSession session = SessionManager.openSession()) {
//noinspection unchecked
List<AsyncFcmNotification> asyncFcmNotifications = session.createQuery("from AsyncFcmNotification where sent = false")
.setFirstResult(offset)
.setMaxResults(count)
.list();
updateUnsendNotif(asyncFcmNotifications, session);
offset += 100;
}
logger.info(offset + " notif has updated");
} while (offset < asyncFcmNotificationsCount);
asyncFcmNotificationsCount 值为 105220;
我得到了这些例外
解决方案
推荐阅读
- r - 在 R 中使用 ggplot2 绘制包括连续和离散预测变量的多元线性回归
- c# - 当我尝试单击 WPF 中的元素时,Сombobox 关闭
- typescript - 我的 TypeScript 类未定义。我如何解决它?
- java - Spring Boot Tomcat 无法启动。初始化并停止
- macos - 如何在 Apple Numbers 中为负数添加减号
- mysql - 使用 MyISAM 是否可以更有效地恢复磁盘空间?
- python - 如何将列表列表(每个列表都包含一个整数)转换为整数列表?
- python - Seaborn 散点图帮助:使用直观的 x 轴绘制数据集
- c - 在 C 中使用 OpenGL 3.0+ 绘制多条线
- java - 为什么 Guava 中的 ListMultiMaps 没有 filterValues() 方法?