@@ -38,6 +38,7 @@ public static void beforeAll2() throws SQLException {
3838 @ Test 
3939 public  void  nonUpdatableFields () throws  SQLException  {
4040 Statement  stmt  = sharedConn .createStatement ();
41+  stmt .execute ("START TRANSACTION" );
4142 ResultSet  rs  = stmt .executeQuery ("SELECT * FROM resultsettest" );
4243 Assertions .assertNull (rs .getWarnings ());
4344 rs .next ();
@@ -148,11 +149,13 @@ public void nonUpdatableFields() throws SQLException {
148149 Common .assertThrowsContains (ns , () -> rs .updateObject ("t1" , null , null , 0 ), NOT_SUPPORTED );
149150 Common .assertThrowsContains (ns , () -> rs .updateObject (1 , null , null ), NOT_SUPPORTED );
150151 Common .assertThrowsContains (ns , () -> rs .updateObject ("t1" , null , null ), NOT_SUPPORTED );
152+  sharedConn .rollback ();
151153 }
152154
153155 @ Test 
154156 public  void  notSupported () throws  SQLException  {
155157 Statement  stmt  = sharedConn .createStatement ();
158+  stmt .execute ("START TRANSACTION" );
156159 ResultSet  rs  = stmt .executeQuery ("SELECT * FROM resultsettest" );
157160 Common .assertThrowsContains (ns , () -> rs .getRowId (1 ), "RowId are not supported" );
158161 Common .assertThrowsContains (ns , () -> rs .getRowId ("t1" ), "RowId are not supported" );
@@ -167,11 +170,13 @@ public void notSupported() throws SQLException {
167170 () -> rs .getObject ("t1" , map ),
168171 "Method ResultSet.getObject(String columnLabel, Map<String, Class<?>> map) not supported" );
169172 Common .assertThrowsContains (ns , rs ::getCursorName , "Cursors are not supported" );
173+  sharedConn .rollback ();
170174 }
171175
172176 @ Test 
173177 public  void  staticMethod () throws  SQLException  {
174178 Statement  stmt  = sharedConn .createStatement ();
179+  stmt .execute ("START TRANSACTION" );
175180 ResultSet  rs  = stmt .executeQuery ("SELECT * FROM resultsettest" );
176181 Assertions .assertEquals (ResultSet .HOLD_CURSORS_OVER_COMMIT , rs .getHoldability ());
177182 rs .unwrap (java .sql .ResultSet .class );
@@ -180,11 +185,13 @@ public void staticMethod() throws SQLException {
180185 SQLException .class ,
181186 () -> rs .unwrap (String .class ),
182187 "The receiver is not a wrapper for java.lang.String" );
188+  sharedConn .rollback ();
183189 }
184190
185191 @ Test 
186192 public  void  wrongIndex () throws  SQLException  {
187193 Statement  stmt  = sharedConn .createStatement ();
194+  stmt .execute ("START TRANSACTION" );
188195 ResultSet  rs  = stmt .executeQuery ("SELECT * FROM resultsettest" );
189196 rs .next ();
190197 Common .assertThrowsContains (
@@ -201,11 +208,13 @@ public void wrongIndex() throws SQLException {
201208 SQLException .class ,
202209 () -> rs .findColumn ("yy" ),
203210 "Unknown label 'yy'. Possible value [resultsettest.t1, t1, resultsettest.t2, t2]" );
211+  sharedConn .rollback ();
204212 }
205213
206214 @ Test 
207215 public  void  isBeforeFirstFetchTest () throws  SQLException  {
208216 Statement  stmt  = sharedConn .createStatement ();
217+  stmt .execute ("START TRANSACTION" );
209218 stmt .setFetchSize (1 );
210219 ResultSet  rs  = stmt .executeQuery ("SELECT * FROM resultsettest" );
211220 assertTrue (rs .isBeforeFirst ());
@@ -216,11 +225,13 @@ public void isBeforeFirstFetchTest() throws SQLException {
216225 rs .close ();
217226 Common .assertThrowsContains (
218227 SQLException .class , rs ::isBeforeFirst , "Operation not permit on a closed resultSet" );
228+  sharedConn .rollback ();
219229 }
220230
221231 @ Test 
222232 public  void  testAliases () throws  SQLException  {
223233 Statement  stmt  = sharedConn .createStatement ();
234+  stmt .execute ("START TRANSACTION" );
224235 ResultSet  rs  =
225236 stmt .executeQuery ("SELECT t1 as t1alias, t2 as t2alias FROM resultsettest as tablealias" );
226237 rs .next ();
@@ -248,5 +259,6 @@ public void testAliases() throws SQLException {
248259 assertEquals (1 , rs .getInt (1 ));
249260 assertEquals (1 , rs .getInt ("t2" ));
250261 assertEquals (1 , rs .getInt ("resultsettest.t2" ));
262+  sharedConn .rollback ();
251263 }
252264}
0 commit comments