Skip to content

Commit

Permalink
fix: use random UUID for external resources
Browse files Browse the repository at this point in the history
  • Loading branch information
gotson committed May 19, 2023
1 parent 0c5a645 commit edb4b8a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/main/java/org/sqlite/SQLiteConnection.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.Properties;
import java.util.UUID;
import java.util.concurrent.Executor;
import org.sqlite.SQLiteConfig.TransactionMode;
import org.sqlite.core.CoreDatabaseMetaData;
Expand Down Expand Up @@ -304,7 +305,7 @@ private static File extractResource(URL resourceAddr) throws IOException {
}

String tempFolder = new File(System.getProperty("java.io.tmpdir")).getAbsolutePath();
String dbFileName = String.format("sqlite-jdbc-tmp-%d.db", resourceAddr.hashCode());
String dbFileName = String.format("sqlite-jdbc-tmp-%s.db", UUID.randomUUID());
File dbFile = new File(tempFolder, dbFileName);

if (dbFile.exists()) {
Expand Down

0 comments on commit edb4b8a

Please sign in to comment.