Subject Re: [Firebird-Java] How do I use the type 2 JDBC Driver?
Author Rick Fincher
Hi Umberto,

If you saw that big a drop in performance, something is wrong in your setup.
Type 2 may help some, but it wouldn't be that much.

Even if you use the type 2 driver you can sort out the real problem to
improve performance even more.

Interclient didn't follow the specs in a lot of cases and this can explain
the difference in behavior with the same code.

One common cause of this slow performance is autocommit being on when
resultsets are large. When autocommit is on (the default) the entire
resultset is brought over to the Java server when getResultset() is called.
With autocommit off each record is transferred when rs.next() is called. If
the resultset is large or each record is large, this can lead to a big delay
at first.

So, if your select statement gets 10 jpeg graphics from the database that
take 1 second each to transfer to your app server and displays them one at a
time as you click a "Next Picture" button in your browser, you will have a
10 second delay before the first picture appears with autocommit on. Each
subsequent picture will appear very quickly, though.

With autocommit off the first picture will appear in about one second. Each
subsequent picture will take about 1 second to appear as the "Next Picture"
button is clicked.

If you are just chugging through a lot of data, you may be better of to
bring it all over to the app server at once.

You also have to be sure that you have enough memory allocated to the Java
application. If autocommit is on and a fetching a dataset transfers a lot
of stuff to your app server, it may trigger garbage collection in your Java
JVM if you don't have enough memory allocated.

If your app server is running with just barely enough memory, a fetch with
autocommit on can trigger a garbage collection every time.

Here are a few questions that may help us help you:

What kind of app server are you running? (Tomcat, JBoss, ?).
What version of JayBird are you running?
What OS is the server running on?

Hope this helps,

Rick

----- Original Message -----

> Hi all, I have been lurking on this ml for some time, but I think
> nobody has ever mentioned how to use the jdbc type 2 driver.
> Is there any hope that this driver would perform substantially better
> than the type 4 driver? I am running a web application that was
> recently migrated from interclient to jaybird, but performance dropped
> to almost unacceptable level.
>
> If you could provide any pointers, that would be very much appreciated.
> Umberto
>