You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/site/markdown/using-api.md
+3-4Lines changed: 3 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -21,10 +21,9 @@ public class UserDaoImpl implements UserDao {
21
21
}
22
22
```
23
23
24
-
Use this option <strong>with care</strong> because wrong usage may produce runtime errors or worse, data integrity problems. Be aware of the following caveats with direct API usage:
24
+
Use this option **with care** because wrong usage may produce runtime errors or worse, data integrity problems. Be aware of the following caveats with direct API usage:
25
25
26
-
* It will **not** participate in any Spring transactions.
27
-
* If the `SqlSession` is using a `DataSource` that is also being used by a Spring transaction manager and there is currently a transaction in progress, this code **will** throw an exception.
26
+
* Unless **explicitly managed by Spring's `@Transactional` annotation** or configured for **auto-commit** at the database connection level, the raw `SqlSession` does **not** participate in any transaction management. Reliance on the raw `SqlSession` is highly discouraged as it bypasses Spring's automatic resource management mechanism.
28
27
* MyBatis' `DefaultSqlSession` is not thread safe. If you inject it in your beans you **will** get errors.
29
28
* Mappers created using `DefaultSqlSession` are not thread safe either. If you inject them it in your beans you **will** get errors.
30
-
* You must make sure that your `SqlSession`s are **always** closed in a finally block.
29
+
* You must make sure that your `SqlSession`s are **always** closed in a finally block.
0 commit comments