Thanks Joe, your explanations were very helpful. Much appreciate it.

On Sep 7, 5:16 am, Joe <[email protected]> wrote:
> Yes, pool size and max connections is the same thing.
>
> Whether it is advisable to have 40 connections or not entirely depends
> on your usage scenario.  By default the database is single threaded so
> having so many connections is likely not buying anything in terms of
> performance.
>
> If you were seeing log-in timeouts before I'd be concerned that you're
> now susceptible to lock timeouts since instead of having to wait for
> the connection object (log-in timeout) you're now waiting for your
> statement to get a lock on a table (lock timeout).
>
> If you're using a thread pool of some kind you might want to consider
> the usage pattern the threads in that pool would levy on the database
> and find some happy middle ground between thread pool size and
> behavior and database connection pool size and behavior.
>
> Joe
>
> On Sep 6, 3:51 pm, Prakash <[email protected]> wrote:
>
>
>
> > Thanks Joe,
>
> > Is max connections the same as the size of the pool? I didn't get the
> > Login Timeout error after Increasing the max connections in the
> > connection.
> > If it is not the same please let me know how to increase the
> > connection pool size.
>
> > If it is the same, is it advisable to have value of max connections as
> > 40, will there be any negative impact?
>
> > On Sep 6, 7:28 am, Joe <[email protected]> wrote:
>
> > > 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