diff --git a/modules/apps/journal/journal-service/src/main/java/com/liferay/journal/internal/upgrade/v5_1_1/JournalArticleAssetEntryClassTypeIdUpgradeProcess.java b/modules/apps/journal/journal-service/src/main/java/com/liferay/journal/internal/upgrade/v5_1_1/JournalArticleAssetEntryClassTypeIdUpgradeProcess.java index c38e903186301c..7a531c8c6efa3b 100644 --- a/modules/apps/journal/journal-service/src/main/java/com/liferay/journal/internal/upgrade/v5_1_1/JournalArticleAssetEntryClassTypeIdUpgradeProcess.java +++ b/modules/apps/journal/journal-service/src/main/java/com/liferay/journal/internal/upgrade/v5_1_1/JournalArticleAssetEntryClassTypeIdUpgradeProcess.java @@ -7,6 +7,7 @@ import com.liferay.journal.model.JournalArticle; import com.liferay.petra.string.StringBundler; +import com.liferay.portal.kernel.dao.jdbc.AutoBatchPreparedStatementUtil; import com.liferay.portal.kernel.log.Log; import com.liferay.portal.kernel.log.LogFactoryUtil; import com.liferay.portal.kernel.service.ClassNameLocalService; @@ -49,9 +50,11 @@ protected void doUpgrade() throws Exception { " and (AssetEntry.classPK = JournalArticle.id_ or ", "AssetEntry.classPK = JournalArticle.resourcePrimKey) and ", "AssetEntry.classTypeId != JournalArticle.DDMStructureId")); - PreparedStatement preparedStatement2 = connection.prepareStatement( - "update AssetEntry set classTypeId = ? where entryId = ? and " + - "ctCollectionId = ?"); + PreparedStatement preparedStatement2 = + AutoBatchPreparedStatementUtil.autoBatch( + connection, + "update AssetEntry set classTypeId = ? where entryId = ? " + + "and ctCollectionId = ?"); ResultSet resultSet = preparedStatement1.executeQuery()) { while (resultSet.next()) {