1 24 25 package org.objectweb.cjdbc.scenario.raidb1.cache; 26 27 import java.sql.Connection ; 28 import java.util.ArrayList ; 29 30 import org.objectweb.cjdbc.scenario.templates.Raidb1Template; 31 import org.objectweb.cjdbc.scenario.tools.ScenarioUtility; 32 33 39 public class CacheRollbackScenario extends Raidb1Template 40 { 41 42 47 public void testRollback() throws Exception 48 { 49 Connection con = getCJDBCConnection(); 50 con.setAutoCommit(false); 51 String sql = "Select * from DOCUMENT"; 52 String update = "update DOCUMENT set TOTAL=0.0"; 53 54 ArrayList set1 = ScenarioUtility.getSingleQueryResult(sql,con); 56 57 con.createStatement().executeUpdate(update); 59 60 ArrayList set2 = ScenarioUtility.getSingleQueryResult(sql,con); 62 assertNotSame("Should be different", set1,set2); 63 64 con.rollback(); 66 ArrayList set3 = ScenarioUtility.getSingleQueryResult(sql,con); 67 assertEquals("Should be the same", set1,set3); 68 } 69 } | Popular Tags |