Hi,

The reason why you got the exception "invalid database address:" from the
SQLite JDBC driver is that the SQLite JDBC driver does not follow the JDBC
specification. That means it is a bug in the SQLite JDBC driver. According
to the JDBC specification, Driver.connect should return null for JDBC URLs
it doesn't understand. From the JDBC API spec: "The driver should return
"null" if it realizes it is the wrong kind of driver to connect to the
given URL. This will be common, as when the JDBC driver manager is asked to
connect to a given URL it passes the URL to each loaded driver in turn. The
driver should throw an SQLException if it is the right driver to connect to
the given URL but has trouble connecting to the database."

Regards,
Thomas


On Mon, Mar 10, 2014 at 9:14 PM, Fabian Kessler <
[email protected]> wrote:

> The situation: after a db import with the suggested (persistent) setting
> LOCK_MODE=0, connecting to the same or another db with the global setting
> MULTI_THREADED=1 fails.
> One needs to reset the lock mode with LOCK_MODE=3.
>
> This has been noted by https://groups.google.com/forum/#!msg/h2-database/
> chvHwUZ20xQ/sYgNWLVSUXQJ and it's the only place after 2 hrs of searching
> where I've found the solution.
>
> The reason why I did not solve this quicker is because in my setup, I got
> an SQLException from sqlite instead:
>
> java.sql.SQLException: invalid database address: jdbc:h2:file:c:/h2tempdb;
> IFEXISTS=TRUE;ACCESS_MODE_DATA=r;MULTI_THREADED=1
>     at org.sqlite.JDBC.createConnection(JDBC.java:110)
>     at org.sqlite.JDBC.connect(JDBC.java:87)
>     at java.sql.DriverManager.getConnection(DriverManager.java:579)
>     at java.sql.DriverManager.getConnection(DriverManager.java:243)
>     at com.optimaize.labs.dbperf.databases.h2.ConnectionTest.
> run(ConnectionTest.java:54)
>     at com.optimaize.labs.dbperf.databases.h2.ConnectionTest.
> thisFails(ConnectionTest.java:26)
>
> It seems that this happens when I have 2 sql drivers. Java asks each, all
> report they can't handle this connection string, and the last one (sqlite)
> throws this.
> I've created a short reproducible test case here:
> https://github.com/fabiankessler/readonly-embedded-dbs-benchmark/blob/master/src/test/java/com/optimaize/labs/dbbench/databases/h2/ConnectionTest.java
>
> Also, I'm wondering why LOCK_MODE=0 is not acceptable when my connection
> is ACCESS_MODE_DATA=r.
>
> --
> You received this message because you are subscribed to the Google Groups
> "H2 Database" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/h2-database.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/d/optout.

Reply via email to