• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

application hangs at closing the database connection

 
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Ranch Hand
Posts: 446
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 446
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 was her plaything! And so was this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic