Return-Path: Delivered-To: apmail-jakarta-tomcat-user-archive@www.apache.org Received: (qmail 81540 invoked from network); 8 Feb 2005 21:30:19 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 8 Feb 2005 21:30:19 -0000 Received: (qmail 64630 invoked by uid 500); 8 Feb 2005 21:30:02 -0000 Delivered-To: apmail-jakarta-tomcat-user-archive@jakarta.apache.org Received: (qmail 64607 invoked by uid 500); 8 Feb 2005 21:30:02 -0000 Mailing-List: contact tomcat-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Tomcat Users List" Reply-To: "Tomcat Users List" Delivered-To: mailing list tomcat-user@jakarta.apache.org Received: (qmail 64589 invoked by uid 99); 8 Feb 2005 21:30:02 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: local policy) Received: from mail01.netgaintechnology.com (HELO mail01.netgaintechnology.com) (209.188.110.20) by apache.org (qpsmtpd/0.28) with ESMTP; Tue, 08 Feb 2005 13:29:58 -0800 Received: from hosting.netgaintechnology.com [64.83.222.156] by mail01.netgaintechnology.com with ESMTP (SMTPD32-8.13) id AE6F652E00AE; Tue, 08 Feb 2005 15:26:07 -0600 Received: from ngsv24.my-netgain.com ([10.0.1.14]) by hosting.netgaintechnology.com with Microsoft SMTPSVC(5.0.2195.6713); Tue, 8 Feb 2005 15:29:55 -0600 content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable X-MimeOLE: Produced By Microsoft Exchange V6.0.6249.0 Subject: RE: JTDS help Date: Tue, 8 Feb 2005 15:29:55 -0600 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: JTDS help Thread-Index: AcUNVbpvEQEt+7w8Qmi+sNOvkFqMQwAD++cgABZBSfAAC1AD0AAAHPcwAAGVLKAAADlJkAAML37w From: "Charles P. Killmer" To: "Tomcat Users List" X-OriginalArrivalTime: 08 Feb 2005 21:29:55.0721 (UTC) FILETIME=[5546CF90:01C50E25] X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Well there aren't any file access errors but it looks like for every request it is racing through all of the directories and compiling whatever it finds. Is there a setting that tells tomcat to recompile on every request? Charles=20 -----Original Message----- From: Allistair Crossley [mailto:Allistair.Crossley@QAS.com]=20 Sent: Tuesday, February 08, 2005 9:36 AM To: Tomcat Users List Subject: RE: JTDS help Hey Charles, I'm sure it's quite frustrating, but I've already shown that your precise code runs way faster than your original statistics, and that was only on a modest box. It serves no purpose therefore to believe it could be the language of choice, because I cannot replicate your speed issue. See what your monitoring brings back. What kind of setup are you running? Allistair. > -----Original Message----- > From: Charles P. Killmer [mailto:charlesk@netgaintechnology.com] > Sent: 08 February 2005 15:33 > To: Tomcat Users List > Subject: RE: JTDS help >=20 >=20 > I don't mean to be contrary, I am just trying to pin this down. The=20 > database and tomcat server are only separated by a 10/100 switch. I=20 > am going to run filemon and watch for access denied messages, then=20 > regmon and watch for similar things. The network is very fast, the db > server is not being used by anyone else. It seems to me that if it=20 > were environmental, it would affect these other programming languages=20 > the same. I checked and the jtds.jar file is in tomcat\common\lib. >=20 > Any other thoughts while you wait for the results from filemon and=20 > regmon? >=20 > Thank you > Charles >=20 > -----Original Message----- > From: Allistair Crossley [mailto:Allistair.Crossley@QAS.com] > Sent: Tuesday, February 08, 2005 8:44 AM > To: Tomcat Users List > Subject: RE: JTDS help >=20 > Hi, >=20 > No it was a totally raw test of your code which by virtue of using=20 > DriverManager does not use connection pooling even if I do have it=20 > enabled in my web app. >=20 > jTDS installation is simply adding the JAR to tomcat/common/lib >=20 > Are you running Tomcat on the same server as the database? >=20 > Config file won't have anything to do with this. I am certain it is=20 > environmental. >=20 > Ali. >=20 > > -----Original Message----- > > From: Charles P. Killmer [mailto:charlesk@netgaintechnology.com] > > Sent: 08 February 2005 14:41 > > To: Tomcat Users List > > Subject: RE: JTDS help > >=20 > >=20 > > Well I must have missed something because it isn't working > correctly. > > ;) Were you using connection pooling in your test? Perhaps I have=20 > > something messed up in a config file? Or installed jTDS > incorrectly? > >=20 > > Thanks for all your help. > > Charles > >=20 > > -----Original Message----- > > From: Allistair Crossley [mailto:Allistair.Crossley@QAS.com] > > Sent: Tuesday, February 08, 2005 3:17 AM > > To: Tomcat Users List > > Subject: RE: JTDS help > >=20 > > Hi Charles, > >=20 > > I've just taken your code and run it through our Tomcat > 5.5, jTDS, SQL >=20 > > Server 2000 web application and it took approx. 0.5s to compile and=20 > > subsequent requests were instantaneous < 0.5s. > >=20 > > I would look again at the issues I first noted, perhaps there is=20 > > something you have missed. > >=20 > > Cheers, Allistair. > >=20 > > > -----Original Message----- > > > From: Charles P. Killmer [mailto:charlesk@netgaintechnology.com] > > > Sent: 07 February 2005 22:42 > > > To: Tomcat Users List > > > Subject: RE: JTDS help > > >=20 > > >=20 > > > When I strip the code to simply this, > > >=20 > > > <%@ page language=3D"java" import=3D"java.sql.*"%> <% > Connection conn =3D > > > DriverManager.getConnection("jdbc:jtds:sqlserver://*.*.*.*:143 > > > 3/dbname;u > > > ser=3D*****;password=3D******"); > > > conn.close(); > > > %> > > >=20 > > > It still runs slowly. And yes it is multiple refreshes. =20 > > >=20 > > > I have tried to use connection pooling but have not been > > able to get > > > it working yet. Also the thing that I run into with connection=20 > > > pooling the inability to use the SQL Statement of "select > > @@IDENTITY > > > from table". > > > With connection pooling, you run the risk of getting the ID for a=20 > > > record that someone else inserted with the same connection. > > >=20 > > > If connection pooling is the only option, I can work around that=20 > > > issue. > > > But it seems that if PHP, ASP, ASP.NET... Can access the > > database just > >=20 > > > fine without connection pooling, JSP should be able to as well. > > >=20 > > > Any thoughts? > > > Thanks for all your input. > > > Charles > > >=20 > > > -----Original Message----- > > > From: Mario Winterer [mailto:mario.winterer@eduhi.at] > > > Sent: Monday, February 07, 2005 2:43 PM > > > To: Tomcat Users List > > > Subject: Re: JTDS help > > >=20 > > > I do not think, jsp compilation is the problem - well, the first=20 > > > request will last long, but after the jsp is compiled, subsequent=20 > > > calls will not be remarkable slower than executing pure compiled=20 > > > servlet code. > > > (Charles, I hope you did not measure the time for the > first request > > > only > > > - which indeed includes compilation time, but for > subsequent calls > > > too). > > > So to me opening the connection is the major problem.=20 > > Because the code > >=20 > > > itself contains html-output, I think using jsp is quite ok. > > > The code would be much cleaner, if Charles used the JSTL > > tag-library: > > >=20 > > > <%@ page language=3D"java"%> > > > <%@ taglib prefix=3D"c" uri=3D"http://java.sun.com/jstl/core" %> = <%@ > > > > > > taglib prefix=3D"sql" uri=3D"http://java.sun.com/jstl/sql" %> > > > > sql=3D"SELECT * FROM accounts" var=3D"accounts" > > > dataSource=3D"jndi/myDataSource"/> > > > > > > > > >
> > value=3D"${acc.ID}"/> > value=3D"${acc.Name}"/>
> > >=20 > > > Best regards, > > > Tex > > >=20 > > > David Smith wrote: > > >=20 > > > > Ok. You're doing this in a jsp. That means Tomcat is: > > > > > > > > 1) Compiling your jsp to a servlet class. > > > > 2) Building a connection from scratch as opposed to > picking up a > > > > pooled connection > > > > 3) Running the query. > > > > > > > > Of these, the first one is the most expensive operation > > followed by > > > > two. If you want fast, try doing this with a pooled > > connection and > > > > from compiled servlet code. > > > > > > > > --David > > > > > > > > Charles P. Killmer wrote: > > > > > > > >> Network results > > > >> Ping statistics for *.*.*.*: > > > >> Packets: Sent =3D 140, Received =3D 140, Lost =3D 0 (0% loss), > > > Approximate > > > >> round trip times in milli-seconds: > > > >> Minimum =3D 0ms, Maximum =3D 0ms, Average =3D 0ms Query = Analyzer > > > returns 85 > > >=20 > > > >> rows in 0 seconds. I modified it to only return Name and > > ID and it > > > >> still runs slow. So it cant be row size, network > > latency, hardware > > > >> should be ruled out by the fact that it runs super fast > > > through query > > >=20 > > > >> analyzer, and PHP and ASP.NET. Its only when I write the > > > code in JSP > > > >> for Tomcat that it slows down. > > > >> > > > >> Charles > > > >> > > > >> > > > >> -----Original Message----- > > > >> From: Allistair Crossley > > [mailto:Allistair.Crossley@QAS.com] Sent:=20 > > > >> Monday, February 07, 2005 11:37 AM > > > >> To: Tomcat Users List > > > >> Subject: RE: JTDS help > > > >> > > > >> Hi, > > > >> > > > >> There's no real reason relating to Tomcat or jTDS that > > > this would run > > >=20 > > > >> slow. You are more likely to find answers with your > > > hardware, network > > >=20 > > > >> latency, database load or row size and other > > environmental factors. > > > >> > > > >> Allistair. > > > >> > > > >> > > > >> > > > >>> -----Original Message----- > > > >>> From: Charles P. Killmer > [mailto:charlesk@netgaintechnology.com] > > > >>> Sent: 07 February 2005 17:34 > > > >>> To: Tomcat Users List > > > >>> Subject: JTDS help > > > >>> > > > >>> > > > >>> I am trying to get Tomcat talking to my database quickly.=20 > > > This code > > > >>> takes about 2-3 seconds to load. Anyone got any idea's > > why? Or if > > > >>> you run this in your environment, how well does it run? > > > >>> > > > >>> <%@ page language=3D"java" import=3D"java.sql.*"%> <% > > > Connection conn =3D > > > >>> DriverManager.getConnection("jdbc:jtds:sqlserver://*.*.*.*:143 > > > >>> 3/dbname;u > > > >>> ser=3D******;password=3D*******"); > > > >>> > > > >>> Statement stmt =3D > > conn.createStatement(ResultSet.TYPE_FORWARD_ONLY, > > > >>> ResultSet.CONCUR_READ_ONLY); > > > >>> ResultSet rs; > > > >>> > > > >>> rs =3D stmt.executeQuery("SELECT * FROM accounts"); > > > >>> > > > >>> out.println(""); > > > >>> String name; > > > >>> String ID; > > > >>> while (rs.next()) { > > > >>> name =3D rs.getString("Name"); > > > >>> ID =3D rs.getString("ID"); > > > >>> out.println("" ); } > > > >>> > > > >>> out.println( "
" + ID + > ""+name+"
" ); > > > >>> > > > >>> conn.close(); > > > >>> %> > > > >>> > > > >>> This is just a JSP script, nothing is compiled. I know it > > > is better > > > >>> to compile, but I am trying to chase down this DB > > slowness first. > > > >>> > > > >>> Charles Killmer > > > >>> Netgain Technology > > > >>> CharlesK@NetgainTechnology.com > > > >>> Office: (320) 251-4700 ext 107 > > > >>> > > > >>> > > > >>> > > > >> > > > >> > > > >> > > > >> ------------------------------------------------------- > > > >> QAS Ltd. > > > >> Developers of QuickAddress Software > > >> href=3D"http://www.qas.com">www.qas.com > > > >> Registered in England: No 2582055 Registered in > Australia: No 082 >=20 > > > >> 851 474 > > > >> ------------------------------------------------------- > > > >> > > > >> > > > >> > > > >>=20 > > >=20 > >=20 > --------------------------------------------------------------------- > > > >> To unsubscribe, e-mail:=20 > > tomcat-user-unsubscribe@jakarta.apache.org > > > >> For additional commands, e-mail:=20 > > > tomcat-user-help@jakarta.apache.org > > > >> > > > >> > > > >>=20 > > >=20 > >=20 > --------------------------------------------------------------------- > > > >> To unsubscribe, e-mail:=20 > > tomcat-user-unsubscribe@jakarta.apache.org > > > >> For additional commands, e-mail:=20 > > > tomcat-user-help@jakarta.apache.org > > > >> > > > >> > > > >> > > > > > > > >=20 > > >=20 > >=20 > --------------------------------------------------------------------- > > > > To unsubscribe, e-mail:=20 > tomcat-user-unsubscribe@jakarta.apache.org > > > > For additional commands, e-mail:=20 > > tomcat-user-help@jakarta.apache.org > > > > > > > > > > > > > > >=20 > > >=20 > > >=20 > >=20 > --------------------------------------------------------------------- > > > To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org > > > For additional commands, e-mail:=20 > tomcat-user-help@jakarta.apache.org > > >=20 > > >=20 > > >=20 > >=20 > --------------------------------------------------------------------- > > > To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org > > > For additional commands, e-mail:=20 > tomcat-user-help@jakarta.apache.org > > >=20 > > >=20 > >=20 > >=20 > --------------------------------------------------------------------- > > To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org > > For additional commands, e-mail: tomcat-user-help@jakarta.apache.org > >=20 > >=20 > >=20 > --------------------------------------------------------------------- > > To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org > > For additional commands, e-mail: tomcat-user-help@jakarta.apache.org > >=20 > >=20 >=20 > --------------------------------------------------------------------- > To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org > For additional commands, e-mail: tomcat-user-help@jakarta.apache.org >=20 >=20 > --------------------------------------------------------------------- > To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org > For additional commands, e-mail: tomcat-user-help@jakarta.apache.org >=20 >=20 ------------------------------------------------------- QAS Ltd. Developers of QuickAddress Software www.qas.com Registered in England: No 2582055 Registered in Australia: No 082 851 474 ------------------------------------------------------- --------------------------------------------------------------------- To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: tomcat-user-help@jakarta.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: tomcat-user-help@jakarta.apache.org