db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Knut Anders Hatlen <knut.hat...@oracle.com>
Subject Re: Multi-thread access to read-only DB in embedded mode?
Date Thu, 06 Jan 2011 21:16:03 GMT
Matt Pouttu-Clarke <Matt.Pouttu-Clarke@icrossing.com> writes:

>    public static void main(String[] args) throws SQLException
>     {
>         for(int x = 0; x < 2; x++) {
>             new Thread(new DerbyQuery()).run();
>         }
>     }

When you invoke run() directly, you're running all queries in the main
thread. You should try start() instead of run() and see if that improves
the concurrency.

-- 
Knut Anders

Mime
View raw message