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-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@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-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to