限定符和类型 | 字段和说明 |
---|---|
protected boolean |
_autoCommit
是否恢复conn原本的auto commit设置
|
protected java.sql.Connection |
conn |
protected boolean |
debug |
protected java.lang.String |
id |
protected java.sql.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() |
java.sql.Connection |
getConnection()
获取当前事务的数据库连接
|
java.lang.String |
getId()
本事务的id
|
NutTxDao |
rollback()
回滚事务
|
NutTxDao |
rollback(java.lang.String id)
回滚事务
|
NutTxDao |
setDebug(boolean debug)
设置debug默认
|
NutTxDao |
setSavepoint(java.lang.String spId) |
clear, clear, clear, clear, clearLinks, count, count, count, count, create, createPager, delete, delete, delete, deleteLinks, deleteWith, deletex, drop, drop, each, each, each, each, execute, exists, exists, fastInsert, fetch, fetch, fetch, fetch, fetch, fetch, fetch, fetchLinks, fetchLinks, fetchx, func, func, func, func, func2, func2, func2, func2, getEntity, getMaxId, getObject, getObject, insert, insert, insert, insert, insert, insertLinks, insertRelation, insertWith, query, query, query, query, query, query, query, setExpert, update, update, update, update, updateIgnoreNull, updateLinks, updateRelation, updateWith
_exec, addInterceptor, createEntityMaker, execute, getJdbcExpert, makeInterceptor, meta, pojoMaker, run, setAutoTransLevel, setDataSource, setDataSource, setExecutor, setInterceptors, setPojoMaker, setRunner, setSqlManager, sqls
protected java.sql.Connection conn
protected java.lang.String id
protected java.sql.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 NutTxDao rollback(java.lang.String id)
sp
- 回滚点public NutTxDao setSavepoint(java.lang.String spId)
public void close()
close
在接口中 java.io.Closeable
close
在接口中 java.lang.AutoCloseable
public java.sql.Connection getConnection()
public java.lang.String getId()
public NutTxDao setDebug(boolean debug)
debug
- 是否开启debug日志protected void finalize() throws java.lang.Throwable
finalize
在类中 java.lang.Object
java.lang.Throwable