JDBC for sql server: delays experienced when using Connection.prepareCall()
From: Anthony (anthony_at_jayasekera.net)
Date: 05/12/04
- Next message: Paul Schmidt: "Re: Reporting Tools"
- Previous message: Scott Morman: "A specific question about the JDO specification and object-id classes"
- Next in thread: Joe Weinstein: "Re: JDBC for sql server: delays experienced when using Connection.prepareCall()"
- Reply: Joe Weinstein: "Re: JDBC for sql server: delays experienced when using Connection.prepareCall()"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 12 May 2004 07:45:06 -0700
Hello,
I have been doing some performance tests of the MS jdbc driver for sql
server. I am observing behaviour that I can't fully understand. When
getting a connection from the driver
[DriverManager.getConnection(CONNECTION_STRING)] I am experiencing a
delay of about 15-16 seconds. This seems rather long but I am willing
to accept this initial performance hit (I am connecting to a remote
sql server instance). The first time I call prepareCall() to generate
a reusable CallableStatement based on a stored procedure, there is no
significant delay (less than 1 second). However the next time I call
prepareCall() (on the same Connection) to generate a different
CallableStatement I experience a delay which also is 15-16 seconds. I
have done other tests like using mulitple connections but it always
seems to be the case that the first prepareCall() call made on a
particular Connection instance is immediate but subsequent calls take
15-16 seconds (the same time taken to create the connection in the
first place). Why is this? I understand the principle of caching
CallableStatements but I do not understand why the prepareCall() call
takes so long. If I have to prepare 50 calls up front am I expected
to wait 750 seconds?!? Any advice in this would be hugely
appreciated. If you are not able to shed any light on this but have
used the ms sql server jdbc driver in a commercial environment in an
application that uses large numbers of stored procedures please let me
know. This will at least indicate that it is possible to address this
problem. Please note, my tests all involve straight java from a
client, not J2EE etc.
Thanks,
Anthony
ps. I am well aware of the differences of opinion out there relating
to sql server, MS etc. If you feel like replying with nothing more
than a tirade about how rubbish MS are please don't bother.
- Next message: Paul Schmidt: "Re: Reporting Tools"
- Previous message: Scott Morman: "A specific question about the JDO specification and object-id classes"
- Next in thread: Joe Weinstein: "Re: JDBC for sql server: delays experienced when using Connection.prepareCall()"
- Reply: Joe Weinstein: "Re: JDBC for sql server: delays experienced when using Connection.prepareCall()"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|