More Fine Grained Control for Loading Native JDBC Lib

Aperta
#1,154 7 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
48/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Tranquilla
Stack tecnologico
java, sqlite
Ambito
database

Direzione di ricerca

Read SQLiteJDBCLoader.java, especially the cleanup routine linked in the issue, and trace how org.sqlite.lib.path and JAR resource loading are handled. Check the existing tests for native library loading and run the relevant suite. Done means the configured native library location fails fast when invalid, default loading from JAR resources remains available, and the source is logged.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

enhancement

Is your feature request related to a problem? Please describe.
Follow-up to #1140.

For the greatest amount of deployment safety, I have configured my application to use a static copy of sqlitejdbc.so via -Dorg.sqlite.lib.path that gets deployed alongside the application. There are however some issues with this approach:

  1. The cleanup routine gets run every time, even though the JDBC native lib will never be present there - this adds startup time that is variable as it depends on the number of items that happen to be at /tmp at any given time
  2. Logging is not sufficient and therefore if the org.sqlite.lib.path option is misconfigured, it is not easy to identify. That is to say, if the JDBC native lib is missing, or if the lib.path is incorrect, then it silently fails and falls-back to loading from the JAR resources (and using /tmp) and there is no indication that this has happened.

Describe the solution you'd like
Make the default to load from JAR resources, but allow users to explicitly specify (e.g., -Dorg.sqlite.lib.location ) where the native JDBC lib should be loaded from. If it cannot be loaded, the behavior should be to fail-fast, not fall-back.

Added logging (at least DEBUG, maybe INFO) where the Native JDBC lib file is loaded from.

Lingua principale
Java
Stelle
3.3k
Fork
676
Merge medio
1g 15h
PR unite (30g)
18

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di xerial/sqlite-jdbc

Tutte le issue di xerial/sqlite-jdbc

Issue simili

Altre issue su Java

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.