Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Commit

Permalink
Merge pull request #70 from zanata/rhbz980271
Browse files Browse the repository at this point in the history
Add workaround for empty ResultSet
  • Loading branch information
Patrick Huang committed Jul 23, 2013
2 parents 902e80b + 3fc3e21 commit 17b49d2
Showing 1 changed file with 7 additions and 2 deletions.
Expand Up @@ -25,9 +25,11 @@
import java.util.Iterator;
import java.util.NoSuchElementException;

import org.hibernate.HibernateException;
import lombok.extern.slf4j.Slf4j;

import org.hibernate.ScrollableResults;

@Slf4j
class ScrollableResultsIterator implements Iterator<Object[]>, Closeable
{
private boolean closed;
Expand Down Expand Up @@ -82,8 +84,11 @@ public boolean hasNext()
catch (RuntimeException e)
{
// UGLY hack to work around https://hibernate.atlassian.net/browse/HHH-2811
if (e.getMessage() != null && e.getMessage().contains("could not perform sequential read of results (forward)"))
if (e.getMessage() != null &&
(e.getMessage().contains("could not perform sequential read of results (forward)") ||
e.getMessage().contains("could not doAfterTransactionCompletion sequential read of results (forward)")))
{
log.debug("assuming empty ResultSet", e);
close();
return false;
}
Expand Down

0 comments on commit 17b49d2

Please sign in to comment.