mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
add license description.
This commit is contained in:
@@ -1,3 +1,18 @@
|
||||
/*
|
||||
* Copyright 1999-2011 Alibaba Group Holding Ltd.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.alibaba.druid;
|
||||
|
||||
import java.beans.PropertyVetoException;
|
||||
@@ -71,14 +86,14 @@ public class TestRollBack {
|
||||
|
||||
@Before
|
||||
public void before() {
|
||||
// 清空所有数据
|
||||
// 清空æ‰?œ‰æ•°æ�®
|
||||
dao_c3p0.clear("msg");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void test_c3p0() {
|
||||
try {
|
||||
// 将两条插入语句包裹在一个事务内执行,第一条可以正常插入,第二条超过字段长度,会抛异常,事务会回滚
|
||||
// 将两æ�¡æ�’å…¥è¯å�¥åŒ…裹在ä¸?¸ªäº‹åŠ¡å†…æ‰§è¡?第一æ�¡å�¯ä»¥æ£å¸¸æ�’å…?第二æ�¡è¶…è¿‡å—æ®µé•¿åº?会抛异常,事务会回æ»?
|
||||
Trans.exec(new Atom() {
|
||||
@Override
|
||||
public void run() {
|
||||
@@ -89,7 +104,7 @@ public class TestRollBack {
|
||||
} catch (Exception e) {
|
||||
|
||||
}
|
||||
// abc也跟着回滚了
|
||||
// abc也跟ç�?›žæ»šäº†
|
||||
Assert.assertNull(dao_c3p0.fetch("msg", Cnd.where("message", "=", "abc")));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user