You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-user@db.apache.org by pawan2009 <ps...@fnfr.com> on 2009/04/14 22:06:37 UTC

Derby take a long time to start

Hi

We are seeing that occasionally, when our application starts (it uses derby
to store data), derby database can be connected to quickly - but on the very
first query to the database, it takes a long time for derby to come back and
respond. It is as if derby is doing some house work recovering data or
indexing or something. If we let our application run for 20-30 minutes, the
query does complete and after that everything works fine. We see it only
occasionally.

Any ideas on what could be causing this?
-- 
View this message in context: http://www.nabble.com/Derby-take-a-long-time-to-start-tp23046970p23046970.html
Sent from the Apache Derby Users mailing list archive at Nabble.com.


Re: Derby take a long time to start

Posted by Knut Anders Hatlen <Kn...@Sun.COM>.
pawan2009 <ps...@fnfr.com> writes:

> Hi
>
> We are seeing that occasionally, when our application starts (it uses derby
> to store data), derby database can be connected to quickly - but on the very
> first query to the database, it takes a long time for derby to come back and
> respond. It is as if derby is doing some house work recovering data or
> indexing or something. If we let our application run for 20-30 minutes, the
> query does complete and after that everything works fine. We see it only
> occasionally.
>
> Any ideas on what could be causing this?

The data recovery performed on startup after an unclean shutdown may
take a while to finish if a long-lived transaction has prevented old
transaction logs from being deleted. But the recovery should happen when
the first connection to the database is opened, not on the first query.

It would be interesting if you could get a thread dump (using jstack,
VisualVM, or some other tool) when this happens so that we can see where
Derby is spending time.

-- 
Knut Anders