Believe by default the pool is of size 10.  If your threads obtain the
connection and retain it then in theory 10 of the 20 threads cannot
get one.  Try increasing the size of your pool and see if those login
timeouts turn into LOCK_TIMEOUTS.

Did you observe that the waiting period was truly 30 or 60 seconds
before those timeouts occurred?



On Sep 5, 12:52 pm, Prakash <[email protected]> wrote:
> Hello H2 Users,
>
> I am currently using H2-1.2.142.jar in my application,
>
> I create a connection pool as follows,
> connPool = JdbcConnectionPool.create(url, "sa", "sa");
> connPool.setLoginTimeout(60);
>
> the url also includes the keyworkds, ;AUTO_SERVER=TRUE
>
> Currently I am trying to read records out of the database with say 20
> threads, and am seeing this Login Timeout. I have increased the
> timeout from default 30 seconds to 60 but am still getting this.
>
> java.sql.SQLException: Login timeout
>         at
> org.h2.jdbcx.JdbcConnectionPool.getConnection(JdbcConnectionPool.java:
> 211)
>         at
> comp.data.ConnectionPoolManager.getConnection(ConnectionPoolManager.java:
> 88)
>         at comp.report.CompareTask.process(CompareTask.java:47)
>         at comp.report.Report2$Producer$1.run(Report2.java:325)
>         at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown
> Source)
>         at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
>         at java.lang.Thread.run(Unknown Source)
>
> Is there any upper limit for the number of threads to use?,
> Is there some setting that can help me get past this error?
>
>  Please Help.
>
> Thanks
> Prakash

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/h2-database?hl=en.

Reply via email to