use of com.ctrip.platform.dal.dao.client.DalCommand.nesting.normal.TwoLayerExceptionDalCommand in project dal by ctripcorp.
the class DalCommandTest method testFourLayerExceptionTransaction.
// Four layer transaction throws exception
@Test
public void testFourLayerExceptionTransaction() throws Exception {
DalClient client = DalClientFactory.getClient(dbName);
try {
client.execute(new TwoLayerExceptionDalCommand(), new DalHints());
Assert.fail();
} catch (Throwable e) {
System.out.println(e.getMessage());
Assert.assertTrue(e instanceof BatchUpdateException);
Assert.assertTrue(e.getMessage().equals("Data truncation: Data too long for column 'Name' at row 1"));
Assert.assertTrue(isCurrentTransactionNull());
}
}
Aggregations