aspose file tools*
The moose likes Websphere and the fly likes application hangs at closing the database connection Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Products » Websphere
Bookmark "application hangs at closing the database connection" Watch "application hangs at closing the database connection" New topic
Author

application hangs at closing the database connection

ganta gopal
Greenhorn

Joined: Feb 05, 2009
Posts: 15
Hi,

My QA server is WAS 6.1 and in my application these is a code which uses one connection to perform multiple database operations.
At the end the connection is closed. When running the application the application hangs at the connection release statement.
i,e

1) Get connection
2) Use connection
a) DB operation 1
b) DB operation 2
...........
3) Closing connection

The application is hanged at closing connection.
Please help me ...
ganta gopal
Greenhorn

Joined: Feb 05, 2009
Posts: 15
Adding more.

I see the following in systemout.log files

[10/5/10 18:56:35:131 PDT] 00000040 ThreadMonitor W WSVR0605W: Thread "WebContainer : 6" (00000046) has been active for 626411 milliseconds and may be hung. There is/are 2 thread(s) in total in the server that may be hung.
[10/5/10 18:56:35:138 PDT] 00000040 ThreadMonitor W WSVR0605W: Thread "WebContainer : 2" (0000003e) has been active for 747858 milliseconds and may be hung. There is/are 3 thread(s) in total in the server that may be hung.
[10/5/10 18:56:35:139 PDT] 00000040 ThreadMonitor W WSVR0605W: Thread "WebContainer : 3" (00000042) has been active for 633171 milliseconds and may be hung. There is/are 4 thread(s) in total in the server that may be hung.
[10/5/10 18:56:35:140 PDT] 00000040 ThreadMonitor W WSVR0605W: Thread "WebContainer : 5" (00000044) has been active for 690988 milliseconds and may be hung. There is/are 5 thread(s) in total in the server that may be hung.
[10/5/10 18:59:35:151 PDT] 0000001a ThreadMonitor W WSVR0605W: Thread "WebContainer : 9" (00000049) has been active for 618001 milliseconds and may be hung. There is/are 6 thread(s) in total in the server that may be hung.
[10/5/10 18:59:35:156 PDT] 0000001a ThreadMonitor W WSVR0605W: Thread "WebContainer : 4" (00000043) has been active for 680196 milliseconds and may be hung. There is/are 7 thread(s) in total in the server that may be hung.

Note: In the same connection it is also making a webservice call.
ganta gopal
Greenhorn

Joined: Feb 05, 2009
Posts: 15
Hi,

I debugged more this way.
Instead of using single connection for all db operations, i created a separate connection and closed after its use.
At one place i found that we take a prepared statement from a connection and when closing the prepared statement the server hungs.
ganta gopal
Greenhorn

Joined: Feb 05, 2009
Posts: 15
Hi,

The problem has been resolved.I found that there is a jdbc driver version problem. Using jdbc driver 9.0.2.0 it is working fine.
Deepak Pant
Ranch Hand

Joined: Feb 13, 2004
Posts: 443
What database version are you using? If it is Oracle then you can upgrade to 11.2 version of the drivers. The Oracle JDBC drivers are backward compatible with 9i amd 10g.
ganta gopal
Greenhorn

Joined: Feb 05, 2009
Posts: 15
Hi Deepak,

I will explain the problem clearcly.
In my application there is a column in database of type Date but in my application when i read it as rs.getObject("***") i am getting only Date with no timestamp when i use jdbc driver 10.0.2.0. When i use the class12.zip having jdbc driver version 8.0.2.0 I am getting both date and timestamp.
But i have another code where i am creating a prepared statement from a connection. At the line of closing the connection i,e con.close() the application got hanged. So when i change by jdbc driver version to 9.0.2.0 both the problems got solved..
Deepak Pant
Ranch Hand

Joined: Feb 13, 2004
Posts: 443
Generally I use rs.getTimestamp() method to get both the date & time part. What I was trying to suggest is that using latest jdbc driver against old database version eliminates other issues that JDBC vendor has fixed.

But you should stick to whatever version works for you. Working system is much better than optimized but failing system.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: application hangs at closing the database connection