public final class TranUtils extends Object
| Constructor and Description |
|---|
TranUtils() |
| Modifier and Type | Method and Description |
|---|---|
static void |
execute(Tran tran,
org.noear.solon.core.util.RunnableEx runnable)
执行事务
|
static Connection |
getConnection(DataSource ds)
获取链接
|
static Connection |
getConnectionProxy(DataSource ds)
获取链接代理(一般,用于第三方框架事务对接)
|
static DataSource |
getDataSourceProxy(DataSource ds)
获取数据源代理(一般,用于第三方框架事务对接)
|
static boolean |
inTrans()
是否在事务中
|
static boolean |
inTransAndReadOnly()
是否在事务中且只读
|
static void |
listen(TranListener listener)
监听事务
|
public static void execute(Tran tran, org.noear.solon.core.util.RunnableEx runnable) throws Throwable
Throwablepublic static boolean inTrans()
public static boolean inTransAndReadOnly()
public static void listen(TranListener listener) throws IllegalStateException
IllegalStateExceptionpublic static Connection getConnection(DataSource ds) throws SQLException
SQLExceptionpublic static Connection getConnectionProxy(DataSource ds) throws SQLException
SQLExceptionpublic static DataSource getDataSourceProxy(DataSource ds)
Copyright © 2025. All rights reserved.