Subject | Re: How do I use the type 2 JDBC Driver? |
---|---|
Author | unicolet2003 |
Post date | 2004-01-20T12:29:55Z |
Hi Rick,
comments inline.
comments inline.
--- In Firebird-Java@yahoogroups.com, "Rick Fincher" <rnf@t...> wrote:
> 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.
>
That I understand it, but the big trouble is that my app (which uses
transactions and transactions are the reason that forced me to upgrade
the driver to jaybird 1.5) might be transferring about 20 bytes for
each query for that is definitely not the problem. Also I didn't see
any big memory load on the application server.
> 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?
>
I am runnign tomcat 4.1.27 on a HP netserver 800 with 1.3GB of RAM
with SUSE Linux 8.0 and j2sdk 1.4.x. The vary same web now has been
ported to oracle and the performance gap I see is unsettling!
I use JSP with JSTL 1.0.4 grabbed from jakarta.apache.org.
The db is on another Netserver, running the same linux on a 100MB
fully switched lan.
IBCONSOLE or Interclient do not show this behavior and are reasonably
fast. Only transactions appear not to commit consistently and THAT is
a problem :-) !
Thanks for any help,
Umberto
> 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
> >