HHH-3675 - Limitations on Sybase ResultSet implementation causes unit test failures

git-svn-id: https://svn.jboss.org/repos/hibernate/core/trunk@15726 1b8cb986-b30d-0410-93ca-fae66ebed9b2
This commit is contained in:
Gail Badner 2008-12-22 23:31:15 +00:00
parent 76c4685117
commit 07999ce59c
2 changed files with 8 additions and 4 deletions

View File

@ -107,6 +107,10 @@ public class AggressiveReleaseTest extends ConnectionManagementTestCase {
// expected behavior // expected behavior
} }
// getting the first row only because Sybase throws NullPointerException
// if data is not read before closing the ResultSet
sr.next();
// Closing the ScrollableResults does currently force the batcher to // Closing the ScrollableResults does currently force the batcher to
// aggressively release the connection // aggressively release the connection
sr.close(); sr.close();

View File

@ -442,8 +442,8 @@ public class CMTTest extends FunctionalTestCase {
SimpleJtaTransactionManagerImpl.getInstance().begin(); SimpleJtaTransactionManagerImpl.getInstance().begin();
s = getSessions().getCurrentSession(); s = getSessions().getCurrentSession();
results = s.createQuery( "from Item" ).scroll(); results = s.createQuery( "from Item" ).scroll();
while ( !results.isLast() ) { while ( results.next() ) {
results.next(); // do nothing
} }
SimpleJtaTransactionManagerImpl.getInstance().getTransaction().commit(); SimpleJtaTransactionManagerImpl.getInstance().getTransaction().commit();
@ -451,8 +451,8 @@ public class CMTTest extends FunctionalTestCase {
SimpleJtaTransactionManagerImpl.getInstance().begin(); SimpleJtaTransactionManagerImpl.getInstance().begin();
s = getSessions().getCurrentSession(); s = getSessions().getCurrentSession();
results = s.createQuery( "from Item" ).scroll(); results = s.createQuery( "from Item" ).scroll();
while ( !results.isLast() ) { while ( results.next() ) {
results.next(); // do nothing
} }
results.close(); results.close();
SimpleJtaTransactionManagerImpl.getInstance().getTransaction().commit(); SimpleJtaTransactionManagerImpl.getInstance().getTransaction().commit();