mirror of
https://github.com/jlengrand/exposed-wiki.git
synced 2026-03-10 08:11:18 +00:00
Updated FAQ (markdown)
This commit is contained in:
21
FAQ.md
21
FAQ.md
@@ -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).
|
||||
|
||||
|
||||
Reference in New Issue
Block a user