public class NutTxDao extends NutDao implements Closeable
限定符和类型 | 字段和说明 |
---|---|
protected boolean |
_autoCommit
是否恢复conn原本的auto commit设置
|
protected Connection |
conn |
protected boolean |
debug |
protected String |
id |
protected Savepoint |
sp |
protected NutMap |
sps |
_interceptors, autoTransLevel, dataSource, executor, expert, holder, meta, pojoMaker, runner, sqlManager
限定符和类型 | 方法和说明 |
---|---|
NutTxDao |
begin(int transLevel)
开启事务
|
NutTxDao |
beginRC()
开启事务,级别为READ_COMMITTED
|
NutTxDao |
beginSE()
开启事务,级别为SERIALIZABLE
|
void |
close()
关闭事务及连接
|
NutTxDao |
commit()
提交事务
|
protected void |
finalize() |
Connection |
getConnection()
获取当前事务的数据库连接
|
String |
getId()
本事务的id
|
NutTxDao |
rollback()
回滚事务
|
NutTxDao |
rollback(String id)
回滚事务
|
NutTxDao |
setDebug(boolean debug)
设置debug默认
|
NutTxDao |
setSavepoint(String spId) |
_fetchLinks, clear, clear, clear, clear, clearLinks, count, count, count, count, create, createPager, delete, delete, delete, deleteLinks, deleteWith, deletex, drop, drop, each, each, each, each, each, execute, exists, exists, fastInsert, fetch, fetch, fetch, fetch, fetch, fetch, fetch, fetchByJoin, fetchByJoin, fetchByJoin, fetchByJoin, fetchLinks, fetchLinks, fetchx, func, func, func, func, func2, func2, func2, func2, getEntity, getMaxId, getObject, getObject, insert, insert, insert, insert, insert, insertLinks, insertOrUpdate, insertOrUpdate, insertRelation, insertWith, query, query, query, query, query, query, query, queryByJoin, setExpert, update, update, update, update, update, update, update, update, updateAndIncrIfMatch, updateIgnoreNull, updateLinks, updateRelation, updateWith, updateWithVersion, updateWithVersion
_exec, addInterceptor, createEntityMaker, execute, getDataSource, getJdbcExpert, makeInterceptor, meta, pojoMaker, run, setAutoTransLevel, setDataSource, setDataSource, setExecutor, setInterceptors, setPojoMaker, setRunner, setSqlManager, sqls
protected Connection conn
protected String id
protected Savepoint sp
protected boolean debug
protected boolean _autoCommit
protected NutMap sps
public NutTxDao(Dao _dao) throws DaoException
_dao
- 参数类型是Dao,但必须是NutDao实例DaoException
- 获取数据连接失败时会抛出public NutTxDao beginRC()
public NutTxDao beginSE()
public NutTxDao begin(int transLevel) throws DaoException
transLevel
- 事务级别DaoException
- 如果已经开启过事务Connection
public NutTxDao commit()
public NutTxDao rollback()
public void close()
close
在接口中 Closeable
close
在接口中 AutoCloseable
public Connection getConnection()
public String getId()
public NutTxDao setDebug(boolean debug)
debug
- 是否开启debug日志Copyright © 2017. All rights reserved.