Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make ConnectionConfig#autoCommit configurable via fake pragma #1027

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/main/java/org/sqlite/SQLiteConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -534,6 +534,10 @@ public enum Pragma {
PASSWORD("password", "Database password", null),

// extensions: "fake" pragmas to allow conformance with JDBC
JDBC_AUTO_COMMIT(
"jdbc.auto_commit",
"Configure explicit read only transactions",
new String[] {"true", "false"}),
JDBC_EXPLICIT_READONLY(
"jdbc.explicit_readonly", "Set explicit read only transactions", null);

Expand Down
4 changes: 3 additions & 1 deletion src/main/java/org/sqlite/SQLiteConnectionConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@ public static SQLiteConnectionConfig fromPragmaTable(Properties pragmaTable) {
pragmaTable.getProperty(
SQLiteConfig.Pragma.TRANSACTION_MODE.pragmaName,
SQLiteConfig.TransactionMode.DEFERRED.name())),
true);
pragmaTable
.getProperty(SQLiteConfig.Pragma.JDBC_AUTO_COMMIT.pragmaName, "true")
.equals("true"));
}

public SQLiteConnectionConfig(
Expand Down