首页 > 解决方案 > 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;

我得到了这些例外

在此处输入图像描述

标签: javasqloraclehibernate

解决方案


推荐阅读