Re: Tomcat Performance

2008-11-12 Thread Peng Tuck Kwok
David, was replying to Charles's earlier email on that.
I thought I read it right first in the email and assumed Charles was correct
in that.
Hazards of reading mail on the go :P


On Wed, Nov 12, 2008 at 9:26 PM, David kerber [EMAIL PROTECTED] wrote:

 Peng Tuck Kwok wrote:

 Probably the reason why he's seeing one instance of tomcat moving quicker
 than 2 instances is the fact that there is some form of contention for
 resources on that single machine assuming that the 2 instances are
 configured identically in every aspect (other than ports).


 You mis-read it.  He's seeing twice the performance from two instances than
 he is one single one, which shouldn't be if the one is properly configured,
 (with the exception noted below).

 D


  The idea is not to give you a 0-60 mph capability with 2 tomcats on a
 single
 box (partition) but to give you better throughput. As I understand it,
 when
 you start getting more load, you'd be able to handle the requests in a
 linear fashion (again assuming you've sized the 2 or more instances
 correctly).

 *I would rarely recommend that a client run parallel app servers on the


 same machine for the same application for any purposes other than being
 able to switch between versions of the same application (say, for
 zero-downtime upgrade strategy).


 *I wouldn't recommend anyone do that just to switch versions for a zero
 downtime upgrade strategy as well. Some sort of DR would be better for
 this
 ? Down production and switch to DR then when upgrades are complete just
 reverse what has been done.

 *Since the OP didn't say that's what his


 requirements were, there doesn't seem to be a compelling reason to use
 this strategy.


 *You're right, until we really know what his requirements/KPI's on that
 are
 then most of this is largely academic.

 Nishi, the link to the redbook is here
 http://www.redbooks.ibm.com/abstracts/sg246392.html?Open .
 It's websphere specific, but there's still lot of things you can pick up
 on
 and probably apply.

 On Wed, Nov 12, 2008 at 5:15 AM, Christopher Schultz 
 [EMAIL PROTECTED] wrote:



 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1

 Pengtuck,

 [EMAIL PROTECTED] wrote:


 So let me get this straight. You are reluctant to accept a
 configuration which gives you improved throughput ? :P


 No, the OP is unwilling to use a configuration that doesn't make any
 sense: one single Tomcat should outperform two Tomcats on the same
 physical server (unless you are talking about a 32-bit JVM that needs a
 lot of memory).



 Anyway, this is not an unusual approach, from what I understand this
 simply makes full use of the resources available on that machine. Not
 uncommon in real world to see app servers like websphere being
 configured in that manner.


 I would rarely recommend that a client run parallel app servers on the
 same machine for the same application for any purposes other than being
 able to switch between versions of the same application (say, for
 zero-downtime upgrade strategy). Since the OP didn't say that's what his
 requirements were, there doesn't seem to be a compelling reason to use
 this strategy.

 - -chris





 -
 To start a new topic, e-mail: users@tomcat.apache.org
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




Re: Tomcat Performance

2008-11-11 Thread Peng Tuck Kwok
Probably the reason why he's seeing one instance of tomcat moving quicker
than 2 instances is the fact that there is some form of contention for
resources on that single machine assuming that the 2 instances are
configured identically in every aspect (other than ports).

The idea is not to give you a 0-60 mph capability with 2 tomcats on a single
box (partition) but to give you better throughput. As I understand it, when
you start getting more load, you'd be able to handle the requests in a
linear fashion (again assuming you've sized the 2 or more instances
correctly).

*I would rarely recommend that a client run parallel app servers on the
same machine for the same application for any purposes other than being
able to switch between versions of the same application (say, for
zero-downtime upgrade strategy).
*I wouldn't recommend anyone do that just to switch versions for a zero
downtime upgrade strategy as well. Some sort of DR would be better for this
? Down production and switch to DR then when upgrades are complete just
reverse what has been done.

*Since the OP didn't say that's what his
requirements were, there doesn't seem to be a compelling reason to use
this strategy.
*You're right, until we really know what his requirements/KPI's on that are
then most of this is largely academic.

Nishi, the link to the redbook is here
http://www.redbooks.ibm.com/abstracts/sg246392.html?Open .
It's websphere specific, but there's still lot of things you can pick up on
and probably apply.

On Wed, Nov 12, 2008 at 5:15 AM, Christopher Schultz 
[EMAIL PROTECTED] wrote:

 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1

 Pengtuck,

 [EMAIL PROTECTED] wrote:
  So let me get this straight. You are reluctant to accept a
  configuration which gives you improved throughput ? :P

 No, the OP is unwilling to use a configuration that doesn't make any
 sense: one single Tomcat should outperform two Tomcats on the same
 physical server (unless you are talking about a 32-bit JVM that needs a
 lot of memory).

  Anyway, this is not an unusual approach, from what I understand this
  simply makes full use of the resources available on that machine. Not
  uncommon in real world to see app servers like websphere being
  configured in that manner.

 I would rarely recommend that a client run parallel app servers on the
 same machine for the same application for any purposes other than being
 able to switch between versions of the same application (say, for
 zero-downtime upgrade strategy). Since the OP didn't say that's what his
 requirements were, there doesn't seem to be a compelling reason to use
 this strategy.

 - -chris

 -BEGIN PGP SIGNATURE-
 Version: GnuPG v1.4.9 (MingW32)
 Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

 iEYEARECAAYFAkkZ9fwACgkQ9CaO5/Lv0PCmmgCgsIDI3iuM/UZxuIeeeYxG20Sa
 f9YAoLBuum66IMTuSly3Q8kXQN8LaYz1
 =7sA/
 -END PGP SIGNATURE-

 -
 To start a new topic, e-mail: users@tomcat.apache.org
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




RE: Oracle 11g

2008-10-22 Thread Peng Tuck Kwok
Well where to start?

1. Pretty much from version 4 of tomcat you've would have been able to
connect to oracle using JDBC using the oracle supplied driver.

2. Well typically you connect to any database in java using JDBC,
difference in app servers is that they provide you a means to
configure this as a managed resource that is available to your
applications. As one astue poster pointed out you should look under
the respective section of the tomcat documentation which matches t

Sent from my Nokia phone
-Original Message-
From: Raj Shivanna
Sent:  22/10/2008 08:44:44
To: 'users@tomcat.apache.org'
Subject:  Oracle 11g

Hi,

could you give more detail information about these :
1. What is Tomcat version that can support Oracle 11G ?
2. How do I connect to Oracle 11G ? Do I need to get the driver from
oracle first ? because I think there is no Oracle 11G driver specified
in Tomcat.
3. Based on your experience, do you have problems when you use Tomcat
and Oracle 11G ?

Please advice ...

Thx

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Tomcat outputs php to stderr

2008-10-02 Thread Peng Tuck Kwok
I recall seeing a config value in php that lets you dump the output to the 
console instead of the rendered page. not sure if this is valid if you run php 
under tomcat :P


-Original Message-
From: Serge Fonville
Sent:  30/09/2008 19:08:21
To: Tomcat Users List
Subject:  Re: Tomcat outputs php to stderr

Thank you so far, I will definitely look into Quercus.

Still, I would like to understand why output is sent to stderr and if it can
be solved (I recall running PHP and tomcat in the past) without problems


On Tue, Sep 30, 2008 at 12:04 AM, Johnny Kewl [EMAIL PROTECTED] wrote:


 - Original Message - From: Serge Fonville 
 [EMAIL PROTECTED]
 To: users@tomcat.apache.org
 Sent: Monday, September 29, 2008 6:00 PM
 Subject: Tomcat outputs php to stderr



 Hi,
 I am developing a ticket system which should use servlets to connect to
 the
 various resources.
 Currently I am a php developer and busy to learn JSP/TLD/Servlets
 I installed Tomcat 6.0.18 with PHP 5.2.6 on Windows Vista Business (the
 production server will be running either Gentoo or CentOS).

 Installation went fine, no errors. just one thing I couldn't resolve.
 All output generated by php goes directly to the stderr log file instead
 of
 the browser (JSP and servlets work fine)

 I used

 http://blog.taragana.com/index.php/archive/running-php-5x-on-windows-using-tomcat-4x-or-5x/
 and http://wiki.apache.org/tomcat/UsingPhp to configure the two.

 I started reading about listeners, log4j and servlet mappings.
 This seemed over the top to me, so I decided to just ask the  question
 here.

 Any help is greatly appreciated



 Dont do it this way... run PHP on Apache httpd... its the PHP container...
 and do your servlet stuff in TC... its a good servlet container.
 Then put Apache httpd in front of TC... read up on the JK connector... and
 then to the browser its *one system*
 Thats how they do it ;)

 If you insist on wanting the Java PHP layer... Resin is probably the
 best... they not calling into a PHP engine, they rewrote it in Java...
 whether they up to date with all modules is the question?

 Anyway... just trying to show you that you dont have to change a thing...
 join em ;)

 Have fun..

 ---
 HARBOR : http://www.kewlstuff.co.za/index.htm
 The most powerful application server on earth.
 The only real POJO Application Server.
 See it in Action : http://www.kewlstuff.co.za/cd_tut_swf/whatisejb1.htm
 ---


 -
 To start a new topic, e-mail: users@tomcat.apache.org
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: jstack and Tomcat 6 on Windows

2008-09-23 Thread Peng Tuck Kwok
Hmm if you have a memory leak in the application perhaps you can profile it
using a profiler. Try the one in eclipse and attach as a remote client to
the vm running tomcat.

On Sat, Sep 20, 2008 at 6:58 AM, Brian Clark [EMAIL PROTECTED] wrote:

 Thanks everyone for their suggestions.

 Unfortunately, that doesn't help me with my particular issue. I have a
 memory leak in one of my apps, and when the system runs out of memory, it
 stops responding to new requests. I have a script that will detect this
 condition and automatically restart Tomcat. I was hoping to add a jstack
 command to this script to give me a thread dump prior to restarting Tomcat
 to give me better troubleshooting information. Your solution would work
 under normal circumstances, but I don't know how to script a ctrl+break.
  ;-)

 - Original Message 

 From: Johnny Kewl [EMAIL PROTECTED]

 If you need thread dumps

 Start TC from the BAT file.
 When you need a dump... press ctrl + break from term window... easier than
 Jstack...






Re: Server Maintenance Across Timezones (global)

2008-09-18 Thread Peng Tuck Kwok
There's a lot of good suggestions here, maybe you could also justify
maintaining a separate instance for the American customers. That would at
least allow at a minimum to roll out changes specific for them, conform to
their maintenance time :P. Yes I do realize it would be a replication of
code in terms of releases but it is something to think about.

On Thu, Sep 18, 2008 at 5:05 AM, Bill Davidson [EMAIL PROTECTED] wrote:

 My company's main webapp is used around the world (Europe, North America,
 Australia, etc.).

 We're using Tomcat as our app server and Oracle (10g) for our database.

 When we want to do an upgrade, that usually involves DDL changes to the
 database as well as corresponding changes to the webapp which means we
 have to make our users log out so we can shut down the app, update the
 DDL and restart the updated webapp.  The changes are interdependent.
 It's all or nothing.

 This was not a big problem when we were just doing business in the U.S.
 We'd do upgrades late at night when nobody (or hardly anyone) was using
 the system.  The problem now is that late at night here is middle of
 the day in other places and downtime in the middle of the day is a real
 problem.  Our customers use our app to run parts of their business so
 downtime in the middle of the day is very very bad.  They understandably
 don't like telling their customers: I'd like to help you but I need to
 wait for the Americans to upgrade their systems.

 I'm not sure how to deal with this.  I've been trying to think of a way
 to use multiple servers and multiple databases but that seems like a
 synchronization nightmare.  Losing data consistency is not an option.

 I'm sure that plenty of others on this list have had to deal with this
 problem.  Any suggestions?  How have others dealt with it?



 -
 To start a new topic, e-mail: users@tomcat.apache.org
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




RE: How do you have your dev environment setup?

2008-09-16 Thread Peng Tuck Kwok
You could use ant to automate it. I've tried deploying from eclipse to tomcat 
briefly. It seemed alright as well. Don't know too much about the quirks since 
I delopy to JBoss primarily.  

-Original Message-
From: Bai Shen
Sent:  17/09/2008 05:59:08
To: Tomcat Users List
Subject:  How do you have your dev environment setup?

I've been doing a lot of webapp development on tomcat, but currently my
process is all manual.  I write the code in Eclipse, and then copy the
appropriate files over to tomcat.  I'd like to automate and standardize my
process.

So would y'all mind explaining how your dev environment is configured?  I'd
appreciate the insight.  TIA.


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Why GlassFish

2008-09-04 Thread Peng Tuck Kwok
Johnny, you're having way too much fun :D .
Sam to answer your question, tomcat simply is the reference implementation
of servlet and jsp specification from Sun (and a damn fine one at that
too).

Glassfish like other comparable app servers out there implement the JEE
specification (well whichever they are targeting) and as such they do much
more (as required by the spec).

Probably some confusion arises when you find that they can both do servlets
and jsp (web applications). This is because the app servers should provide
that feature.

So if you're looking to do ejb's a full blown app server would serve you
well. If you get by fine with just servlets+jsp+other frameworks thrown in
then tomcat is pretty suitable for you as well.

HIH


On Fri, Aug 29, 2008 at 3:32 AM, Johnny Kewl [EMAIL PROTECTED] wrote:


 --
 Ha ha... time to have some fun...

 They stole Tomcat... and messed it up ;)

 On a more serious not (if I can do it)... J2EE is a bit of a confusing
 definition... its got a wide scope.
 Within that... you have servlet containers... like Tomcat... aimed at the
 web but are actually capable of just about anything in a POJO designers
 hands.
 And then you get EJB what the hell does it do again... oh yes, it runs
 beans, and you have to join AA and find a good therapist ;)

 Tomcat can also do beans but they have rolled it up into what they call
 biz logic, and tried to add many other tools, like for example they also
 plug RMI into it so you can call it from other Java applications, not just
 from a browser...

 They overlap alot... but they are different tools
 In general... WEB == TOMCAT

 And its true that Tomcat is inside Glassfish somewhere... in fact if you
 drop a war into the fish... it will probably work... but not the other way
 around.

 Thats why some people in this group... with doubtful principles... say
 things like... something fishy going on, or I just like my pussy ;)
 ---
 HARBOR : http://www.kewlstuff.co.za/index.htm
 The most powerful application server on earth.
 The only real POJO Application Server.
 See it in Action : http://www.kewlstuff.co.za/cd_tut_swf/whatisejb1.htm
 ---






 -
 To start a new topic, e-mail: users@tomcat.apache.org
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




Re: Why GlassFish

2008-09-04 Thread Peng Tuck Kwok
Meh, need to check tomcat more often :P
On Thu, Sep 4, 2008 at 4:52 PM, Leon Rosenberg 
[EMAIL PROTECTED] wrote:

 On Thu, Sep 4, 2008 at 11:48 AM, Peng Tuck Kwok [EMAIL PROTECTED]
 wrote:
  Johnny, you're having way too much fun :D .
  Sam to answer your question, tomcat simply is the reference
 implementation
  of servlet and jsp specification from Sun (and a damn fine one at that
  too).

 No its not. Glassfish is the reference implementation of the servlet
 spec  (since tomcat 5.0.25) :-)

 Leon

 Still, tomcat is the better implementation, simply because it doesn't
 have all the ejb stuff :-)

 -
 To start a new topic, e-mail: users@tomcat.apache.org
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




Re: Tomcat causing high CPU load

2007-11-05 Thread Peng Tuck Kwok
Is there a link for Moskito?

On Nov 6, 2007 6:21 AM, Leon Rosenberg [EMAIL PROTECTED] wrote:
 Moskito can display monitoring traces instantly (path through
 monitoring points) and measure time in each call and sub-calls, but it
 requires some source code adoption.

 regards
 Leon


 On 11/5/07, Caldarale, Charles R [EMAIL PROTECTED] wrote:
   From: Caldarale, Charles R
   Subject: RE: Tomcat causing high CPU load
  
   There are also some 3rd-party tools to take thread dumps of
   services (I think JProbe does, for example).
 
  Also, Lambda Probe (www.lambdaprobe.org) can display stack traces, but
  only one thread at a time.
 
   - Chuck
 
 
  THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
  MATERIAL and is thus for use only by the intended recipient. If you
  received this in error, please contact the sender and delete the e-mail
  and its attachments from all computers.
 
  -
  To start a new topic, e-mail: users@tomcat.apache.org
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 

 -
 To start a new topic, e-mail: users@tomcat.apache.org
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]



-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Page Expire

2007-11-01 Thread Peng Tuck Kwok
Hi,

You can configure the manager element inside a context element to specify a
longer duration before it expires. The manager element in a context is not
compulsory, so you might have to add it in for your web application.
Instructions are here (for the manager):

http://tomcat.apache.org/tomcat-5.5-doc/config/manager.html

and a wee bit more for the context:

http://tomcat.apache.org/tomcat-5.5-doc/config/context.html

Kind regards,

Peng Tuck.


On 11/1/07, tbt [EMAIL PROTECTED] wrote:


 Hi

 I'm a newbie to tomcat and I would like to increase the time duration that
 a
 page expires if it remains idle.
 Currently in my web application if a user remains idle for 20 minutes and
 tries to use the application again a default page is shown to the user
 stating that the page expired. How can I increase the time duration in
 which
 a page should expire after remaining idle.

 Thanks
 --
 View this message in context:
 http://www.nabble.com/Page-Expire-tf4729501.html#a13523664
 Sent from the Tomcat - User mailing list archive at Nabble.com.


 -
 To start a new topic, e-mail: users@tomcat.apache.org
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




Re: Fix to Tomcat Jasper slow .tag compilation problem.

2007-10-29 Thread Peng Tuck Kwok
Would pre-compiling your jsp files help you instead? AFAIK that works on the
tags so you probably don't need to touch jspc.

On 10/29/07, Berglas, Anthony [EMAIL PROTECTED] wrote:

 As described in a previous post, Jasper is *extremely* slow at compiling
 .tag files packaged in a .jar.  Tens of seconds every time you touch a
 new .jsp for the first time.  Almost unusable if you use .tags
 extensively, as I do.

 The following few lines is a hack to fix this.  The added code is marked
 between //  AJB markers.  It effectively turns off the timestamp
 checking on .jar files.

 This does NOT actually introduce a bug.  There is an existing bug in
 that .jsp files are not automatically recompiled if any .tags in .jars
 are changed.  So you need to purge work in either case.  A proper fix
 would be to check dependencies properly, at least to the .jar file
 itself.  But the current fix is *much* better that the existing
 behavior.

 COULD SOMEBODY PLEASE ARRANGE FOR THIS CODE TO BE ADDED TO THE CURRENT
 SUBVERSION REPOSITORY?

 Outstanding is to make the compilation of .tags themselves much faster,
 not tens of seconds.  To do that one needs to call the Java compiler
 once at the end for all the .tags, rather than once for each individual
 .tag which is *much* slower.

 I must admit that I got rather lost reading the Jasper source, with all
 the contexts etc.  Some better comments on the classes describing their
 relationships to each other would be most helpful.

 Thanks,

 Anthony



 // Tomcat 6.0.10 Src deployed version.

 public class JspCompilationContext {...

 public void compile() throws JasperException, FileNotFoundException
 {
 createCompiler();

 //  begin AJB
 // Hack to stop .tag files that are packaged in .jars being
 recompiled for every single .jsp that uses them.
 // The hack means that .tag files will not be automatically
 recompiled if they change -- you need to delete work area.
 // But that was actually an existing bug -- .jsps are not
 dependent on the .tag .jars so the work area needed deleting anyway.
 // (Outstanding is to compile multiple .tags in one pass and so
 make the process Much faster.)
 boolean outDated;
 if (isPackagedTagFile) outDated = ! new
 File(getClassFileName()).exists();
 else outDated = jspCompiler.isOutDated();
 //AjbLog.log(### Compiler.compile  + jspUri +  pkgTagFile  +
 isPackagedTagFile +  outDated  + outDated +   + getClassFileName());
 if (outDated) {
 // if (isPackagedTagFile || jspCompiler.isOutDated()) {
 //  end AJB
 try {
 jspCompiler.removeGeneratedFiles();
 jspLoader = null;
 jspCompiler.compile();
 jsw.setReload(true);
 jsw.setCompilationException(null);
 } catch (JasperException ex) {
 // Cache compilation exception
 jsw.setCompilationException(ex);
 throw ex;
 } catch (Exception ex) {
 JasperException je = new JasperException(

 Localizer.getMessage(jsp.error.unable.compile),
 ex);
 // Cache compilation exception
 jsw.setCompilationException(je);
 throw je;
 }
 }
 }

 --
 Dr Anthony Berglas
 Ph. +61 7 3227 4410
 Mob. +61 44 838 8874
 [EMAIL PROTECTED]; [EMAIL PROTECTED]


 -
 To start a new topic, e-mail: users@tomcat.apache.org
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




Re: Fix to Tomcat Jasper slow .tag compilation problem.

2007-10-29 Thread Peng Tuck Kwok
On 10/30/07, Berglas, Anthony [EMAIL PROTECTED] wrote:

 Precompiling would not help.

 1. Precompiling JSPs with .tag files is broken in Jasper, if tags call
 other tags.

 2. If it were fixed I would imagine that it would still recompile each
 tag over and over again.  A precompile of a few dozen jsps would then
 take hours.

 The next issue to fix is the very slow one tag at a time Java compiles.
 Then the dependencies can be looked at, but the code is fairly complex.

 My enthusiasm for addressing these issues is dependent on the community
 being able to incorporate my fixes into the core.  Otherwise I fork
 Tomcat, not a good idea.

 My feeling is that my fix below will just be ignored.

 Anthony

  -Original Message-
  From: Peng Tuck Kwok [mailto:[EMAIL PROTECTED]
  Sent: Monday, October 29, 2007 8:17 PM
  To: Tomcat Users List
  Subject: Re: Fix to Tomcat Jasper slow .tag compilation problem.
 
  Would pre-compiling your jsp files help you instead? AFAIK that works
 on
  the
  tags so you probably don't need to touch jspc.
 
  On 10/29/07, Berglas, Anthony [EMAIL PROTECTED] wrote:
  
   As described in a previous post, Jasper is *extremely* slow at
 compiling
   .tag files packaged in a .jar.  Tens of seconds every time you touch
 a
   new .jsp for the first time.  Almost unusable if you use .tags
   extensively, as I do.
  
   The following few lines is a hack to fix this.  The added code is
 marked
   between //  AJB markers.  It effectively turns off the
 timestamp
   checking on .jar files.
  
   This does NOT actually introduce a bug.  There is an existing bug in
   that .jsp files are not automatically recompiled if any .tags in
 .jars
   are changed.  So you need to purge work in either case.  A proper
 fix
   would be to check dependencies properly, at least to the .jar file
   itself.  But the current fix is *much* better that the existing
   behavior.
  
   COULD SOMEBODY PLEASE ARRANGE FOR THIS CODE TO BE ADDED TO THE
 CURRENT
   SUBVERSION REPOSITORY?
  
   Outstanding is to make the compilation of .tags themselves much
 faster,
   not tens of seconds.  To do that one needs to call the Java compiler
   once at the end for all the .tags, rather than once for each
 individual
   .tag which is *much* slower.
  
   I must admit that I got rather lost reading the Jasper source, with
 all
   the contexts etc.  Some better comments on the classes describing
 their
   relationships to each other would be most helpful.
  
   Thanks,
  
   Anthony
  
  
  
   // Tomcat 6.0.10 Src deployed version.
  
   public class JspCompilationContext {...
  
   public void compile() throws JasperException,
 FileNotFoundException
   {
   createCompiler();
  
   //  begin AJB
   // Hack to stop .tag files that are packaged in .jars being
   recompiled for every single .jsp that uses them.
   // The hack means that .tag files will not be automatically
   recompiled if they change -- you need to delete work area.
   // But that was actually an existing bug -- .jsps are not
   dependent on the .tag .jars so the work area needed deleting anyway.
   // (Outstanding is to compile multiple .tags in one pass and
 so
   make the process Much faster.)
   boolean outDated;
   if (isPackagedTagFile) outDated = ! new
   File(getClassFileName()).exists();
   else outDated = jspCompiler.isOutDated();
   //AjbLog.log(### Compiler.compile  + jspUri +  pkgTagFile
  +
   isPackagedTagFile +  outDated  + outDated +   +
 getClassFileName());
   if (outDated) {
   // if (isPackagedTagFile || jspCompiler.isOutDated()) {
   //  end AJB
   try {
   jspCompiler.removeGeneratedFiles();
   jspLoader = null;
   jspCompiler.compile();
   jsw.setReload(true);
   jsw.setCompilationException(null);
   } catch (JasperException ex) {
   // Cache compilation exception
   jsw.setCompilationException(ex);
   throw ex;
   } catch (Exception ex) {
   JasperException je = new JasperException(
  
   Localizer.getMessage(jsp.error.unable.compile),
   ex);
   // Cache compilation exception
   jsw.setCompilationException(je);
   throw je;
   }
   }
   }
  
   --
   Dr Anthony Berglas
   Ph. +61 7 3227 4410
   Mob. +61 44 838 8874
   [EMAIL PROTECTED]; [EMAIL PROTECTED]
  
  
  
 -
   To start a new topic, e-mail: users@tomcat.apache.org
   To unsubscribe, e-mail: [EMAIL PROTECTED]
   For additional commands, e-mail: [EMAIL PROTECTED]
  
  

 -
 To start a new topic, e-mail: users@tomcat.apache.org

RE: Connection Pool and Connections

2007-10-09 Thread Peng Tuck Kwok
If I recall correctly close from a datasource (not a SQLConnection) will return 
the connection to the pool for reuse. In the later this will close the 
connection to the database.
 To answer your question I'm pretty sure any statement executed within the 
connection from the datasource will go to the same database

- original message -
Subject:Connection Pool and Connections
From:   lightbulb432 [EMAIL PROTECTED]
Date:   01/06/2007 19:01


When using the tomcat-dbcp DataSource, when my web application code gets a
connection:

myConnection = myDataSource.getConnection();

then executes multiple separate statements

myStatement1 = myConnection.createStatement();
myStatement1.execute();

myStatement2 = myConnection.createStatement();
myStatement2.execute();

then close the connection

myConnection.close();

Is it possible that myStatement1 and myStatement2 would be run using
different physical database connections, or are they absolutely guaranteed
to be executed using the same connection?

Or is connection pooling only for not actually closing the physical database
connection on myConnection.close(), instead returning it to the connection
pool?

A different way of asking this is does connection pooling pool connections
within an application connection (myDataSource.getConnection() and
myConnection.close()), or between application connections?

If this question doesn't make sense, I can clarify. Thanks a lot.
-- 
View this message in context: 
http://www.nabble.com/Connection-Pool-and-Connections-tf3853952.html#a10918685
Sent from the Tomcat - User mailing list archive at Nabble.com.


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Tomcat Version problem

2007-07-05 Thread Peng Tuck Kwok

Sounds like that are a lot of type mis-match  in the generated servlets, I'd
have a look at the JSP's to see if there's anything like that in there and
correct it.

On 7/5/07, Gregor Schneider [EMAIL PROTECTED] wrote:


well, the error-log is giving you pretty good hints:


 An error occurred at line: 67 in the jsp file: /classification.jsp
 Generated servlet error:
 Type mismatch: cannot convert from Integer to int

 An error occurred at line: 67 in the jsp file: /classification.jsp
 Generated servlet error:
 The method add(int, Object) in the type ArrayList is not applicable for
the
 arguments (int)

 An error occurred at line: 226 in the jsp file: /classification.jsp
 Generated servlet error:
 The method setAttribute(String, Object) in the type ServletRequest is
not
 applicable for the arguments (String, int)

 An error occurred at line: 263 in the jsp file: /classification.jsp
 Generated servlet error:
 The method setAttribute(String, Object) in the type ServletRequest is
not
 applicable for the arguments (String, int)

My guess is, that you've developed your JSPs using a different JDK
than what your client is running, and some method-signatures seem to
have changed between the different JDKs.

Check what JDK your client is running, compare them and then fix your
code accordingly.

HTH

Gregor
--
what's puzzlin' you, is the nature of my game
gpgp-fp: 79A84FA526807026795E4209D3B3FE028B3170B2
gpgp-key available @ http://pgpkeys.pca.dfn.de:11371

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: Tomcat Version problem

2007-07-05 Thread Peng Tuck Kwok

I have no idea where your line numbers are but the jsp compiler is already
asking you to look at 67, 223, 226 in your JSP. Possibly you get cast
exceptions because whatever you are trying to cast to isn't cast-able or
converted. Also please double check the types of the objects you are passing
into the methods, the compiler seems to be complaining about it.


On 7/5/07, Girish Havaldar [EMAIL PROTECTED] wrote:


ths is the jsp page:


[EMAIL PROTECTED] import=java.sql.*,java.util.*,logcheck.settings errorPage=
errorpage.jsp%
html
head
title classification/title/head
script type=text/javascript src=dropdown.js/script
body bgcolor=#FF 
LINK rel=stylesheet href=style.css type=text/css  /
form action=classification.jsp method=POST name=classif
onSubmit=return check()
   %

settings set=new settings();
int flag = 0;
flag = set.islogedin(request,response);
 if(flag!=1){
  out.println(htmlbodycenterbYour  session is
invalidate..Press F5 or refresh it/b/center/body/html);

  }
else if(session.isNew()){
out.println(script language=javascript
parent.location.href='expair.jsp';/script);
}
else
{

  %
   br
 script language=javascript
  function check()
{
  var id = document.getElementById(clname);
  if(id.value ==''){
  alert(Empty);
  return false;
}
 return true;
  }

   function ses_check(url)
   {
 if(confirm(It will delete all the question coming under this
Classification ! DO You Want to Proceed )){
 document.location.href=url;

   }
   }


   function online(level,cid)
   {

document.location.href=online.jsp?level=+level+CID=+cid+e_type=1;

   }

   function written(level,cid)
   {
   document.location.href=wedastr.jsp
?level=+level+CID=+cid+e_type=0;

   }
   function onlineedit(level,cid)
   {
   document.location.href=mangquest.jsp
?e_type=1sel_level=+level+CID=+cid+;
   }

   function writtenedit(level,cid)
   {
 document.location.href=mangquest.jsp
?sel_level=+level+CID=+cid+e_type=0
;
   }


  /script

%
  int userid=0;
if(session.getAttribute(uid)!=null){
 userid=
Integer.valueOf(+session.getAttribute(uid));

}
else{
out.println(script language=javascript
parent.location.href='expair.jsp';/script);
}

PreparedStatement stmt = null;
  Connection conn= null;
 ResultSet resultset=null;
ResultSet resultset1=null;
  ResultSet result=null;
   ResultSet res=null;
   ResultSet resdel=null;
  Statement statement=null;
Statement statement1=null;

  String subject=new String();
  String class_name=new String();
  String noqt=new String();

conn=set.getcon();
String PID_str = request.getParameter(PID);
int PID=0;

statement = conn.createStatement();
statement1 = conn.createStatement();

 String delete = request.getParameter(delete);

 if((request.getParameter(delete)!= null)  (
request.getParameter
(delete).equals(yes)))
   {
  ResultSet rss=null;
int C_Id_todel = Integer.parseInt(
request.getParameter(CID));
ArrayList tnoarr=new ArrayList();
 ArrayList cidarr=new ArrayList();
 if((request.getParameter(CID) != null)(userid != 0))
 {
cidarr.clear();
int avail=0;
rss=statement.executeQuery(select CID from
classification where PID=+C_Id_todel+ and UID=+userid+ );
while(rss.next())
{
avail=1;
}
if(avail==1){
out.println(script
language='javascript'alert('NOT POSSIBLEit contains a sub
classification');/script);
}
else{
rss=statement.executeQuery(select T_No from
questionbank where CID=+C_Id_todel+ );
 while(rss.next())
 {
 tnoarr.add(rss.getInt(1));
 }
statement.execute(delete from classification
where CID=+C_Id_todel+ and UID=+userid+);
for(int j=0;jtnoarr.size();j++)
{
 statement.execute(delete from
questionbank where T_No=+tnoarr.get(j)+ );