public final class TranUtils
extends java.lang.Object
构造器和说明 |
---|
TranUtils() |
限定符和类型 | 方法和说明 |
---|---|
static void |
execute(Tran tran,
RunnableEx runnable)
执行事务
|
static java.sql.Connection |
getConnection(javax.sql.DataSource ds)
获取链接
|
static java.sql.Connection |
getConnectionProxy(javax.sql.DataSource ds)
获取链接代理(一般,用于第三方框架事务对接)
|
static javax.sql.DataSource |
getDataSourceProxy(javax.sql.DataSource ds)
获取数据源代理(一般,用于第三方框架事务对接)
|
static boolean |
inTrans()
是否在事务中
|
static boolean |
inTransAndReadOnly()
是否在事务中且只读
|
static void |
listen(TranListener listener)
监听事务
|
public static void execute(Tran tran, RunnableEx runnable) throws java.lang.Throwable
java.lang.Throwable
public static boolean inTrans()
public static boolean inTransAndReadOnly()
public static void listen(TranListener listener) throws java.lang.IllegalStateException
java.lang.IllegalStateException
public static java.sql.Connection getConnection(javax.sql.DataSource ds) throws java.sql.SQLException
java.sql.SQLException
public static java.sql.Connection getConnectionProxy(javax.sql.DataSource ds) throws java.sql.SQLException
java.sql.SQLException
public static javax.sql.DataSource getDataSourceProxy(javax.sql.DataSource ds)