Subject Re: selects are fast, but commit takes 10 seconds!!
Author David Goodman
The code is in an abstraction layer, so I have a method like
fetchObjectsUsingCriteria(). This method call was taking something
like 10,107ms. I was scratching my head about the 10 second delay, so
I cracked that method open and put timings around the individual
components of the fetch. This method ONLY does select statements,
updates are handled elsewhere.

An interesting side-note is that when I do updates or inserts they
only take about 300ms. The 10 second lag only happens on reads, not
writes.

Thanks,
- Dave


--- In firebird-support@yahoogroups.com, "Alan McDonald" <alan@m...>
wrote:
> > I have an application written in Java which uses IB6 and Firebird
> > InterClient.
> >
> > In the application, there are places where I perform an ad-hoc query
> > and return the results to a GUI. Psuedocode is:
> >
> > {
> > db.beginTran();
> > results = db.exec(selectStatement);
> > db.commitTran();
> >
> > return result;
> > }
> >
> > I put timings around each statement. Getting the results takes about
> > 100ms, give or take, but the commit takes 10,000ms (almost exactly)
> > every time. I tried changing the commit to a rollback, and it dropped
> > to <10ms. I have two questions:
> >
> > 1) Where is that 10 second commit coming from? Some sort of timeout?
> > 2) Is using rollback a safe/viable work-around for this speed issue?
> >
> > Thanks!
> > - Dave
>
> I suspect something else is going on here - I have a Palm conduit which
> works with interclient and IB6 and IB5.6. Noone experiences anything
in this
> order, in fact it does quite a lot of hard work and is surprisingly
fast (no
> java gui helps). It has to commit in several places.
>
> But your code does a commit and then wants to return the query results?
> What's the logic here?
>
> Alan