473,899 Members | 3,641 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

DB2 connection time out error

4 New Member
Hi to all,
I have wrote a jsp-servlet program(using struts) which connects to DB2 via JDBC.

I am using Tomcat5.5.
JDBC driver as400thinjdbc.j ar .
DB connection paramaters are

<data-sources>
<data-source id="DB2" type="org.apach e.tomcat.dbcp.d bcp.BasicDataSo urce">
<set-property property="usern ame" value="XXXX"/>
<set-property property="maxAc tive" value="10"/>
<set-property property="passw ord" value="XXXX"/>
<set-property property="url" value="jdbc:as4 00://XX.XX.XX.XX/MYLIB"/>
<set-property property="defau ltAutoCommit" value="false"/>
<set-property property="maxWa it" value="5000"/>
<set-property property="drive rClassName" value="com.ibm. as400.access.AS 400JDBCDriver"/>
</data-source>
</data-sources>


The program is running fine and giving me all the expected values from DB2 BUT after 1hr or 2 or 3hrs of discontinuity from my web application,whe n I try to connect DB2 it takes 10-15 minutes.
Sometimes it gives "Connection time out error" stating in my log file.

I googled the internet but couldn't found any satisfied solution.

I changed my driver to jt400.jar but no luck.

Can you experts please point out the mistake I am doing.

Thanks in advance.
Feb 19 '07 #1
4 11510
maneeshjp
4 New Member
Hi to all,
I have wrote a jsp-servlet program(using struts) which connects to DB2 via JDBC.

I am using Tomcat5.5.
JDBC driver as400thinjdbc.j ar .
DB connection paramaters are

<data-sources>
<data-source id="DB2" type="org.apach e.tomcat.dbcp.d bcp.BasicDataSo urce">
<set-property property="usern ame" value="XXXX"/>
<set-property property="maxAc tive" value="10"/>
<set-property property="passw ord" value="XXXX"/>
<set-property property="url" value="jdbc:as4 00://XX.XX.XX.XX/MYLIB"/>
<set-property property="defau ltAutoCommit" value="false"/>
<set-property property="maxWa it" value="5000"/>
<set-property property="drive rClassName" value="com.ibm. as400.access.AS 400JDBCDriver"/>
</data-source>
</data-sources>

The program is running fine and giving me all the expected values from DB2 BUT after 1hr or 2 or 3hrs of discontinuity from my web application,whe n I try to connect DB2 it takes 10-15 minutes.
Sometimes it gives "Connection time out error" stating in my log file.

I googled the internet but couldn't found any satisfied solution.

I changed my driver to jt400.jar but no luck.

Can you experts please point out the mistake I am doing.

Thanks in advance.
Feb 19 '07 #2
r035198x
13,262 MVP
Hi to all,
I have wrote a jsp-servlet program(using struts) which connects to DB2 via JDBC.

I am using Tomcat5.5.
JDBC driver as400thinjdbc.j ar .
DB connection paramaters are

<data-sources>
<data-source id="DB2" type="org.apach e.tomcat.dbcp.d bcp.BasicDataSo urce">
<set-property property="usern ame" value="XXXX"/>
<set-property property="maxAc tive" value="10"/>
<set-property property="passw ord" value="XXXX"/>
<set-property property="url" value="jdbc:as4 00://XX.XX.XX.XX/MYLIB"/>
<set-property property="defau ltAutoCommit" value="false"/>
<set-property property="maxWa it" value="5000"/>
<set-property property="drive rClassName" value="com.ibm. as400.access.AS 400JDBCDriver"/>
</data-source>
</data-sources>
The program is running fine and giving me all the expected values from DB2 BUT after 1hr or 2 or 3hrs of discontinuity from my web application,whe n I try to connect DB2 it takes 10-15 minutes.
Sometimes it gives "Connection time out error" stating in my log file.

I googled the internet but couldn't found any satisfied solution.

I changed my driver to jt400.jar but no luck.

Can you experts please point out the mistake I am doing.

Thanks in advance.
Copied to DB2 forum
Feb 19 '07 #3
r035198x
13,262 MVP
Hi to all,
I have wrote a jsp-servlet program(using struts) which connects to DB2 via JDBC.

I am using Tomcat5.5.
JDBC driver as400thinjdbc.j ar .
DB connection paramaters are

<data-sources>
<data-source id="DB2" type="org.apach e.tomcat.dbcp.d bcp.BasicDataSo urce">
<set-property property="usern ame" value="XXXX"/>
<set-property property="maxAc tive" value="10"/>
<set-property property="passw ord" value="XXXX"/>
<set-property property="url" value="jdbc:as4 00://XX.XX.XX.XX/MYLIB"/>
<set-property property="defau ltAutoCommit" value="false"/>
<set-property property="maxWa it" value="5000"/>
<set-property property="drive rClassName" value="com.ibm. as400.access.AS 400JDBCDriver"/>
</data-source>
</data-sources>

The program is running fine and giving me all the expected values from DB2 BUT after 1hr or 2 or 3hrs of discontinuity from my web application,whe n I try to connect DB2 it takes 10-15 minutes.
Sometimes it gives "Connection time out error" stating in my log file.

I googled the internet but couldn't found any satisfied solution.

I changed my driver to jt400.jar but no luck.

Can you experts please point out the mistake I am doing.

Thanks in advance.
Possible reasons IMO.

The project could be having a setting for automatically unpublishing itself from the server after some idle time.
It could be trying to build the project when you tried to access the project.
Feb 19 '07 #4
maneeshjp
4 New Member
Possible reasons IMO.

The project could be having a setting for automatically unpublishing itself from the server after some idle time.
It could be trying to build the project when you tried to access the project.
First of all thanks for your reply.

As I do not have any specific setting in my project.

There are web.xml and context.xml files to set the project specification settings.
I did not change any changes directly on my Tomcat5.5 server.xml or any other setting files.

My context.xml file (in META-INF) have

Expand|Select|Wrap|Line Numbers
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <Context path="/myapp" reloadable="true">
  3. <Environment description="URL for configuring log4j context" name="log4j/configuration-resource"
  4.             type="java.lang.String"
  5.             value="myapp-log4j.xml"/>
  6. <Environment description="JNDI logging context for this app" name="log4j/context-name"
  7.             type="java.lang.String"
  8.             value="myapp"/>
  9. </Context>
And my web.xml file have

Expand|Select|Wrap|Line Numbers
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee"
  3.  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
  4.  <display-name>myapp</display-name>
  5.  <filter>
  6.   <filter-name>SetCharacterEncoding</filter-name>
  7.   <filter-class>SetCharacterEncodingFilter</filter-class>
  8.   <init-param>
  9.    <param-name>encoding</param-name>
  10.    <param-value>UTF-8</param-value>
  11.   </init-param>
  12.  </filter>
  13.  <filter-mapping>
  14.   <filter-name>SetCharacterEncoding</filter-name>
  15.   <url-pattern>/*</url-pattern>
  16.  
  17.  </filter-mapping>
  18.  <listener>
  19.   <listener-class>org.apache.log4j.selector.servlet.ContextDetachingSCL</listener-class>
  20.  </listener>
  21.  <!-- Action Servlet Configuration -->
  22.  <servlet>
  23.   <servlet-name>action</servlet-name>
  24.   <servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
  25.   <init-param>
  26.    <param-name>config</param-name>
  27.    <param-value>/WEB-INF/struts-config.xml</param-value>
  28.   </init-param>
  29.   <load-on-startup>1</load-on-startup>
  30.  </servlet>
  31.  <!-- Action Servlet Mapping -->
  32.  <servlet-mapping>
  33.   <servlet-name>action</servlet-name>
  34.   <url-pattern>*.do</url-pattern>
  35.  </servlet-mapping>
  36.  <session-config>
  37.   <session-timeout>60</session-timeout>
  38.  </session-config>
  39.  <!-- The Usual Welcome File List -->
  40.  <welcome-file-list>
  41.   <welcome-file>index.jsp</welcome-file>
  42.  </welcome-file-list>
  43.  <jsp-config>
  44.   <taglib>
  45.    <taglib-uri>/WEB-INF/struts-bean</taglib-uri>
  46.    <taglib-location>/WEB-INF/struts-bean.tld</taglib-location>
  47.   </taglib>
  48.   <taglib>
  49.    <taglib-uri>/WEB-INF/struts-logic</taglib-uri>
  50.    <taglib-location>/WEB-INF/struts-logic.tld</taglib-location>
  51.   </taglib>
  52.   <taglib>
  53.    <taglib-uri>/WEB-INF/struts-html</taglib-uri>
  54.    <taglib-location>/WEB-INF/struts-html.tld</taglib-location>
  55.   </taglib>
  56.   <taglib>
  57.    <taglib-uri>/WEB-INF/struts-tiles</taglib-uri>
  58.    <taglib-location>/WEB-INF/struts-tiles.tld</taglib-location>
  59.   </taglib>
  60.   <taglib>
  61.    <taglib-uri>http://jsptags.com/tags/navigation/pager</taglib-uri>
  62.    <taglib-location>/WEB-INF/pager-taglib.tld</taglib-location>
  63.   </taglib>
  64.  </jsp-config>
  65.  <login-config>
  66.   <auth-method>BASIC</auth-method>
  67.  </login-config>
  68. </web-app>
Feb 20 '07 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

6
2350
by: Chris Szabo | last post by:
I've created a data access layer for a .NET web application. I'm using C# and framework 1.1. I'm getting an error from time to time when I close a connection saying: System.InvalidOperationException: A connection pooling error has occurred. It doesn't happen each time, the exception is thrown randomly. The big problem is that the connection is left active in the pool. After a short period of time, the pool is filled up and people...
3
2585
by: Matthew Louden | last post by:
I attempt to connect ASP.NET application with SQL Server using ADO.NET. I just open a connection, and it had run-time error in line 34: cn.open(): SQL Server does not exist or access denied. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details:...
1
4282
by: Matthew Louden | last post by:
I just tried to create a simple ASP.NET application to add record to the SQL Server database. However, it has run time error on Line 88: objCommand.ExecuteNonQuery() Any ideas?? Please help!! Thanks!! Sub AddNewRecord() Dim objConnection As SqlConnection Dim strConnection As String = "Data Source=20.11.12.91;Network Library=DBMSSOCN;Initial Catalog=testtable;User ID=sa;Password=iw;"
1
6100
by: Akinyemi | last post by:
I created a Database which I named "Address". I went through the Control Panel and created a DSN to enable me connect to the Database through ODBC. I then created a Form with the same fields as that of the Database. I wrote the necessary codes and ran the Program. Below are my codes and the runtime error I received: Run-Time Error -2147217904(80040e10): Too few parameters. Expected 1
8
16194
by: fniles | last post by:
Can I change the connection time out in VB.Net 2003 and MS Access (using OLEDbConnection) ? When I use Connect Timeout = 60 in the connectionstring, I get an error "Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done." Thanks. ConnectionOLE = New OleDb.OleDbConnection sPath = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & sDBPath &
2
2585
by: LadyRed2 | last post by:
Hello, I am new to Excel and SQL server, so please be patient with me. I have written code with the help of others to update a table in a sql database from an excel form. The connection code works as I have used it for a query before. Here is the code Private Sub CommandButton3_Click() 'to Update or Insert new into the form
0
1258
by: 362315 | last post by:
I am receiving the following error: Microsoft Visual Basic Run-Time error '2147467259 (80004005)': The microsoft jet database engine cannot open the file. It is already opened exclusively by another user, or you need permission to view its data. This is the code I am using, the following is assigned to a button which should send data through to an access table, however works for me, but when other users try it they get the above...
1
1466
by: Kandiman | last post by:
sorry, its me again... stuck. im getting the error: Run-time error '91': Object Variable or With block variable not set My code is:
0
1909
by: bssandeshbs | last post by:
I am developing a Address Book Database Project using Visual Basic 6... When i click the delete button the data does'nt get deleted in the FrontEnd ..But it gets deleted in Database when we see in Access... When i try to delete again in VB front End it gives a Error message and it gets RUN time Error 3021 Either BOF or EOF is true,or current record has been deleted..Requested operation requires a current Record... I am POSting the...
1
4633
by: zedd | last post by:
Hi, I orignaly posted this with the error above, however I am still trying to solve it on my own, and found that some of my syntax in the query was not correct and I corrected it. But i am still getting an error although a different one = run-time error '-2147217913 (80040e07)': data type mismatch in criteria expression. I'm creating a user form in excel to pull through/update/insert info into my access db. I have created a user form to...
0
11272
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10863
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10971
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10494
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9666
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
8039
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5887
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
6081
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
3317
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.