You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by CutKiller <rj...@gmail.com> on 2009/03/23 12:48:18 UTC

Tomcat and Database Problem

Hi all I have this scenario: 

|Tomcat| -> |Firewall| -> |Database| 

Sometimes the connection to the database is lost. The cause of this fact
maybe lives in the Firewall. But, the major problem, resides in Tomcat. He
doesn't recognize the connection break. What can i do, for Tomcat knows when
the connections break? 

Best Regards, 
Rodrigo
-- 
View this message in context: http://www.nabble.com/Tomcat-and-Database-Problem-tp22658620p22658620.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Tomcat and Database Problem

Posted by rodrigoferreira <rj...@gmail.com>.
David,

Oracle have a view named v$sqlarea that contains all SQL Queries, and in my
case "Select * from dual" appears :( So validationQuery is sending this
query.


Christopher,

I don't expect many long-time queries... So what's your opinion? 


Tnks all!






Christopher Schultz-2 wrote:
> 
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> CC,
> 
> On 3/23/2009 11:24 AM, CutKiller wrote:
>> But the validationQuery was set at the Resources Tags.
>> 
>> <Context path="/testAdmin" docBase="testAdmin"
>> 	debug="0" reloadable="true" crossContext="true">
> 
> What version of TC are you running? You shouldn't be setting the path
> attribute, though this is unlikely to be causing your problem.
> 
> Is there a testAdmin.xml file hiding somewhere under
> $CATALINA_HOME/conf/[enginename]/[hostname]/ that could be overriding
> your configuration?
> 
>> removeAbandoned="true" removeAbandonedTimeout="1800"
> 
> Do you expect many long-running queries? This configuration will only
> purge abandoned connections after they've been out of the pool for 30
> /minutes/. That's a long time to wait before your connections recover.
> 
> - -chris
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.9 (MingW32)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
> 
> iEYEARECAAYFAknKI2cACgkQ9CaO5/Lv0PD2XgCgoOiqvDyfelUoL+zUQuBXhm0X
> HbcAn2KPdmbsjMcoEsIbVJgiqqSnZFdH
> =qsgv
> -----END PGP SIGNATURE-----
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Tomcat-and-Database-Problem-tp22658620p22703934.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Tomcat and Database Problem

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

CC,

On 3/23/2009 11:24 AM, CutKiller wrote:
> But the validationQuery was set at the Resources Tags.
> 
> <Context path="/testAdmin" docBase="testAdmin"
> 	debug="0" reloadable="true" crossContext="true">

What version of TC are you running? You shouldn't be setting the path
attribute, though this is unlikely to be causing your problem.

Is there a testAdmin.xml file hiding somewhere under
$CATALINA_HOME/conf/[enginename]/[hostname]/ that could be overriding
your configuration?

> removeAbandoned="true" removeAbandonedTimeout="1800"

Do you expect many long-running queries? This configuration will only
purge abandoned connections after they've been out of the pool for 30
/minutes/. That's a long time to wait before your connections recover.

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

iEYEARECAAYFAknKI2cACgkQ9CaO5/Lv0PD2XgCgoOiqvDyfelUoL+zUQuBXhm0X
HbcAn2KPdmbsjMcoEsIbVJgiqqSnZFdH
=qsgv
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: Tomcat and Database Problem

Posted by CutKiller <rj...@gmail.com>.

Development and Deployment is not a problem. The problem occurs just is
production environment.



mgainty wrote:
> 
> 
> develop and deploy on your own machine to control environmental issues
> such as 403
> 
> Viel Gluck!
> Martin 
> ______________________________________________ 
> Verzicht und Vertraulichkeitanmerkung / Disclaimer and confidentiality
> note 
> Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene
> Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte
> Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht
> dient lediglich dem Austausch von Informationen und entfaltet keine
> rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von
> E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
> This message is confidential and may be privileged. If you are not the
> intended recipient, we kindly ask you to  please inform the sender. Any
> unauthorised dissemination or copying hereof is prohibited. This message
> serves for information purposes only and shall not have any legally
> binding effect. Given that e-mails can easily be subject to manipulation,
> we can not accept any liability for the content provided.
> 
> 
> 
> 
> 
> 
>> Date: Tue, 24 Mar 2009 07:03:57 -0700
>> From: rjrferreira@gmail.com
>> To: users@tomcat.apache.org
>> Subject: Re: Tomcat and Database Problem
>> 
>> 
>> Hi David,
>> 
>> 
>> Yes I know that a 403 doesn't seem to have anything with this situation,
>> but
>> it's the only error :)
>> 
>> Strange...Strange... I don't know what to do...
>> 
>> 
>> If I raise de connection timeout in the firewall I solve the problem. The
>> problem here, is that i don't have permissions to do anything in others
>> firewalls (like in a production scenario)
>> 
>> 
>> One workaround for this, is stimulate the application/databases
>> connections
>> and prevent this kind of problems! I don't know if this is a good
>> approach
>> but I don't remember nothing else...
>> 
>> Solution... keep trying...
>> 
>> tnks for all! 
>> 
>> 
>> 
>> 
>> David Smith-2 wrote:
>> > 
>> > Are you sure the validation query is active in the connection pool? 
>> > There aren't any other <Context ... /> elements in other xml fragments
>> > superseding the one below?  Seems a litle strange that your firewall
>> > would should down a connection in the tiny (microseconds) sliver of
>> time
>> > between the validation query and using the connection.
>> > 
>> > Oh, and a 403 error in http land if that's what you are referring to is
>> > "Forbidden" .. the client doesn't have permission to view the requested
>> > resource.  Your browser provided credentials and they are validated,
>> but
>> > those credentials are not authorized to view the resource.  This
>> doesn't
>> > seem to have anything to do with the database problem.
>> > 
>> > --David
>> > 
>> > 
>> > CutKiller wrote:
>> >> If helps, the connection state is "connection reset"
>> >>
>> >>
>> >>
>> >> CutKiller wrote:
>> >>   
>> >>> No errors... :(
>> >>>
>> >>> For example when i sign in on the App, appears one error on tomcat
>> >>> log...
>> >>> A 403 something...
>> >>>
>> >>>
>> >>>
>> >>>
>> >>> David Smith-2 wrote:
>> >>>     
>> >>>> Any indication in the logs of what's happening around the time you
>> get
>> >>>> a
>> >>>> bad connection?  Seems weird to me that the validation query isn't
>> >>>> working.
>> >>>>
>> >>>> --David
>> >>>>
>> >>>> CutKiller wrote:
>> >>>>       
>> >>>>> Tnks David.
>> >>>>>
>> >>>>>
>> >>>>> But the validationQuery was set at the Resources Tags.
>> >>>>>
>> >>>>> <Context path="/testAdmin" docBase="testAdmin"
>> >>>>> 	debug="0" reloadable="true" crossContext="true">
>> >>>>> 	<Resource name="jdbc/sp360_main_v2" auth="Container"
>> >>>>> 		type="javax.sql.DataSource" maxActive="100" maxIdle="30"
>> >>>>> 		maxWait="10000" removeAbandoned="true"
>> removeAbandonedTimeout="1800"
>> >>>>> 		logAbandoned="true" username="mqa" password="1nspector"
>> >>>>> 		driverClassName="oracle.jdbc.OracleDriver"
>> >>>>> 		url="jdbc:oracle:thin:xxx/xxxxx@//00.00.00.00:1521/orcl"
>> >>>>> 		validationQuery="select 1 from dual" 
>> >>>>> 		testWhileIdle="true"
>> >>>>>         timeBetweenEvictionRunsMillis="60000"/>
>> >>>>> </Context>
>> >>>>>
>> >>>>>
>> >>>>>
>> >>>>>
>> >>>>>
>> >>>>> David Smith-2 wrote:
>> >>>>>   
>> >>>>>         
>> >>>>>> CutKiller wrote:
>> >>>>>>     
>> >>>>>>           
>> >>>>>>> If I raise the timeout value in the firewall parameters the
>> >>>>>>> connection
>> >>>>>>> problem was solved.... but i don't have permissions to do that in
>> >>>>>>> real
>> >>>>>>> environment.
>> >>>>>>>
>> >>>>>>> The connections are dead, but this connections stays in tomcat
>> pool
>> >>>>>>> with
>> >>>>>>> no
>> >>>>>>> problems. Tomcat, in a perfect scenario, should recognize the
>> loss
>> >>>>>>> of
>> >>>>>>> connection, and create a new one.
>> >>>>>>>
>> >>>>>>> I need this connections anytime.
>> >>>>>>>
>> >>>>>>>
>> >>>>>>>   
>> >>>>>>>       
>> >>>>>>>             
>> >>>>>> Right and it would recognize dead connections if validationQuery
>> is
>> >>>>>> provided on the connection pool.  The pool will execute the
>> >>>>>> validation
>> >>>>>> query before handing your webapp the connection, dropping and
>> >>>>>> creating
>> >>>>>> a
>> >>>>>> new connection as necessary.   Your problem smells like you are
>> >>>>>> getting
>> >>>>>> a connection from the pool and keeping around a long time without
>> >>>>>> returning it to the pool.  Doing that effectively circumvents the
>> >>>>>> pool's
>> >>>>>> ability to validate connections.
>> >>>>>>
>> >>>>>> Posting details of your setup would be helpful including the
>> >>>>>> <Resource
>> >>>>>> ... /> tag that configures your pool and relevant code where
>> things
>> >>>>>> are
>> >>>>>> breaking.
>> >>>>>>
>> >>>>>> --David
>> >>>>>>
>> >>>>>>     
>> >>>>>>           
>> >>>>>>> David Smith-2 wrote:
>> >>>>>>>   
>> >>>>>>>       
>> >>>>>>>             
>> >>>>>>>> CutKiller wrote:
>> >>>>>>>>     
>> >>>>>>>>         
>> >>>>>>>>               
>> >>>>>>>>> Hi all I have this scenario: 
>> >>>>>>>>>
>> >>>>>>>>> |Tomcat| -> |Firewall| -> |Database| 
>> >>>>>>>>>
>> >>>>>>>>> Sometimes the connection to the database is lost. The cause of
>> >>>>>>>>> this
>> >>>>>>>>> fact
>> >>>>>>>>> maybe lives in the Firewall. But, the major problem, resides in
>> >>>>>>>>> Tomcat.
>> >>>>>>>>> He
>> >>>>>>>>> doesn't recognize the connection break. What can i do, for
>> Tomcat
>> >>>>>>>>> knows
>> >>>>>>>>> when
>> >>>>>>>>> the connections break? 
>> >>>>>>>>>
>> >>>>>>>>> Best Regards, 
>> >>>>>>>>> Rodrigo
>> >>>>>>>>>   
>> >>>>>>>>>       
>> >>>>>>>>>           
>> >>>>>>>>>                 
>> >>>>>>>> Can you provide a bit more context for when/how you use
>> connections
>> >>>>>>>> and
>> >>>>>>>> how you expect tomcat to recognize when connections break?  In
>> >>>>>>>> general
>> >>>>>>>> webapp code retrieves a connection, does it's business and then
>> >>>>>>>> closes
>> >>>>>>>> the connection to return it to the pool in the smallest
>> reasonable
>> >>>>>>>> space
>> >>>>>>>> .. the whole cycle done and over with by the time your webapp is
>> >>>>>>>> finished with the current request if not sooner.
>> >>>>>>>>
>> >>>>>>>> --David
>> >>>>>>>>
>> >>>>>>>>
>> >>>>>>>>               
>> > 
>> > 
>> > ---------------------------------------------------------------------
>> > To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> > For additional commands, e-mail: users-help@tomcat.apache.org
>> > 
>> > 
>> > 
>> 
>> -- 
>> View this message in context:
>> http://www.nabble.com/Tomcat-and-Database-Problem-tp22658620p22681114.html
>> Sent from the Tomcat - User mailing list archive at Nabble.com.
>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: users-help@tomcat.apache.org
>> 
> 
> _________________________________________________________________
> Internet Explorer 8 – Now Available. Faster, safer, easier.
> http://clk.atdmt.com/MRT/go/141323790/direct/01/
> 

-- 
View this message in context: http://www.nabble.com/Tomcat-and-Database-Problem-tp22658620p22684901.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: Tomcat and Database Problem

Posted by Martin Gainty <mg...@hotmail.com>.
develop and deploy on your own machine to control environmental issues such as 403

Viel Gluck!
Martin 
______________________________________________ 
Verzicht und Vertraulichkeitanmerkung / Disclaimer and confidentiality note 
Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
This message is confidential and may be privileged. If you are not the intended recipient, we kindly ask you to  please inform the sender. Any unauthorised dissemination or copying hereof is prohibited. This message serves for information purposes only and shall not have any legally binding effect. Given that e-mails can easily be subject to manipulation, we can not accept any liability for the content provided.






> Date: Tue, 24 Mar 2009 07:03:57 -0700
> From: rjrferreira@gmail.com
> To: users@tomcat.apache.org
> Subject: Re: Tomcat and Database Problem
> 
> 
> Hi David,
> 
> 
> Yes I know that a 403 doesn't seem to have anything with this situation, but
> it's the only error :)
> 
> Strange...Strange... I don't know what to do...
> 
> 
> If I raise de connection timeout in the firewall I solve the problem. The
> problem here, is that i don't have permissions to do anything in others
> firewalls (like in a production scenario)
> 
> 
> One workaround for this, is stimulate the application/databases connections
> and prevent this kind of problems! I don't know if this is a good approach
> but I don't remember nothing else...
> 
> Solution... keep trying...
> 
> tnks for all! 
> 
> 
> 
> 
> David Smith-2 wrote:
> > 
> > Are you sure the validation query is active in the connection pool? 
> > There aren't any other <Context ... /> elements in other xml fragments
> > superseding the one below?  Seems a litle strange that your firewall
> > would should down a connection in the tiny (microseconds) sliver of time
> > between the validation query and using the connection.
> > 
> > Oh, and a 403 error in http land if that's what you are referring to is
> > "Forbidden" .. the client doesn't have permission to view the requested
> > resource.  Your browser provided credentials and they are validated, but
> > those credentials are not authorized to view the resource.  This doesn't
> > seem to have anything to do with the database problem.
> > 
> > --David
> > 
> > 
> > CutKiller wrote:
> >> If helps, the connection state is "connection reset"
> >>
> >>
> >>
> >> CutKiller wrote:
> >>   
> >>> No errors... :(
> >>>
> >>> For example when i sign in on the App, appears one error on tomcat
> >>> log...
> >>> A 403 something...
> >>>
> >>>
> >>>
> >>>
> >>> David Smith-2 wrote:
> >>>     
> >>>> Any indication in the logs of what's happening around the time you get
> >>>> a
> >>>> bad connection?  Seems weird to me that the validation query isn't
> >>>> working.
> >>>>
> >>>> --David
> >>>>
> >>>> CutKiller wrote:
> >>>>       
> >>>>> Tnks David.
> >>>>>
> >>>>>
> >>>>> But the validationQuery was set at the Resources Tags.
> >>>>>
> >>>>> <Context path="/testAdmin" docBase="testAdmin"
> >>>>> 	debug="0" reloadable="true" crossContext="true">
> >>>>> 	<Resource name="jdbc/sp360_main_v2" auth="Container"
> >>>>> 		type="javax.sql.DataSource" maxActive="100" maxIdle="30"
> >>>>> 		maxWait="10000" removeAbandoned="true" removeAbandonedTimeout="1800"
> >>>>> 		logAbandoned="true" username="mqa" password="1nspector"
> >>>>> 		driverClassName="oracle.jdbc.OracleDriver"
> >>>>> 		url="jdbc:oracle:thin:xxx/xxxxx@//00.00.00.00:1521/orcl"
> >>>>> 		validationQuery="select 1 from dual" 
> >>>>> 		testWhileIdle="true"
> >>>>>         timeBetweenEvictionRunsMillis="60000"/>
> >>>>> </Context>
> >>>>>
> >>>>>
> >>>>>
> >>>>>
> >>>>>
> >>>>> David Smith-2 wrote:
> >>>>>   
> >>>>>         
> >>>>>> CutKiller wrote:
> >>>>>>     
> >>>>>>           
> >>>>>>> If I raise the timeout value in the firewall parameters the
> >>>>>>> connection
> >>>>>>> problem was solved.... but i don't have permissions to do that in
> >>>>>>> real
> >>>>>>> environment.
> >>>>>>>
> >>>>>>> The connections are dead, but this connections stays in tomcat pool
> >>>>>>> with
> >>>>>>> no
> >>>>>>> problems. Tomcat, in a perfect scenario, should recognize the loss
> >>>>>>> of
> >>>>>>> connection, and create a new one.
> >>>>>>>
> >>>>>>> I need this connections anytime.
> >>>>>>>
> >>>>>>>
> >>>>>>>   
> >>>>>>>       
> >>>>>>>             
> >>>>>> Right and it would recognize dead connections if validationQuery is
> >>>>>> provided on the connection pool.  The pool will execute the
> >>>>>> validation
> >>>>>> query before handing your webapp the connection, dropping and
> >>>>>> creating
> >>>>>> a
> >>>>>> new connection as necessary.   Your problem smells like you are
> >>>>>> getting
> >>>>>> a connection from the pool and keeping around a long time without
> >>>>>> returning it to the pool.  Doing that effectively circumvents the
> >>>>>> pool's
> >>>>>> ability to validate connections.
> >>>>>>
> >>>>>> Posting details of your setup would be helpful including the
> >>>>>> <Resource
> >>>>>> ... /> tag that configures your pool and relevant code where things
> >>>>>> are
> >>>>>> breaking.
> >>>>>>
> >>>>>> --David
> >>>>>>
> >>>>>>     
> >>>>>>           
> >>>>>>> David Smith-2 wrote:
> >>>>>>>   
> >>>>>>>       
> >>>>>>>             
> >>>>>>>> CutKiller wrote:
> >>>>>>>>     
> >>>>>>>>         
> >>>>>>>>               
> >>>>>>>>> Hi all I have this scenario: 
> >>>>>>>>>
> >>>>>>>>> |Tomcat| -> |Firewall| -> |Database| 
> >>>>>>>>>
> >>>>>>>>> Sometimes the connection to the database is lost. The cause of
> >>>>>>>>> this
> >>>>>>>>> fact
> >>>>>>>>> maybe lives in the Firewall. But, the major problem, resides in
> >>>>>>>>> Tomcat.
> >>>>>>>>> He
> >>>>>>>>> doesn't recognize the connection break. What can i do, for Tomcat
> >>>>>>>>> knows
> >>>>>>>>> when
> >>>>>>>>> the connections break? 
> >>>>>>>>>
> >>>>>>>>> Best Regards, 
> >>>>>>>>> Rodrigo
> >>>>>>>>>   
> >>>>>>>>>       
> >>>>>>>>>           
> >>>>>>>>>                 
> >>>>>>>> Can you provide a bit more context for when/how you use connections
> >>>>>>>> and
> >>>>>>>> how you expect tomcat to recognize when connections break?  In
> >>>>>>>> general
> >>>>>>>> webapp code retrieves a connection, does it's business and then
> >>>>>>>> closes
> >>>>>>>> the connection to return it to the pool in the smallest reasonable
> >>>>>>>> space
> >>>>>>>> .. the whole cycle done and over with by the time your webapp is
> >>>>>>>> finished with the current request if not sooner.
> >>>>>>>>
> >>>>>>>> --David
> >>>>>>>>
> >>>>>>>>
> >>>>>>>>               
> > 
> > 
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> > For additional commands, e-mail: users-help@tomcat.apache.org
> > 
> > 
> > 
> 
> -- 
> View this message in context: http://www.nabble.com/Tomcat-and-Database-Problem-tp22658620p22681114.html
> Sent from the Tomcat - User mailing list archive at Nabble.com.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 

_________________________________________________________________
Internet Explorer 8 – Now Available. Faster, safer, easier.
http://clk.atdmt.com/MRT/go/141323790/direct/01/

Re: Tomcat and Database Problem

Posted by David Smith <dn...@cornell.edu>.
I couldn't tell you as I don't run an Oracle instance.  Talk with your
DBA regarding what kind of logging data might be available.   In
particular you are asking for logs showing the sql commands coming from
your webapp and the date/time they were executed.

--David

CutKiller wrote:
> David,
>
> Please what's the name of the logs that you mentioned? My DB is Oracle.
>
> Tnks
>
>
>
>
> David Smith-2 wrote:
>   
>> Changing the timeout in the firewall is exactly what makes me think one
>> of three things are going on:
>>
>> 1. The validation query isn't active in your environment.  Maybe you
>> didn't restart your webapp and/or tomcat after adding it or another
>> <Resource .../> element is superseding it.
>>
>> 2. Your code is holding on to connections and not returning/closing them
>> at the end of each request.  In that case the pool will never be able to
>> perform the validation query as it only occurs just before borrowing a
>> connection from the pool.
>>
>> 3. The firewall connection timeout is configured unreasonably short (in
>> the microseconds range as opposed to seconds or even minutes)
>>
>> At any rate, the only way I can see changing the firewall timeout fixing
>> the problem is in case 3.  For the other two cases, changing the
>> firewall timeout should simply delay the error to the new timeout
>> value.  It might be worthwhile to take a look at the database logs to
>> see if the validation queries are actually being sent.
>>
>> --David
>>
>> CutKiller wrote:
>>     
>>> Hi David,
>>>
>>>
>>> Yes I know that a 403 doesn't seem to have anything with this situation,
>>> but
>>> it's the only error :)
>>>
>>> Strange...Strange... I don't know what to do...
>>>
>>>
>>> If I raise de connection timeout in the firewall I solve the problem. The
>>> problem here, is that i don't have permissions to do anything in others
>>> firewalls (like in a production scenario)
>>>
>>>
>>> One workaround for this, is stimulate the application/databases
>>> connections
>>> and prevent this kind of problems! I don't know if this is a good
>>> approach
>>> but I don't remember nothing else...
>>>
>>> Solution... keep trying...
>>>
>>> tnks for all! 
>>>
>>>
>>>
>>>
>>> David Smith-2 wrote:
>>>   
>>>       
>>>> Are you sure the validation query is active in the connection pool? 
>>>> There aren't any other <Context ... /> elements in other xml fragments
>>>> superseding the one below?  Seems a litle strange that your firewall
>>>> would should down a connection in the tiny (microseconds) sliver of time
>>>> between the validation query and using the connection.
>>>>
>>>> Oh, and a 403 error in http land if that's what you are referring to is
>>>> "Forbidden" .. the client doesn't have permission to view the requested
>>>> resource.  Your browser provided credentials and they are validated, but
>>>> those credentials are not authorized to view the resource.  This doesn't
>>>> seem to have anything to do with the database problem.
>>>>
>>>> --David
>>>>
>>>>
>>>> CutKiller wrote:
>>>>     
>>>>         
>>>>> If helps, the connection state is "connection reset"
>>>>>
>>>>>
>>>>>
>>>>> CutKiller wrote:
>>>>>   
>>>>>       
>>>>>           
>>>>>> No errors... :(
>>>>>>
>>>>>> For example when i sign in on the App, appears one error on tomcat
>>>>>> log...
>>>>>> A 403 something...
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> David Smith-2 wrote:
>>>>>>     
>>>>>>         
>>>>>>             
>>>>>>> Any indication in the logs of what's happening around the time you
>>>>>>> get
>>>>>>> a
>>>>>>> bad connection?  Seems weird to me that the validation query isn't
>>>>>>> working.
>>>>>>>
>>>>>>> --David
>>>>>>>
>>>>>>> CutKiller wrote:
>>>>>>>       
>>>>>>>           
>>>>>>>               
>>>>>>>> Tnks David.
>>>>>>>>
>>>>>>>>
>>>>>>>> But the validationQuery was set at the Resources Tags.
>>>>>>>>
>>>>>>>> <Context path="/testAdmin" docBase="testAdmin"
>>>>>>>> 	debug="0" reloadable="true" crossContext="true">
>>>>>>>> 	<Resource name="jdbc/sp360_main_v2" auth="Container"
>>>>>>>> 		type="javax.sql.DataSource" maxActive="100" maxIdle="30"
>>>>>>>> 		maxWait="10000" removeAbandoned="true"
>>>>>>>> removeAbandonedTimeout="1800"
>>>>>>>> 		logAbandoned="true" username="mqa" password="1nspector"
>>>>>>>> 		driverClassName="oracle.jdbc.OracleDriver"
>>>>>>>> 		url="jdbc:oracle:thin:xxx/xxxxx@//00.00.00.00:1521/orcl"
>>>>>>>> 		validationQuery="select 1 from dual" 
>>>>>>>> 		testWhileIdle="true"
>>>>>>>>         timeBetweenEvictionRunsMillis="60000"/>
>>>>>>>> </Context>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> David Smith-2 wrote:
>>>>>>>>   
>>>>>>>>         
>>>>>>>>             
>>>>>>>>                 
>>>>>>>>> CutKiller wrote:
>>>>>>>>>     
>>>>>>>>>           
>>>>>>>>>               
>>>>>>>>>                   
>>>>>>>>>> If I raise the timeout value in the firewall parameters the
>>>>>>>>>> connection
>>>>>>>>>> problem was solved.... but i don't have permissions to do that in
>>>>>>>>>> real
>>>>>>>>>> environment.
>>>>>>>>>>
>>>>>>>>>> The connections are dead, but this connections stays in tomcat
>>>>>>>>>> pool
>>>>>>>>>> with
>>>>>>>>>> no
>>>>>>>>>> problems. Tomcat, in a perfect scenario, should recognize the loss
>>>>>>>>>> of
>>>>>>>>>> connection, and create a new one.
>>>>>>>>>>
>>>>>>>>>> I need this connections anytime.
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>   
>>>>>>>>>>       
>>>>>>>>>>             
>>>>>>>>>>                 
>>>>>>>>>>                     
>>>>>>>>> Right and it would recognize dead connections if validationQuery is
>>>>>>>>> provided on the connection pool.  The pool will execute the
>>>>>>>>> validation
>>>>>>>>> query before handing your webapp the connection, dropping and
>>>>>>>>> creating
>>>>>>>>> a
>>>>>>>>> new connection as necessary.   Your problem smells like you are
>>>>>>>>> getting
>>>>>>>>> a connection from the pool and keeping around a long time without
>>>>>>>>> returning it to the pool.  Doing that effectively circumvents the
>>>>>>>>> pool's
>>>>>>>>> ability to validate connections.
>>>>>>>>>
>>>>>>>>> Posting details of your setup would be helpful including the
>>>>>>>>> <Resource
>>>>>>>>> ... /> tag that configures your pool and relevant code where things
>>>>>>>>> are
>>>>>>>>> breaking.
>>>>>>>>>
>>>>>>>>> --David
>>>>>>>>>
>>>>>>>>>     
>>>>>>>>>           
>>>>>>>>>               
>>>>>>>>>                   
>>>>>>>>>> David Smith-2 wrote:
>>>>>>>>>>   
>>>>>>>>>>       
>>>>>>>>>>             
>>>>>>>>>>                 
>>>>>>>>>>                     
>>>>>>>>>>> CutKiller wrote:
>>>>>>>>>>>     
>>>>>>>>>>>         
>>>>>>>>>>>               
>>>>>>>>>>>                   
>>>>>>>>>>>                       
>>>>>>>>>>>> Hi all I have this scenario: 
>>>>>>>>>>>>
>>>>>>>>>>>> |Tomcat| -> |Firewall| -> |Database| 
>>>>>>>>>>>>
>>>>>>>>>>>> Sometimes the connection to the database is lost. The cause of
>>>>>>>>>>>> this
>>>>>>>>>>>> fact
>>>>>>>>>>>> maybe lives in the Firewall. But, the major problem, resides in
>>>>>>>>>>>> Tomcat.
>>>>>>>>>>>> He
>>>>>>>>>>>> doesn't recognize the connection break. What can i do, for
>>>>>>>>>>>> Tomcat
>>>>>>>>>>>> knows
>>>>>>>>>>>> when
>>>>>>>>>>>> the connections break? 
>>>>>>>>>>>>
>>>>>>>>>>>> Best Regards, 
>>>>>>>>>>>> Rodrigo
>>>>>>>>>>>>   
>>>>>>>>>>>>       
>>>>>>>>>>>>           
>>>>>>>>>>>>                 
>>>>>>>>>>>>                     
>>>>>>>>>>>>                         
>>>>>>>>>>> Can you provide a bit more context for when/how you use
>>>>>>>>>>> connections
>>>>>>>>>>> and
>>>>>>>>>>> how you expect tomcat to recognize when connections break?  In
>>>>>>>>>>> general
>>>>>>>>>>> webapp code retrieves a connection, does it's business and then
>>>>>>>>>>> closes
>>>>>>>>>>> the connection to return it to the pool in the smallest
>>>>>>>>>>> reasonable
>>>>>>>>>>> space
>>>>>>>>>>> .. the whole cycle done and over with by the time your webapp is
>>>>>>>>>>> finished with the current request if not sooner.
>>>>>>>>>>>
>>>>>>>>>>> --David
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>                       


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Tomcat and Database Problem

Posted by CutKiller <rj...@gmail.com>.
David,

Please what's the name of the logs that you mentioned? My DB is Oracle.

Tnks




David Smith-2 wrote:
> 
> Changing the timeout in the firewall is exactly what makes me think one
> of three things are going on:
> 
> 1. The validation query isn't active in your environment.  Maybe you
> didn't restart your webapp and/or tomcat after adding it or another
> <Resource .../> element is superseding it.
> 
> 2. Your code is holding on to connections and not returning/closing them
> at the end of each request.  In that case the pool will never be able to
> perform the validation query as it only occurs just before borrowing a
> connection from the pool.
> 
> 3. The firewall connection timeout is configured unreasonably short (in
> the microseconds range as opposed to seconds or even minutes)
> 
> At any rate, the only way I can see changing the firewall timeout fixing
> the problem is in case 3.  For the other two cases, changing the
> firewall timeout should simply delay the error to the new timeout
> value.  It might be worthwhile to take a look at the database logs to
> see if the validation queries are actually being sent.
> 
> --David
> 
> CutKiller wrote:
>> Hi David,
>>
>>
>> Yes I know that a 403 doesn't seem to have anything with this situation,
>> but
>> it's the only error :)
>>
>> Strange...Strange... I don't know what to do...
>>
>>
>> If I raise de connection timeout in the firewall I solve the problem. The
>> problem here, is that i don't have permissions to do anything in others
>> firewalls (like in a production scenario)
>>
>>
>> One workaround for this, is stimulate the application/databases
>> connections
>> and prevent this kind of problems! I don't know if this is a good
>> approach
>> but I don't remember nothing else...
>>
>> Solution... keep trying...
>>
>> tnks for all! 
>>
>>
>>
>>
>> David Smith-2 wrote:
>>   
>>> Are you sure the validation query is active in the connection pool? 
>>> There aren't any other <Context ... /> elements in other xml fragments
>>> superseding the one below?  Seems a litle strange that your firewall
>>> would should down a connection in the tiny (microseconds) sliver of time
>>> between the validation query and using the connection.
>>>
>>> Oh, and a 403 error in http land if that's what you are referring to is
>>> "Forbidden" .. the client doesn't have permission to view the requested
>>> resource.  Your browser provided credentials and they are validated, but
>>> those credentials are not authorized to view the resource.  This doesn't
>>> seem to have anything to do with the database problem.
>>>
>>> --David
>>>
>>>
>>> CutKiller wrote:
>>>     
>>>> If helps, the connection state is "connection reset"
>>>>
>>>>
>>>>
>>>> CutKiller wrote:
>>>>   
>>>>       
>>>>> No errors... :(
>>>>>
>>>>> For example when i sign in on the App, appears one error on tomcat
>>>>> log...
>>>>> A 403 something...
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> David Smith-2 wrote:
>>>>>     
>>>>>         
>>>>>> Any indication in the logs of what's happening around the time you
>>>>>> get
>>>>>> a
>>>>>> bad connection?  Seems weird to me that the validation query isn't
>>>>>> working.
>>>>>>
>>>>>> --David
>>>>>>
>>>>>> CutKiller wrote:
>>>>>>       
>>>>>>           
>>>>>>> Tnks David.
>>>>>>>
>>>>>>>
>>>>>>> But the validationQuery was set at the Resources Tags.
>>>>>>>
>>>>>>> <Context path="/testAdmin" docBase="testAdmin"
>>>>>>> 	debug="0" reloadable="true" crossContext="true">
>>>>>>> 	<Resource name="jdbc/sp360_main_v2" auth="Container"
>>>>>>> 		type="javax.sql.DataSource" maxActive="100" maxIdle="30"
>>>>>>> 		maxWait="10000" removeAbandoned="true"
>>>>>>> removeAbandonedTimeout="1800"
>>>>>>> 		logAbandoned="true" username="mqa" password="1nspector"
>>>>>>> 		driverClassName="oracle.jdbc.OracleDriver"
>>>>>>> 		url="jdbc:oracle:thin:xxx/xxxxx@//00.00.00.00:1521/orcl"
>>>>>>> 		validationQuery="select 1 from dual" 
>>>>>>> 		testWhileIdle="true"
>>>>>>>         timeBetweenEvictionRunsMillis="60000"/>
>>>>>>> </Context>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> David Smith-2 wrote:
>>>>>>>   
>>>>>>>         
>>>>>>>             
>>>>>>>> CutKiller wrote:
>>>>>>>>     
>>>>>>>>           
>>>>>>>>               
>>>>>>>>> If I raise the timeout value in the firewall parameters the
>>>>>>>>> connection
>>>>>>>>> problem was solved.... but i don't have permissions to do that in
>>>>>>>>> real
>>>>>>>>> environment.
>>>>>>>>>
>>>>>>>>> The connections are dead, but this connections stays in tomcat
>>>>>>>>> pool
>>>>>>>>> with
>>>>>>>>> no
>>>>>>>>> problems. Tomcat, in a perfect scenario, should recognize the loss
>>>>>>>>> of
>>>>>>>>> connection, and create a new one.
>>>>>>>>>
>>>>>>>>> I need this connections anytime.
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>   
>>>>>>>>>       
>>>>>>>>>             
>>>>>>>>>                 
>>>>>>>> Right and it would recognize dead connections if validationQuery is
>>>>>>>> provided on the connection pool.  The pool will execute the
>>>>>>>> validation
>>>>>>>> query before handing your webapp the connection, dropping and
>>>>>>>> creating
>>>>>>>> a
>>>>>>>> new connection as necessary.   Your problem smells like you are
>>>>>>>> getting
>>>>>>>> a connection from the pool and keeping around a long time without
>>>>>>>> returning it to the pool.  Doing that effectively circumvents the
>>>>>>>> pool's
>>>>>>>> ability to validate connections.
>>>>>>>>
>>>>>>>> Posting details of your setup would be helpful including the
>>>>>>>> <Resource
>>>>>>>> ... /> tag that configures your pool and relevant code where things
>>>>>>>> are
>>>>>>>> breaking.
>>>>>>>>
>>>>>>>> --David
>>>>>>>>
>>>>>>>>     
>>>>>>>>           
>>>>>>>>               
>>>>>>>>> David Smith-2 wrote:
>>>>>>>>>   
>>>>>>>>>       
>>>>>>>>>             
>>>>>>>>>                 
>>>>>>>>>> CutKiller wrote:
>>>>>>>>>>     
>>>>>>>>>>         
>>>>>>>>>>               
>>>>>>>>>>                   
>>>>>>>>>>> Hi all I have this scenario: 
>>>>>>>>>>>
>>>>>>>>>>> |Tomcat| -> |Firewall| -> |Database| 
>>>>>>>>>>>
>>>>>>>>>>> Sometimes the connection to the database is lost. The cause of
>>>>>>>>>>> this
>>>>>>>>>>> fact
>>>>>>>>>>> maybe lives in the Firewall. But, the major problem, resides in
>>>>>>>>>>> Tomcat.
>>>>>>>>>>> He
>>>>>>>>>>> doesn't recognize the connection break. What can i do, for
>>>>>>>>>>> Tomcat
>>>>>>>>>>> knows
>>>>>>>>>>> when
>>>>>>>>>>> the connections break? 
>>>>>>>>>>>
>>>>>>>>>>> Best Regards, 
>>>>>>>>>>> Rodrigo
>>>>>>>>>>>   
>>>>>>>>>>>       
>>>>>>>>>>>           
>>>>>>>>>>>                 
>>>>>>>>>>>                     
>>>>>>>>>> Can you provide a bit more context for when/how you use
>>>>>>>>>> connections
>>>>>>>>>> and
>>>>>>>>>> how you expect tomcat to recognize when connections break?  In
>>>>>>>>>> general
>>>>>>>>>> webapp code retrieves a connection, does it's business and then
>>>>>>>>>> closes
>>>>>>>>>> the connection to return it to the pool in the smallest
>>>>>>>>>> reasonable
>>>>>>>>>> space
>>>>>>>>>> .. the whole cycle done and over with by the time your webapp is
>>>>>>>>>> finished with the current request if not sooner.
>>>>>>>>>>
>>>>>>>>>> --David
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>  
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Tomcat-and-Database-Problem-tp22658620p22685292.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Tomcat and Database Problem

Posted by David Smith <dn...@cornell.edu>.
Changing the timeout in the firewall is exactly what makes me think one
of three things are going on:

1. The validation query isn't active in your environment.  Maybe you
didn't restart your webapp and/or tomcat after adding it or another
<Resource .../> element is superseding it.

2. Your code is holding on to connections and not returning/closing them
at the end of each request.  In that case the pool will never be able to
perform the validation query as it only occurs just before borrowing a
connection from the pool.

3. The firewall connection timeout is configured unreasonably short (in
the microseconds range as opposed to seconds or even minutes)

At any rate, the only way I can see changing the firewall timeout fixing
the problem is in case 3.  For the other two cases, changing the
firewall timeout should simply delay the error to the new timeout
value.  It might be worthwhile to take a look at the database logs to
see if the validation queries are actually being sent.

--David

CutKiller wrote:
> Hi David,
>
>
> Yes I know that a 403 doesn't seem to have anything with this situation, but
> it's the only error :)
>
> Strange...Strange... I don't know what to do...
>
>
> If I raise de connection timeout in the firewall I solve the problem. The
> problem here, is that i don't have permissions to do anything in others
> firewalls (like in a production scenario)
>
>
> One workaround for this, is stimulate the application/databases connections
> and prevent this kind of problems! I don't know if this is a good approach
> but I don't remember nothing else...
>
> Solution... keep trying...
>
> tnks for all! 
>
>
>
>
> David Smith-2 wrote:
>   
>> Are you sure the validation query is active in the connection pool? 
>> There aren't any other <Context ... /> elements in other xml fragments
>> superseding the one below?  Seems a litle strange that your firewall
>> would should down a connection in the tiny (microseconds) sliver of time
>> between the validation query and using the connection.
>>
>> Oh, and a 403 error in http land if that's what you are referring to is
>> "Forbidden" .. the client doesn't have permission to view the requested
>> resource.  Your browser provided credentials and they are validated, but
>> those credentials are not authorized to view the resource.  This doesn't
>> seem to have anything to do with the database problem.
>>
>> --David
>>
>>
>> CutKiller wrote:
>>     
>>> If helps, the connection state is "connection reset"
>>>
>>>
>>>
>>> CutKiller wrote:
>>>   
>>>       
>>>> No errors... :(
>>>>
>>>> For example when i sign in on the App, appears one error on tomcat
>>>> log...
>>>> A 403 something...
>>>>
>>>>
>>>>
>>>>
>>>> David Smith-2 wrote:
>>>>     
>>>>         
>>>>> Any indication in the logs of what's happening around the time you get
>>>>> a
>>>>> bad connection?  Seems weird to me that the validation query isn't
>>>>> working.
>>>>>
>>>>> --David
>>>>>
>>>>> CutKiller wrote:
>>>>>       
>>>>>           
>>>>>> Tnks David.
>>>>>>
>>>>>>
>>>>>> But the validationQuery was set at the Resources Tags.
>>>>>>
>>>>>> <Context path="/testAdmin" docBase="testAdmin"
>>>>>> 	debug="0" reloadable="true" crossContext="true">
>>>>>> 	<Resource name="jdbc/sp360_main_v2" auth="Container"
>>>>>> 		type="javax.sql.DataSource" maxActive="100" maxIdle="30"
>>>>>> 		maxWait="10000" removeAbandoned="true" removeAbandonedTimeout="1800"
>>>>>> 		logAbandoned="true" username="mqa" password="1nspector"
>>>>>> 		driverClassName="oracle.jdbc.OracleDriver"
>>>>>> 		url="jdbc:oracle:thin:xxx/xxxxx@//00.00.00.00:1521/orcl"
>>>>>> 		validationQuery="select 1 from dual" 
>>>>>> 		testWhileIdle="true"
>>>>>>         timeBetweenEvictionRunsMillis="60000"/>
>>>>>> </Context>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> David Smith-2 wrote:
>>>>>>   
>>>>>>         
>>>>>>             
>>>>>>> CutKiller wrote:
>>>>>>>     
>>>>>>>           
>>>>>>>               
>>>>>>>> If I raise the timeout value in the firewall parameters the
>>>>>>>> connection
>>>>>>>> problem was solved.... but i don't have permissions to do that in
>>>>>>>> real
>>>>>>>> environment.
>>>>>>>>
>>>>>>>> The connections are dead, but this connections stays in tomcat pool
>>>>>>>> with
>>>>>>>> no
>>>>>>>> problems. Tomcat, in a perfect scenario, should recognize the loss
>>>>>>>> of
>>>>>>>> connection, and create a new one.
>>>>>>>>
>>>>>>>> I need this connections anytime.
>>>>>>>>
>>>>>>>>
>>>>>>>>   
>>>>>>>>       
>>>>>>>>             
>>>>>>>>                 
>>>>>>> Right and it would recognize dead connections if validationQuery is
>>>>>>> provided on the connection pool.  The pool will execute the
>>>>>>> validation
>>>>>>> query before handing your webapp the connection, dropping and
>>>>>>> creating
>>>>>>> a
>>>>>>> new connection as necessary.   Your problem smells like you are
>>>>>>> getting
>>>>>>> a connection from the pool and keeping around a long time without
>>>>>>> returning it to the pool.  Doing that effectively circumvents the
>>>>>>> pool's
>>>>>>> ability to validate connections.
>>>>>>>
>>>>>>> Posting details of your setup would be helpful including the
>>>>>>> <Resource
>>>>>>> ... /> tag that configures your pool and relevant code where things
>>>>>>> are
>>>>>>> breaking.
>>>>>>>
>>>>>>> --David
>>>>>>>
>>>>>>>     
>>>>>>>           
>>>>>>>               
>>>>>>>> David Smith-2 wrote:
>>>>>>>>   
>>>>>>>>       
>>>>>>>>             
>>>>>>>>                 
>>>>>>>>> CutKiller wrote:
>>>>>>>>>     
>>>>>>>>>         
>>>>>>>>>               
>>>>>>>>>                   
>>>>>>>>>> Hi all I have this scenario: 
>>>>>>>>>>
>>>>>>>>>> |Tomcat| -> |Firewall| -> |Database| 
>>>>>>>>>>
>>>>>>>>>> Sometimes the connection to the database is lost. The cause of
>>>>>>>>>> this
>>>>>>>>>> fact
>>>>>>>>>> maybe lives in the Firewall. But, the major problem, resides in
>>>>>>>>>> Tomcat.
>>>>>>>>>> He
>>>>>>>>>> doesn't recognize the connection break. What can i do, for Tomcat
>>>>>>>>>> knows
>>>>>>>>>> when
>>>>>>>>>> the connections break? 
>>>>>>>>>>
>>>>>>>>>> Best Regards, 
>>>>>>>>>> Rodrigo
>>>>>>>>>>   
>>>>>>>>>>       
>>>>>>>>>>           
>>>>>>>>>>                 
>>>>>>>>>>                     
>>>>>>>>> Can you provide a bit more context for when/how you use connections
>>>>>>>>> and
>>>>>>>>> how you expect tomcat to recognize when connections break?  In
>>>>>>>>> general
>>>>>>>>> webapp code retrieves a connection, does it's business and then
>>>>>>>>> closes
>>>>>>>>> the connection to return it to the pool in the smallest reasonable
>>>>>>>>> space
>>>>>>>>> .. the whole cycle done and over with by the time your webapp is
>>>>>>>>> finished with the current request if not sooner.
>>>>>>>>>
>>>>>>>>> --David
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>  


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Tomcat and Database Problem

Posted by CutKiller <rj...@gmail.com>.
Hi David,


Yes I know that a 403 doesn't seem to have anything with this situation, but
it's the only error :)

Strange...Strange... I don't know what to do...


If I raise de connection timeout in the firewall I solve the problem. The
problem here, is that i don't have permissions to do anything in others
firewalls (like in a production scenario)


One workaround for this, is stimulate the application/databases connections
and prevent this kind of problems! I don't know if this is a good approach
but I don't remember nothing else...

Solution... keep trying...

tnks for all! 




David Smith-2 wrote:
> 
> Are you sure the validation query is active in the connection pool? 
> There aren't any other <Context ... /> elements in other xml fragments
> superseding the one below?  Seems a litle strange that your firewall
> would should down a connection in the tiny (microseconds) sliver of time
> between the validation query and using the connection.
> 
> Oh, and a 403 error in http land if that's what you are referring to is
> "Forbidden" .. the client doesn't have permission to view the requested
> resource.  Your browser provided credentials and they are validated, but
> those credentials are not authorized to view the resource.  This doesn't
> seem to have anything to do with the database problem.
> 
> --David
> 
> 
> CutKiller wrote:
>> If helps, the connection state is "connection reset"
>>
>>
>>
>> CutKiller wrote:
>>   
>>> No errors... :(
>>>
>>> For example when i sign in on the App, appears one error on tomcat
>>> log...
>>> A 403 something...
>>>
>>>
>>>
>>>
>>> David Smith-2 wrote:
>>>     
>>>> Any indication in the logs of what's happening around the time you get
>>>> a
>>>> bad connection?  Seems weird to me that the validation query isn't
>>>> working.
>>>>
>>>> --David
>>>>
>>>> CutKiller wrote:
>>>>       
>>>>> Tnks David.
>>>>>
>>>>>
>>>>> But the validationQuery was set at the Resources Tags.
>>>>>
>>>>> <Context path="/testAdmin" docBase="testAdmin"
>>>>> 	debug="0" reloadable="true" crossContext="true">
>>>>> 	<Resource name="jdbc/sp360_main_v2" auth="Container"
>>>>> 		type="javax.sql.DataSource" maxActive="100" maxIdle="30"
>>>>> 		maxWait="10000" removeAbandoned="true" removeAbandonedTimeout="1800"
>>>>> 		logAbandoned="true" username="mqa" password="1nspector"
>>>>> 		driverClassName="oracle.jdbc.OracleDriver"
>>>>> 		url="jdbc:oracle:thin:xxx/xxxxx@//00.00.00.00:1521/orcl"
>>>>> 		validationQuery="select 1 from dual" 
>>>>> 		testWhileIdle="true"
>>>>>         timeBetweenEvictionRunsMillis="60000"/>
>>>>> </Context>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> David Smith-2 wrote:
>>>>>   
>>>>>         
>>>>>> CutKiller wrote:
>>>>>>     
>>>>>>           
>>>>>>> If I raise the timeout value in the firewall parameters the
>>>>>>> connection
>>>>>>> problem was solved.... but i don't have permissions to do that in
>>>>>>> real
>>>>>>> environment.
>>>>>>>
>>>>>>> The connections are dead, but this connections stays in tomcat pool
>>>>>>> with
>>>>>>> no
>>>>>>> problems. Tomcat, in a perfect scenario, should recognize the loss
>>>>>>> of
>>>>>>> connection, and create a new one.
>>>>>>>
>>>>>>> I need this connections anytime.
>>>>>>>
>>>>>>>
>>>>>>>   
>>>>>>>       
>>>>>>>             
>>>>>> Right and it would recognize dead connections if validationQuery is
>>>>>> provided on the connection pool.  The pool will execute the
>>>>>> validation
>>>>>> query before handing your webapp the connection, dropping and
>>>>>> creating
>>>>>> a
>>>>>> new connection as necessary.   Your problem smells like you are
>>>>>> getting
>>>>>> a connection from the pool and keeping around a long time without
>>>>>> returning it to the pool.  Doing that effectively circumvents the
>>>>>> pool's
>>>>>> ability to validate connections.
>>>>>>
>>>>>> Posting details of your setup would be helpful including the
>>>>>> <Resource
>>>>>> ... /> tag that configures your pool and relevant code where things
>>>>>> are
>>>>>> breaking.
>>>>>>
>>>>>> --David
>>>>>>
>>>>>>     
>>>>>>           
>>>>>>> David Smith-2 wrote:
>>>>>>>   
>>>>>>>       
>>>>>>>             
>>>>>>>> CutKiller wrote:
>>>>>>>>     
>>>>>>>>         
>>>>>>>>               
>>>>>>>>> Hi all I have this scenario: 
>>>>>>>>>
>>>>>>>>> |Tomcat| -> |Firewall| -> |Database| 
>>>>>>>>>
>>>>>>>>> Sometimes the connection to the database is lost. The cause of
>>>>>>>>> this
>>>>>>>>> fact
>>>>>>>>> maybe lives in the Firewall. But, the major problem, resides in
>>>>>>>>> Tomcat.
>>>>>>>>> He
>>>>>>>>> doesn't recognize the connection break. What can i do, for Tomcat
>>>>>>>>> knows
>>>>>>>>> when
>>>>>>>>> the connections break? 
>>>>>>>>>
>>>>>>>>> Best Regards, 
>>>>>>>>> Rodrigo
>>>>>>>>>   
>>>>>>>>>       
>>>>>>>>>           
>>>>>>>>>                 
>>>>>>>> Can you provide a bit more context for when/how you use connections
>>>>>>>> and
>>>>>>>> how you expect tomcat to recognize when connections break?  In
>>>>>>>> general
>>>>>>>> webapp code retrieves a connection, does it's business and then
>>>>>>>> closes
>>>>>>>> the connection to return it to the pool in the smallest reasonable
>>>>>>>> space
>>>>>>>> .. the whole cycle done and over with by the time your webapp is
>>>>>>>> finished with the current request if not sooner.
>>>>>>>>
>>>>>>>> --David
>>>>>>>>
>>>>>>>>
>>>>>>>>               
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Tomcat-and-Database-Problem-tp22658620p22681114.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Tomcat and Database Problem

Posted by David Smith <dn...@cornell.edu>.
Are you sure the validation query is active in the connection pool? 
There aren't any other <Context ... /> elements in other xml fragments
superseding the one below?  Seems a litle strange that your firewall
would should down a connection in the tiny (microseconds) sliver of time
between the validation query and using the connection.

Oh, and a 403 error in http land if that's what you are referring to is
"Forbidden" .. the client doesn't have permission to view the requested
resource.  Your browser provided credentials and they are validated, but
those credentials are not authorized to view the resource.  This doesn't
seem to have anything to do with the database problem.

--David


CutKiller wrote:
> If helps, the connection state is "connection reset"
>
>
>
> CutKiller wrote:
>   
>> No errors... :(
>>
>> For example when i sign in on the App, appears one error on tomcat log...
>> A 403 something...
>>
>>
>>
>>
>> David Smith-2 wrote:
>>     
>>> Any indication in the logs of what's happening around the time you get a
>>> bad connection?  Seems weird to me that the validation query isn't
>>> working.
>>>
>>> --David
>>>
>>> CutKiller wrote:
>>>       
>>>> Tnks David.
>>>>
>>>>
>>>> But the validationQuery was set at the Resources Tags.
>>>>
>>>> <Context path="/testAdmin" docBase="testAdmin"
>>>> 	debug="0" reloadable="true" crossContext="true">
>>>> 	<Resource name="jdbc/sp360_main_v2" auth="Container"
>>>> 		type="javax.sql.DataSource" maxActive="100" maxIdle="30"
>>>> 		maxWait="10000" removeAbandoned="true" removeAbandonedTimeout="1800"
>>>> 		logAbandoned="true" username="mqa" password="1nspector"
>>>> 		driverClassName="oracle.jdbc.OracleDriver"
>>>> 		url="jdbc:oracle:thin:xxx/xxxxx@//00.00.00.00:1521/orcl"
>>>> 		validationQuery="select 1 from dual" 
>>>> 		testWhileIdle="true"
>>>>         timeBetweenEvictionRunsMillis="60000"/>
>>>> </Context>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> David Smith-2 wrote:
>>>>   
>>>>         
>>>>> CutKiller wrote:
>>>>>     
>>>>>           
>>>>>> If I raise the timeout value in the firewall parameters the connection
>>>>>> problem was solved.... but i don't have permissions to do that in real
>>>>>> environment.
>>>>>>
>>>>>> The connections are dead, but this connections stays in tomcat pool
>>>>>> with
>>>>>> no
>>>>>> problems. Tomcat, in a perfect scenario, should recognize the loss of
>>>>>> connection, and create a new one.
>>>>>>
>>>>>> I need this connections anytime.
>>>>>>
>>>>>>
>>>>>>   
>>>>>>       
>>>>>>             
>>>>> Right and it would recognize dead connections if validationQuery is
>>>>> provided on the connection pool.  The pool will execute the validation
>>>>> query before handing your webapp the connection, dropping and creating
>>>>> a
>>>>> new connection as necessary.   Your problem smells like you are getting
>>>>> a connection from the pool and keeping around a long time without
>>>>> returning it to the pool.  Doing that effectively circumvents the
>>>>> pool's
>>>>> ability to validate connections.
>>>>>
>>>>> Posting details of your setup would be helpful including the <Resource
>>>>> ... /> tag that configures your pool and relevant code where things are
>>>>> breaking.
>>>>>
>>>>> --David
>>>>>
>>>>>     
>>>>>           
>>>>>> David Smith-2 wrote:
>>>>>>   
>>>>>>       
>>>>>>             
>>>>>>> CutKiller wrote:
>>>>>>>     
>>>>>>>         
>>>>>>>               
>>>>>>>> Hi all I have this scenario: 
>>>>>>>>
>>>>>>>> |Tomcat| -> |Firewall| -> |Database| 
>>>>>>>>
>>>>>>>> Sometimes the connection to the database is lost. The cause of this
>>>>>>>> fact
>>>>>>>> maybe lives in the Firewall. But, the major problem, resides in
>>>>>>>> Tomcat.
>>>>>>>> He
>>>>>>>> doesn't recognize the connection break. What can i do, for Tomcat
>>>>>>>> knows
>>>>>>>> when
>>>>>>>> the connections break? 
>>>>>>>>
>>>>>>>> Best Regards, 
>>>>>>>> Rodrigo
>>>>>>>>   
>>>>>>>>       
>>>>>>>>           
>>>>>>>>                 
>>>>>>> Can you provide a bit more context for when/how you use connections
>>>>>>> and
>>>>>>> how you expect tomcat to recognize when connections break?  In
>>>>>>> general
>>>>>>> webapp code retrieves a connection, does it's business and then
>>>>>>> closes
>>>>>>> the connection to return it to the pool in the smallest reasonable
>>>>>>> space
>>>>>>> .. the whole cycle done and over with by the time your webapp is
>>>>>>> finished with the current request if not sooner.
>>>>>>>
>>>>>>> --David
>>>>>>>
>>>>>>>
>>>>>>>               


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Tomcat and Database Problem

Posted by CutKiller <rj...@gmail.com>.
If helps, the connection state is "connection reset"



CutKiller wrote:
> 
> 
> No errors... :(
> 
> For example when i sign in on the App, appears one error on tomcat log...
> A 403 something...
> 
> 
> 
> 
> David Smith-2 wrote:
>> 
>> Any indication in the logs of what's happening around the time you get a
>> bad connection?  Seems weird to me that the validation query isn't
>> working.
>> 
>> --David
>> 
>> CutKiller wrote:
>>> Tnks David.
>>>
>>>
>>> But the validationQuery was set at the Resources Tags.
>>>
>>> <Context path="/testAdmin" docBase="testAdmin"
>>> 	debug="0" reloadable="true" crossContext="true">
>>> 	<Resource name="jdbc/sp360_main_v2" auth="Container"
>>> 		type="javax.sql.DataSource" maxActive="100" maxIdle="30"
>>> 		maxWait="10000" removeAbandoned="true" removeAbandonedTimeout="1800"
>>> 		logAbandoned="true" username="mqa" password="1nspector"
>>> 		driverClassName="oracle.jdbc.OracleDriver"
>>> 		url="jdbc:oracle:thin:xxx/xxxxx@//00.00.00.00:1521/orcl"
>>> 		validationQuery="select 1 from dual" 
>>> 		testWhileIdle="true"
>>>         timeBetweenEvictionRunsMillis="60000"/>
>>> </Context>
>>>
>>>
>>>
>>>
>>>
>>> David Smith-2 wrote:
>>>   
>>>> CutKiller wrote:
>>>>     
>>>>> If I raise the timeout value in the firewall parameters the connection
>>>>> problem was solved.... but i don't have permissions to do that in real
>>>>> environment.
>>>>>
>>>>> The connections are dead, but this connections stays in tomcat pool
>>>>> with
>>>>> no
>>>>> problems. Tomcat, in a perfect scenario, should recognize the loss of
>>>>> connection, and create a new one.
>>>>>
>>>>> I need this connections anytime.
>>>>>
>>>>>
>>>>>   
>>>>>       
>>>> Right and it would recognize dead connections if validationQuery is
>>>> provided on the connection pool.  The pool will execute the validation
>>>> query before handing your webapp the connection, dropping and creating
>>>> a
>>>> new connection as necessary.   Your problem smells like you are getting
>>>> a connection from the pool and keeping around a long time without
>>>> returning it to the pool.  Doing that effectively circumvents the
>>>> pool's
>>>> ability to validate connections.
>>>>
>>>> Posting details of your setup would be helpful including the <Resource
>>>> ... /> tag that configures your pool and relevant code where things are
>>>> breaking.
>>>>
>>>> --David
>>>>
>>>>     
>>>>> David Smith-2 wrote:
>>>>>   
>>>>>       
>>>>>> CutKiller wrote:
>>>>>>     
>>>>>>         
>>>>>>> Hi all I have this scenario: 
>>>>>>>
>>>>>>> |Tomcat| -> |Firewall| -> |Database| 
>>>>>>>
>>>>>>> Sometimes the connection to the database is lost. The cause of this
>>>>>>> fact
>>>>>>> maybe lives in the Firewall. But, the major problem, resides in
>>>>>>> Tomcat.
>>>>>>> He
>>>>>>> doesn't recognize the connection break. What can i do, for Tomcat
>>>>>>> knows
>>>>>>> when
>>>>>>> the connections break? 
>>>>>>>
>>>>>>> Best Regards, 
>>>>>>> Rodrigo
>>>>>>>   
>>>>>>>       
>>>>>>>           
>>>>>> Can you provide a bit more context for when/how you use connections
>>>>>> and
>>>>>> how you expect tomcat to recognize when connections break?  In
>>>>>> general
>>>>>> webapp code retrieves a connection, does it's business and then
>>>>>> closes
>>>>>> the connection to return it to the pool in the smallest reasonable
>>>>>> space
>>>>>> .. the whole cycle done and over with by the time your webapp is
>>>>>> finished with the current request if not sooner.
>>>>>>
>>>>>> --David
>>>>>>
>>>>>>
>>>>>>         
>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: users-help@tomcat.apache.org
>> 
>> 
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Tomcat-and-Database-Problem-tp22658620p22663799.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Tomcat and Database Problem

Posted by CutKiller <rj...@gmail.com>.

No errors... :(

For example when i sign in on the App, appears one error on tomcat log... A
403 something...




David Smith-2 wrote:
> 
> Any indication in the logs of what's happening around the time you get a
> bad connection?  Seems weird to me that the validation query isn't
> working.
> 
> --David
> 
> CutKiller wrote:
>> Tnks David.
>>
>>
>> But the validationQuery was set at the Resources Tags.
>>
>> <Context path="/testAdmin" docBase="testAdmin"
>> 	debug="0" reloadable="true" crossContext="true">
>> 	<Resource name="jdbc/sp360_main_v2" auth="Container"
>> 		type="javax.sql.DataSource" maxActive="100" maxIdle="30"
>> 		maxWait="10000" removeAbandoned="true" removeAbandonedTimeout="1800"
>> 		logAbandoned="true" username="mqa" password="1nspector"
>> 		driverClassName="oracle.jdbc.OracleDriver"
>> 		url="jdbc:oracle:thin:xxx/xxxxx@//00.00.00.00:1521/orcl"
>> 		validationQuery="select 1 from dual" 
>> 		testWhileIdle="true"
>>         timeBetweenEvictionRunsMillis="60000"/>
>> </Context>
>>
>>
>>
>>
>>
>> David Smith-2 wrote:
>>   
>>> CutKiller wrote:
>>>     
>>>> If I raise the timeout value in the firewall parameters the connection
>>>> problem was solved.... but i don't have permissions to do that in real
>>>> environment.
>>>>
>>>> The connections are dead, but this connections stays in tomcat pool
>>>> with
>>>> no
>>>> problems. Tomcat, in a perfect scenario, should recognize the loss of
>>>> connection, and create a new one.
>>>>
>>>> I need this connections anytime.
>>>>
>>>>
>>>>   
>>>>       
>>> Right and it would recognize dead connections if validationQuery is
>>> provided on the connection pool.  The pool will execute the validation
>>> query before handing your webapp the connection, dropping and creating a
>>> new connection as necessary.   Your problem smells like you are getting
>>> a connection from the pool and keeping around a long time without
>>> returning it to the pool.  Doing that effectively circumvents the pool's
>>> ability to validate connections.
>>>
>>> Posting details of your setup would be helpful including the <Resource
>>> ... /> tag that configures your pool and relevant code where things are
>>> breaking.
>>>
>>> --David
>>>
>>>     
>>>> David Smith-2 wrote:
>>>>   
>>>>       
>>>>> CutKiller wrote:
>>>>>     
>>>>>         
>>>>>> Hi all I have this scenario: 
>>>>>>
>>>>>> |Tomcat| -> |Firewall| -> |Database| 
>>>>>>
>>>>>> Sometimes the connection to the database is lost. The cause of this
>>>>>> fact
>>>>>> maybe lives in the Firewall. But, the major problem, resides in
>>>>>> Tomcat.
>>>>>> He
>>>>>> doesn't recognize the connection break. What can i do, for Tomcat
>>>>>> knows
>>>>>> when
>>>>>> the connections break? 
>>>>>>
>>>>>> Best Regards, 
>>>>>> Rodrigo
>>>>>>   
>>>>>>       
>>>>>>           
>>>>> Can you provide a bit more context for when/how you use connections
>>>>> and
>>>>> how you expect tomcat to recognize when connections break?  In general
>>>>> webapp code retrieves a connection, does it's business and then closes
>>>>> the connection to return it to the pool in the smallest reasonable
>>>>> space
>>>>> .. the whole cycle done and over with by the time your webapp is
>>>>> finished with the current request if not sooner.
>>>>>
>>>>> --David
>>>>>
>>>>>
>>>>>         
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Tomcat-and-Database-Problem-tp22658620p22663344.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Tomcat and Database Problem

Posted by David Smith <dn...@cornell.edu>.
Any indication in the logs of what's happening around the time you get a
bad connection?  Seems weird to me that the validation query isn't working.

--David

CutKiller wrote:
> Tnks David.
>
>
> But the validationQuery was set at the Resources Tags.
>
> <Context path="/testAdmin" docBase="testAdmin"
> 	debug="0" reloadable="true" crossContext="true">
> 	<Resource name="jdbc/sp360_main_v2" auth="Container"
> 		type="javax.sql.DataSource" maxActive="100" maxIdle="30"
> 		maxWait="10000" removeAbandoned="true" removeAbandonedTimeout="1800"
> 		logAbandoned="true" username="mqa" password="1nspector"
> 		driverClassName="oracle.jdbc.OracleDriver"
> 		url="jdbc:oracle:thin:xxx/xxxxx@//00.00.00.00:1521/orcl"
> 		validationQuery="select 1 from dual" 
> 		testWhileIdle="true"
>         timeBetweenEvictionRunsMillis="60000"/>
> </Context>
>
>
>
>
>
> David Smith-2 wrote:
>   
>> CutKiller wrote:
>>     
>>> If I raise the timeout value in the firewall parameters the connection
>>> problem was solved.... but i don't have permissions to do that in real
>>> environment.
>>>
>>> The connections are dead, but this connections stays in tomcat pool with
>>> no
>>> problems. Tomcat, in a perfect scenario, should recognize the loss of
>>> connection, and create a new one.
>>>
>>> I need this connections anytime.
>>>
>>>
>>>   
>>>       
>> Right and it would recognize dead connections if validationQuery is
>> provided on the connection pool.  The pool will execute the validation
>> query before handing your webapp the connection, dropping and creating a
>> new connection as necessary.   Your problem smells like you are getting
>> a connection from the pool and keeping around a long time without
>> returning it to the pool.  Doing that effectively circumvents the pool's
>> ability to validate connections.
>>
>> Posting details of your setup would be helpful including the <Resource
>> ... /> tag that configures your pool and relevant code where things are
>> breaking.
>>
>> --David
>>
>>     
>>> David Smith-2 wrote:
>>>   
>>>       
>>>> CutKiller wrote:
>>>>     
>>>>         
>>>>> Hi all I have this scenario: 
>>>>>
>>>>> |Tomcat| -> |Firewall| -> |Database| 
>>>>>
>>>>> Sometimes the connection to the database is lost. The cause of this
>>>>> fact
>>>>> maybe lives in the Firewall. But, the major problem, resides in Tomcat.
>>>>> He
>>>>> doesn't recognize the connection break. What can i do, for Tomcat knows
>>>>> when
>>>>> the connections break? 
>>>>>
>>>>> Best Regards, 
>>>>> Rodrigo
>>>>>   
>>>>>       
>>>>>           
>>>> Can you provide a bit more context for when/how you use connections and
>>>> how you expect tomcat to recognize when connections break?  In general
>>>> webapp code retrieves a connection, does it's business and then closes
>>>> the connection to return it to the pool in the smallest reasonable space
>>>> .. the whole cycle done and over with by the time your webapp is
>>>> finished with the current request if not sooner.
>>>>
>>>> --David
>>>>
>>>>
>>>>         


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Tomcat and Database Problem

Posted by CutKiller <rj...@gmail.com>.
Tnks David.


But the validationQuery was set at the Resources Tags.

<Context path="/testAdmin" docBase="testAdmin"
	debug="0" reloadable="true" crossContext="true">
	<Resource name="jdbc/sp360_main_v2" auth="Container"
		type="javax.sql.DataSource" maxActive="100" maxIdle="30"
		maxWait="10000" removeAbandoned="true" removeAbandonedTimeout="1800"
		logAbandoned="true" username="mqa" password="1nspector"
		driverClassName="oracle.jdbc.OracleDriver"
		url="jdbc:oracle:thin:xxx/xxxxx@//00.00.00.00:1521/orcl"
		validationQuery="select 1 from dual" 
		testWhileIdle="true"
        timeBetweenEvictionRunsMillis="60000"/>
</Context>





David Smith-2 wrote:
> 
> CutKiller wrote:
>> If I raise the timeout value in the firewall parameters the connection
>> problem was solved.... but i don't have permissions to do that in real
>> environment.
>>
>> The connections are dead, but this connections stays in tomcat pool with
>> no
>> problems. Tomcat, in a perfect scenario, should recognize the loss of
>> connection, and create a new one.
>>
>> I need this connections anytime.
>>
>>
>>   
> Right and it would recognize dead connections if validationQuery is
> provided on the connection pool.  The pool will execute the validation
> query before handing your webapp the connection, dropping and creating a
> new connection as necessary.   Your problem smells like you are getting
> a connection from the pool and keeping around a long time without
> returning it to the pool.  Doing that effectively circumvents the pool's
> ability to validate connections.
> 
> Posting details of your setup would be helpful including the <Resource
> ... /> tag that configures your pool and relevant code where things are
> breaking.
> 
> --David
> 
>>
>>
>> David Smith-2 wrote:
>>   
>>> CutKiller wrote:
>>>     
>>>> Hi all I have this scenario: 
>>>>
>>>> |Tomcat| -> |Firewall| -> |Database| 
>>>>
>>>> Sometimes the connection to the database is lost. The cause of this
>>>> fact
>>>> maybe lives in the Firewall. But, the major problem, resides in Tomcat.
>>>> He
>>>> doesn't recognize the connection break. What can i do, for Tomcat knows
>>>> when
>>>> the connections break? 
>>>>
>>>> Best Regards, 
>>>> Rodrigo
>>>>   
>>>>       
>>> Can you provide a bit more context for when/how you use connections and
>>> how you expect tomcat to recognize when connections break?  In general
>>> webapp code retrieves a connection, does it's business and then closes
>>> the connection to return it to the pool in the smallest reasonable space
>>> .. the whole cycle done and over with by the time your webapp is
>>> finished with the current request if not sooner.
>>>
>>> --David
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>> For additional commands, e-mail: users-help@tomcat.apache.org
>>>
>>>
>>>
>>>     
>>
>>   
> 
> 
> -- 
> David Smith
> Programmer/Analyst
> College of Agriculture and Life Sciences
> Cornell University
> B32 Morrison Hall
> Ithaca, NY 14853
> Phone: (607) 255-4334
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Tomcat-and-Database-Problem-tp22658620p22662411.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Tomcat and Database Problem

Posted by David Smith <dn...@cornell.edu>.
CutKiller wrote:
> If I raise the timeout value in the firewall parameters the connection
> problem was solved.... but i don't have permissions to do that in real
> environment.
>
> The connections are dead, but this connections stays in tomcat pool with no
> problems. Tomcat, in a perfect scenario, should recognize the loss of
> connection, and create a new one.
>
> I need this connections anytime.
>
>
>   
Right and it would recognize dead connections if validationQuery is
provided on the connection pool.  The pool will execute the validation
query before handing your webapp the connection, dropping and creating a
new connection as necessary.   Your problem smells like you are getting
a connection from the pool and keeping around a long time without
returning it to the pool.  Doing that effectively circumvents the pool's
ability to validate connections.

Posting details of your setup would be helpful including the <Resource
... /> tag that configures your pool and relevant code where things are
breaking.

--David

>
>
> David Smith-2 wrote:
>   
>> CutKiller wrote:
>>     
>>> Hi all I have this scenario: 
>>>
>>> |Tomcat| -> |Firewall| -> |Database| 
>>>
>>> Sometimes the connection to the database is lost. The cause of this fact
>>> maybe lives in the Firewall. But, the major problem, resides in Tomcat.
>>> He
>>> doesn't recognize the connection break. What can i do, for Tomcat knows
>>> when
>>> the connections break? 
>>>
>>> Best Regards, 
>>> Rodrigo
>>>   
>>>       
>> Can you provide a bit more context for when/how you use connections and
>> how you expect tomcat to recognize when connections break?  In general
>> webapp code retrieves a connection, does it's business and then closes
>> the connection to return it to the pool in the smallest reasonable space
>> .. the whole cycle done and over with by the time your webapp is
>> finished with the current request if not sooner.
>>
>> --David
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: users-help@tomcat.apache.org
>>
>>
>>
>>     
>
>   


-- 
David Smith
Programmer/Analyst
College of Agriculture and Life Sciences
Cornell University
B32 Morrison Hall
Ithaca, NY 14853
Phone: (607) 255-4334


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Tomcat and Database Problem

Posted by CutKiller <rj...@gmail.com>.
If I raise the timeout value in the firewall parameters the connection
problem was solved.... but i don't have permissions to do that in real
environment.

The connections are dead, but this connections stays in tomcat pool with no
problems. Tomcat, in a perfect scenario, should recognize the loss of
connection, and create a new one.

I need this connections anytime.





David Smith-2 wrote:
> 
> CutKiller wrote:
>> Hi all I have this scenario: 
>>
>> |Tomcat| -> |Firewall| -> |Database| 
>>
>> Sometimes the connection to the database is lost. The cause of this fact
>> maybe lives in the Firewall. But, the major problem, resides in Tomcat.
>> He
>> doesn't recognize the connection break. What can i do, for Tomcat knows
>> when
>> the connections break? 
>>
>> Best Regards, 
>> Rodrigo
>>   
> Can you provide a bit more context for when/how you use connections and
> how you expect tomcat to recognize when connections break?  In general
> webapp code retrieves a connection, does it's business and then closes
> the connection to return it to the pool in the smallest reasonable space
> .. the whole cycle done and over with by the time your webapp is
> finished with the current request if not sooner.
> 
> --David
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Tomcat-and-Database-Problem-tp22658620p22661559.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Tomcat and Database Problem

Posted by David Smith <dn...@cornell.edu>.
CutKiller wrote:
> Hi all I have this scenario: 
>
> |Tomcat| -> |Firewall| -> |Database| 
>
> Sometimes the connection to the database is lost. The cause of this fact
> maybe lives in the Firewall. But, the major problem, resides in Tomcat. He
> doesn't recognize the connection break. What can i do, for Tomcat knows when
> the connections break? 
>
> Best Regards, 
> Rodrigo
>   
Can you provide a bit more context for when/how you use connections and
how you expect tomcat to recognize when connections break?  In general
webapp code retrieves a connection, does it's business and then closes
the connection to return it to the pool in the smallest reasonable space
.. the whole cycle done and over with by the time your webapp is
finished with the current request if not sooner.

--David


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Tomcat and Database Problem

Posted by CutKiller <rj...@gmail.com>.
Tnks Filip.


But i allready try that solution, and the problem continues....



Filip Hanik - Dev Lists wrote:
> 
> use the validationQuery attribute for your connection pool.
> 
> the validationQuery executes a query against the database before the 
> connection is returned to the application, and validates that the 
> connection actually works
> 
> Filip
> 
> CutKiller wrote:
>> Hi all I have this scenario: 
>>
>> |Tomcat| -> |Firewall| -> |Database| 
>>
>> Sometimes the connection to the database is lost. The cause of this fact
>> maybe lives in the Firewall. But, the major problem, resides in Tomcat.
>> He
>> doesn't recognize the connection break. What can i do, for Tomcat knows
>> when
>> the connections break? 
>>
>> Best Regards, 
>> Rodrigo
>>   
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Tomcat-and-Database-Problem-tp22658620p22660822.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Tomcat and Database Problem

Posted by Filip Hanik - Dev Lists <de...@hanik.com>.
use the validationQuery attribute for your connection pool.

the validationQuery executes a query against the database before the 
connection is returned to the application, and validates that the 
connection actually works

Filip

CutKiller wrote:
> Hi all I have this scenario: 
>
> |Tomcat| -> |Firewall| -> |Database| 
>
> Sometimes the connection to the database is lost. The cause of this fact
> maybe lives in the Firewall. But, the major problem, resides in Tomcat. He
> doesn't recognize the connection break. What can i do, for Tomcat knows when
> the connections break? 
>
> Best Regards, 
> Rodrigo
>   


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org