use of com.ctrip.platform.dal.dao.client.DalCommand.nesting.normal.OneLayerExceptionDalCommand in project dal by ctripcorp.
the class DalCommandTest method testThreeLayerExceptionTransaction.
// Three layer transaction throws exception
@Test
public void testThreeLayerExceptionTransaction() throws Exception {
DalClient client = DalClientFactory.getClient(dbName);
try {
client.execute(new OneLayerExceptionDalCommand(), 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