HHH-5744 check ResultSet#hasNext in GUIDGenerator

This commit is contained in:
Brett Meyer 2013-10-02 13:45:49 -04:00
parent 5d9162dc3d
commit 13ea5a5d32
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 {