Hi,
I’m connecting to a sqlite db using jdbc. There seems to be a problem when I use Connection.setAutoCommit(). The following example works fine (psuedo-code, error checking removed, etc):
Connection conn = DriverManager.getConnection(
"jdbc:sqlite:/path/to/db.sqlite");
PreparedStatement stmt = null;
try {
stmt = conn.prepareStatement("create table test ...");
stmt.execute();
stmt.close();
} finally {
conn.close();
}
now the same code but using Connection.setAutoCommit():
try {
conn.setAutoCommit(false);
stmt = conn.prepareStatement("create table test ...");
stmt.execute();
stmt.close();
conn.setAutoCommit(true);
} finally {
conn.close();
}
The above doesn’t throw any errors, but the changes are not written to the database file.
The same code works ok on desktop and android - any idea what’s wrong? Maybe it’s some in MOE?
Thank you