Updated FAQ (markdown)

This commit is contained in:
Andrey.Tarashevskiy
2021-01-17 01:57:11 +03:00
parent 36433837fc
commit b8cad842e1

21
FAQ.md
View File

@@ -65,27 +65,6 @@ A: Yes, it's possible since Exposed 0.11.1 version
A: See example here: https://github.com/JetBrains/Exposed/issues/248
### Q: SQLite3 fails with the error Transaction attempt #0 failed: SQLite supports only TRANSACTION_SERIALIZABLE and TRANSACTION_READ_UNCOMMITTED.
A1: Update to Exposed 0.24.1 or later
A2: Make your connect code look like below (taken from [ThreadLocalManagerTest.kt](https://github.com/JetBrains/Exposed/blob/4360ae18c708072dfda261742e65b8b56a696adc/src/test/kotlin/org/jetbrains/exposed/sql/tests/shared/ThreadLocalManagerTest.kt#L282-L291)). The setting below tells SQLite3 to enforce transactional integrity by [serializing writes from different connections](https://sqlite.org/isolation.html).
```kotlin
// Your connection properties here
Database.connect("jdbc:sqlite:my.db", "org.sqlite.JDBC")
TransactionManager.manager.defaultIsolationLevel = Connection.TRANSACTION_SERIALIZABLE // Or Connection.TRANSACTION_READ_UNCOMMITTED
```
### Q: Oracle fails with the error Transaction attempt #0 failed: `READ_COMMITTED and SERIALIZABLE are the only valid transaction levels`
A1: Update to Exposed 0.24.1 or later
A2: Make your connect code look like below (taken from [ThreadLocalManagerTest.kt](https://github.com/JetBrains/Exposed/blob/4360ae18c708072dfda261742e65b8b56a696adc/src/test/kotlin/org/jetbrains/exposed/sql/tests/shared/ThreadLocalManagerTest.kt#L282-L291)).
```kotlin
// Your connection properties here
Database.connect("jdbc:jdbc:oracle:thin:@//localhost:1521/test", "oracle.jdbc.OracleDriver")
TransactionManager.manager.defaultIsolationLevel = Connection.TRANSACTION_SERIALIZABLE // Or Connection.TRANSACTION_READ_COMMITTED
```
### Q: How can I use SAVEPOINT?
A: It possible only through using a raw connection. See example [here](https://github.com/JetBrains/Exposed/issues/320#issuecomment-394825415).