HHH-5744 check ResultSet#hasNext in GUIDGenerator

This commit is contained in:
Brett Meyer 2013-10-02 13:45:49 -04:00
parent bd93745aec
commit 1755f00260
1 changed files with 3 additions and 1 deletions

View File

@ -60,7 +60,9 @@ public class GUIDGenerator implements IdentifierGenerator {
ResultSet rs = session.getTransactionCoordinator().getJdbcCoordinator().getResultSetReturn().extract( st );
final String result;
try {
rs.next();
if ( !rs.next() ) {
throw new HibernateException( "The database returned no GUID identity value" );
}
result = rs.getString(1);
}
finally {