org.jsimpledb.kv.sqlite.SQLiteKVTransaction Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jsimpledb-kv-sqlite Show documentation
Show all versions of jsimpledb-kv-sqlite Show documentation
JSimpleDB key/value store implementation based on SQLite.
/*
* Copyright (C) 2015 Archie L. Cobbs. All rights reserved.
*/
package org.jsimpledb.kv.sqlite;
import java.sql.Connection;
import java.sql.SQLException;
import java.sql.Statement;
import org.jsimpledb.kv.sql.SQLKVDatabase;
import org.jsimpledb.kv.sql.SQLKVTransaction;
/**
* SQLite variant of {@link SQLKVTransaction}.
*/
class SQLiteKVTransaction extends SQLKVTransaction {
SQLiteKVTransaction(SQLKVDatabase database, Connection connection) throws SQLException {
super(database, connection);
}
@Override
public void setTimeout(long timeout) {
super.setTimeout(timeout);
try (final Statement statement = this.connection.createStatement()) {
statement.execute("PRAGMA busy_timeout=" + timeout);
} catch (SQLException e) {
throw this.handleException(e);
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy