 |
AppletTalk.com Java discussions newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
M Pires Guest
|
Posted: Fri Jul 11, 2003 1:10 pm Post subject: Slow query using SQL Server and JDBC |
|
|
Hi all,
First of all I am sorry if this is a FAQ but I couldn't find any for
this newsgroup. Please be kind enough to redirect me to it, if it
exists!
I have a JSP application running on Apache and I have to query a SQL
Server database. I have the Microsoft JBDC drivers for SQL Server
installed and they "seem" to be working OK.
The thing is, when I submit and query the database, I watch in SQL
profiler that there is a sucessful login but the first statement I get
is "select @@MAX_PRECISION" which isn't anywhere in my code. Then
approx. 300/400 seconds (!!!) later comes the first statement in my
code which is an ordinary "select" from a table which also lasts an
eternity...! I am testing the query from the same server where the SQL
server is, so there shouldn't be any network delay!
What I am doing wrong? Help!
Thank you.
|
|
| Back to top |
|
 |
Joseph Weinstein Guest
|
Posted: Fri Jul 11, 2003 2:30 pm Post subject: Re: Slow query using SQL Server and JDBC |
|
|
M Pires wrote:
| Quote: | Hi all,
First of all I am sorry if this is a FAQ but I couldn't find any for
this newsgroup. Please be kind enough to redirect me to it, if it
exists!
I have a JSP application running on Apache and I have to query a SQL
Server database. I have the Microsoft JBDC drivers for SQL Server
installed and they "seem" to be working OK.
The thing is, when I submit and query the database, I watch in SQL
profiler that there is a sucessful login but the first statement I get
is "select @@MAX_PRECISION" which isn't anywhere in my code. Then
approx. 300/400 seconds (!!!) later comes the first statement in my
code which is an ordinary "select" from a table which also lasts an
eternity...! I am testing the query from the same server where the SQL
server is, so there shouldn't be any network delay!
|
Hi. Don't worry about the MAX_PREC... stuff. The driver will make some
of it's own queries to set itself up according to the capabilities of the DBMS
it is connected to. The delay seems to be simply waiting for the DBMS to respond.
You *should* expect some delay, because unless the machine has more than one
CPU, there will be some inevitable delay while the CPU switches from running
your Apache system and the DBMS. Depending on how much memory you
have, and how much other load the box has, the delay might be less or more.
Joe Weinstein at BEA
| Quote: |
What I am doing wrong? Help!
Thank you.
|
|
|
| Back to top |
|
 |
noel wood Guest
|
Posted: Sat Jul 12, 2003 10:06 am Post subject: Re: Slow query using SQL Server and JDBC |
|
|
I'm only a uni student but I think the time delays you have indicate
something is wrong. I use jsp with oracle and results are returned at most
3 seconds after the query is submitted. 300 to 400 seconds seems like there
must be something wrong.
Noel
"Joseph Weinstein" <joe.remove_this (AT) bea (DOT) com.remove_this> wrote
| Quote: |
M Pires wrote:
Hi all,
First of all I am sorry if this is a FAQ but I couldn't find any for
this newsgroup. Please be kind enough to redirect me to it, if it
exists!
I have a JSP application running on Apache and I have to query a SQL
Server database. I have the Microsoft JBDC drivers for SQL Server
installed and they "seem" to be working OK.
The thing is, when I submit and query the database, I watch in SQL
profiler that there is a sucessful login but the first statement I get
is "select @@MAX_PRECISION" which isn't anywhere in my code. Then
approx. 300/400 seconds (!!!) later comes the first statement in my
code which is an ordinary "select" from a table which also lasts an
eternity...! I am testing the query from the same server where the SQL
server is, so there shouldn't be any network delay!
Hi. Don't worry about the MAX_PREC... stuff. The driver will make some
of it's own queries to set itself up according to the capabilities of the
DBMS
it is connected to. The delay seems to be simply waiting for the DBMS to
respond.
You *should* expect some delay, because unless the machine has more than
one
CPU, there will be some inevitable delay while the CPU switches from
running
your Apache system and the DBMS. Depending on how much memory you
have, and how much other load the box has, the delay might be less or
more.
Joe Weinstein at BEA
What I am doing wrong? Help!
Thank you.
|
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|