You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Kitching Simon <Si...@orange.ch> on 2000/08/30 17:49:18 UTC

RE: similar Problems with JDBC : connection lost after several ac cess

We had a similar problem.

When you have finished with a PreparedStatement instance,
call its "close" method. This method does eventually get called 
when the object gets garbage-collected, but that is usually too late.

This might solve it.....

> -----Original Message-----
> From:	Victor Chinnappan [SMTP:cvdoss@yahoo.com]
> Sent:	Wednesday, August 30, 2000 5:36 PM
> To:	tomcat-user@jakarta.apache.org
> Subject:	RE: similar Problems with JDBC : connection lost after
> several ac cess
> 
> We used to have this in one of our earlie projects
> (Something similar...). The code was not releasing the
> opened connections and there is a limit on the number
> of Database connections that can be served by an
> RDBMS. We were using Personal ORCALE Lite and it had a
> limit of 11 connections. So as soon as we used up the
> 11 connections it would complain "Too many files open"
> or something similar.... If we shutdown the system
> (which automatically frees all resources, Thank GOD)
> then it would work fine. I would suggest that you take
> one more look at the connection pool protocol that you
> might be following and make sure you release the
> aquired connections at the appropriate times or have a
> worker that would monitor STALE connections. Initially
> when using the DBConnectionBroker, i had missed a
> couple of freeConnection() calls and it showed up in
> the log files.... Thanks to DBConnectionBroker. 
> 
> HTH,
> VC
> --- David Cao <dc...@e-travel.com> wrote:
> > Thanks, but i am using my own connection pool, and
> > the connection lost after
> > around 8 access to the database, the error message
> > say can't find suitable
> > drive, after restart, it works find, after several
> > access, it happen again.
> > 
> > Does some body have any idea about this? 
> > 
> > david
> > 
> > 
> > -----Original Message-----
> > From: Morahg, Yoav [mailto:ymorahg@gist.com]
> > Sent: Wednesday, August 30, 2000 10:11 AM
> > To: 'tomcat-user@jakarta.apache.org'
> > Subject: RE: similar Problems with JDBC : connection
> > lost after several
> > ac cess
> > 
> > 
> > Just a thought... is your DBConnectionBroker set up
> > to use autocommit or do
> > you need to commit changes manually. If the second
> > is the case, you might
> > not see a new record in the database unless you
> > committed it when you
> > created it.
> > 
> > -Y
> > 
> > ---------------------------
> > Yoav Morahg
> > Software Engineer
> > Gist Communications
> > (212) 965-1999 xt 122
> > ymorahg@gist.com
> > 
> > 
> > -----Original Message-----
> > From: Victor Chinnappan [mailto:cvdoss@yahoo.com]
> > Sent: Wednesday, August 30, 2000 9:36 AM
> > To: tomcat-user@jakarta.apache.org
> > Subject: Re: similar Problems with JDBC : connection
> > lost after several
> > access
> > 
> > 
> > Hi,
> > I came across a dbconnectionbroker class that does
> > the
> > connection pooling et al. this is available at
> > www.javaexchange.com and is free. I also read that
> > there is one at Apache, which is called turbine.
> > Turbine is actually an assorted collection of App
> > Server utilities. I have been using
> > DBConnectionBroker. Most others say it is really
> > good,
> > albeit i have a strange problem for now. But, again
> > i
> > am trying to trace it to my code. 
> > 
> > The problem i am facing is that of not being able to
> > find a record that was just then created in a table.
> > When a user logs into our system, a sessionID is
> > created and further communication from the client
> > should be based on this session id. So when i try to
> > validate the session id just then created, it
> > returns
> > false for simple query. Not sure why....
> > anyway, a lot of others are using this without any
> > problems... so should be fine...
> > 
> > Cheers!!!!
> > Victor.C
> > 
> > --- David Cao <dc...@e-travel.com> wrote:
> > > Hi Stefan,
> > >  
> > > I have a very similar problem, I wrote my own
> > > connection pool, after several
> > > success access to the database, the connection
> > lost
> > > ! the error message
> > > says, con't find suitable driver. and once I
> > restart
> > > the tomcat, it work
> > > fine !
> > >  
> > > I am thinking it's a bug on my code, but now I am
> > > thinking is this a seting
> > > problem in tomact or JDBC? I will looking at this
> > > problem soon, pls keep let
> > > me know if you got any progress, I will also let
> > you
> > > know if i got further
> > > information.
> > >  
> > > Thanks.
> > > david
> > > 
> > > -----Original Message-----
> > > From: Stefan Urban [mailto:surban@pevo.de]
> > > Sent: Tuesday, August 29, 2000 6:14 AM
> > > To: tomcat-user@jakarta.apache.org
> > > Subject: Problems with JDBC
> > > 
> > > 
> > > Hi,
> > >  
> > > I wrote a Servlet, which connects to a
> > > MySQL-Database. When I'm starting
> > > Tomcat
> > > it all works fine. But several Time later, the
> > > Servlet can't established the
> > > Database-
> > > connection again. I set the Classpath right,
> > because
> > > when I'm stopping
> > > Tomcat, he shows me the rigth Classpath. When I'm
> > > starting Tomcat again, it
> > > all works fine again!!
> > >  
> > > Why the hell it does not work several time later?
> > > Where should I set the
> > > Classpath?
> > >  
> > > Thanx.
> > >  
> > > -Stefan
> > > 
> > 
> > 
> > __________________________________________________
> > Do You Yahoo!?
> > Yahoo! Mail - Free email you can access from
> > anywhere!
> > http://mail.yahoo.com/
> 
> 
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Mail - Free email you can access from anywhere!
> http://mail.yahoo.com/

Re: example.war, test.war etc file are not extracted

Posted by surinder singh <su...@bflsoftware.com>.
Thanks a lot Matt.
now i am able to get all those beautiful examples with ur help.

-Surinder

Matt Goss wrote:

> Surinder,
> Make sure you delete the directory the war will be extracted into....
> For example, You have a context call "test" that resides in the directory
> "<tomcat home>/webapps/test" Then you put your "test.war" file into the <tomcat
> home>/webapps directory and delete the test directory. If you restart tomcat the
> war file will be unpacked.
> Matt Goss
>
> surinder singh wrote:
>
> > As the the documentation says (.war ) in the webapps should be extracted and
> > installed by tomcat during startup, but here I am not getting them as so.
> >
> > what to do to make them working?


Re: example.war, test.war etc file are not extracted

Posted by Matt Goss <mg...@rtci.com>.
Surinder,
Make sure you delete the directory the war will be extracted into....
For example, You have a context call "test" that resides in the directory
"<tomcat home>/webapps/test" Then you put your "test.war" file into the <tomcat
home>/webapps directory and delete the test directory. If you restart tomcat the
war file will be unpacked.
Matt Goss

surinder singh wrote:

> As the the documentation says (.war ) in the webapps should be extracted and
> installed by tomcat during startup, but here I am not getting them as so.
>
> what to do to make them working?

example.war, test.war etc file are not extracted

Posted by surinder singh <su...@bflsoftware.com>.
As the the documentation says (.war ) in the webapps should be extracted and
installed by tomcat during startup, but here I am not getting them as so.

what to do to make them working?




Re: similar Problems with JDBC : connection lost after several ac cess

Posted by Stefan Urban <su...@pevo.de>.
Hi,

I'm really fed up with this problem, but it seems there is no
solution for it.
The Problem is still the same. I have an Applet that is calling a
servlet, which connects to a database. Several time I do it, it all worx
fine. He can find the classes for the JDBC-Driver even my Dataclass
to transport the Results through the Stream. It is working the whole
Day. One day after it also works fine (I DIDN'T get an error like
"Can't load JDBC Driver" or something similar.) Everything is working,
BUT I get an empty ResultSet. When I'm restart Tomcat or even build
the servlet new it all works fine again. I even close all Statements after
using them. Who can help me on this Problem ?

Thanx.

-Stefan

----- Original Message -----
From: Kitching Simon <Si...@orange.ch>
To: <to...@jakarta.apache.org>
Sent: Wednesday, August 30, 2000 5:49 PM
Subject: RE: similar Problems with JDBC : connection lost after several ac
cess


> We had a similar problem.
>
> When you have finished with a PreparedStatement instance,
> call its "close" method. This method does eventually get called
> when the object gets garbage-collected, but that is usually too late.
>
> This might solve it.....
>
> > -----Original Message-----
> > From: Victor Chinnappan [SMTP:cvdoss@yahoo.com]
> > Sent: Wednesday, August 30, 2000 5:36 PM
> > To: tomcat-user@jakarta.apache.org
> > Subject: RE: similar Problems with JDBC : connection lost after
> > several ac cess
> >
> > We used to have this in one of our earlie projects
> > (Something similar...). The code was not releasing the
> > opened connections and there is a limit on the number
> > of Database connections that can be served by an
> > RDBMS. We were using Personal ORCALE Lite and it had a
> > limit of 11 connections. So as soon as we used up the
> > 11 connections it would complain "Too many files open"
> > or something similar.... If we shutdown the system
> > (which automatically frees all resources, Thank GOD)
> > then it would work fine. I would suggest that you take
> > one more look at the connection pool protocol that you
> > might be following and make sure you release the
> > aquired connections at the appropriate times or have a
> > worker that would monitor STALE connections. Initially
> > when using the DBConnectionBroker, i had missed a
> > couple of freeConnection() calls and it showed up in
> > the log files.... Thanks to DBConnectionBroker.
> >
> > HTH,
> > VC
> > --- David Cao <dc...@e-travel.com> wrote:
> > > Thanks, but i am using my own connection pool, and
> > > the connection lost after
> > > around 8 access to the database, the error message
> > > say can't find suitable
> > > drive, after restart, it works find, after several
> > > access, it happen again.
> > >
> > > Does some body have any idea about this?
> > >
> > > david
> > >
> > >
> > > -----Original Message-----
> > > From: Morahg, Yoav [mailto:ymorahg@gist.com]
> > > Sent: Wednesday, August 30, 2000 10:11 AM
> > > To: 'tomcat-user@jakarta.apache.org'
> > > Subject: RE: similar Problems with JDBC : connection
> > > lost after several
> > > ac cess
> > >
> > >
> > > Just a thought... is your DBConnectionBroker set up
> > > to use autocommit or do
> > > you need to commit changes manually. If the second
> > > is the case, you might
> > > not see a new record in the database unless you
> > > committed it when you
> > > created it.
> > >
> > > -Y
> > >
> > > ---------------------------
> > > Yoav Morahg
> > > Software Engineer
> > > Gist Communications
> > > (212) 965-1999 xt 122
> > > ymorahg@gist.com
> > >
> > >
> > > -----Original Message-----
> > > From: Victor Chinnappan [mailto:cvdoss@yahoo.com]
> > > Sent: Wednesday, August 30, 2000 9:36 AM
> > > To: tomcat-user@jakarta.apache.org
> > > Subject: Re: similar Problems with JDBC : connection
> > > lost after several
> > > access
> > >
> > >
> > > Hi,
> > > I came across a dbconnectionbroker class that does
> > > the
> > > connection pooling et al. this is available at
> > > www.javaexchange.com and is free. I also read that
> > > there is one at Apache, which is called turbine.
> > > Turbine is actually an assorted collection of App
> > > Server utilities. I have been using
> > > DBConnectionBroker. Most others say it is really
> > > good,
> > > albeit i have a strange problem for now. But, again
> > > i
> > > am trying to trace it to my code.
> > >
> > > The problem i am facing is that of not being able to
> > > find a record that was just then created in a table.
> > > When a user logs into our system, a sessionID is
> > > created and further communication from the client
> > > should be based on this session id. So when i try to
> > > validate the session id just then created, it
> > > returns
> > > false for simple query. Not sure why....
> > > anyway, a lot of others are using this without any
> > > problems... so should be fine...
> > >
> > > Cheers!!!!
> > > Victor.C
> > >
> > > --- David Cao <dc...@e-travel.com> wrote:
> > > > Hi Stefan,
> > > >
> > > > I have a very similar problem, I wrote my own
> > > > connection pool, after several
> > > > success access to the database, the connection
> > > lost
> > > > ! the error message
> > > > says, con't find suitable driver. and once I
> > > restart
> > > > the tomcat, it work
> > > > fine !
> > > >
> > > > I am thinking it's a bug on my code, but now I am
> > > > thinking is this a seting
> > > > problem in tomact or JDBC? I will looking at this
> > > > problem soon, pls keep let
> > > > me know if you got any progress, I will also let
> > > you
> > > > know if i got further
> > > > information.
> > > >
> > > > Thanks.
> > > > david
> > > >
> > > > -----Original Message-----
> > > > From: Stefan Urban [mailto:surban@pevo.de]
> > > > Sent: Tuesday, August 29, 2000 6:14 AM
> > > > To: tomcat-user@jakarta.apache.org
> > > > Subject: Problems with JDBC
> > > >
> > > >
> > > > Hi,
> > > >
> > > > I wrote a Servlet, which connects to a
> > > > MySQL-Database. When I'm starting
> > > > Tomcat
> > > > it all works fine. But several Time later, the
> > > > Servlet can't established the
> > > > Database-
> > > > connection again. I set the Classpath right,
> > > because
> > > > when I'm stopping
> > > > Tomcat, he shows me the rigth Classpath. When I'm
> > > > starting Tomcat again, it
> > > > all works fine again!!
> > > >
> > > > Why the hell it does not work several time later?
> > > > Where should I set the
> > > > Classpath?
> > > >
> > > > Thanx.
> > > >
> > > > -Stefan
> > > >
> > >
> > >
> > > __________________________________________________
> > > Do You Yahoo!?
> > > Yahoo! Mail - Free email you can access from
> > > anywhere!
> > > http://mail.yahoo.com/
> >
> >
> > __________________________________________________
> > Do You Yahoo!?
> > Yahoo! Mail - Free email you can access from anywhere!
> > http://mail.yahoo.com/