Win a copy of 97 Things Every Java Programmer Should Know this week in the Java in General forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
  • Piet Souris
  • salvin francis
  • fred rosenberger


Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a sessionEJB which create and active methods create connections to a database via JDBC. The EJB has a method call getData() that executes a query.
I also have a Web Application that in the first jsp creates an instance of the EJB and saves it into a session variable. In the second jsp, i get the EJB from the session variable and execute the method getData.
The EJB and WebApllication are deployed in Weblogic6.1.
The Database is shutdown every night.
In the case of weblogic6.1 in Windows plataform every thing is ok!. The problem is when the plaform is solaris. The database used is the same for Windowns and Solaris.
Every first time in a day that i try to use the web application, it throws the Exception: java.sql.SQLException: No more data to read from socket. the exception is throwned when i try to execute the method getData.
I stop the server(weblogic), start it and the problem disapears until the next morning!?!?
I am confused!!! Can anyone help me? It�s urgent!!!
Ranch Hand
Posts: 150
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm only beginning to play with EJBs, so don't have an understanding of whether the EJB would try to hold onto a JDBC connection (and thus have a problem once the db was shut down overnight) or would create it as needed. Maybe that's the difference between the Solaris and the Windows platform. Regardless. . . as a quick fix, can you either set up a cron job to restart the server after the time that the database is restarted, or put a procedure in your database that would restart the webserver once the database is started?
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Looks like your Connectio Pool (Data Source) connections are going stale as it loses all connections to the database when the database shuts down.
I guess you will have to somehow recreate the connection pool every morning or you can write a Connection Pool, associate it with a Timer, so that it knows when to reduce the size of the pool to zero (at night) and recreate it in the morning.
Another thing worth trying would be to have the initial size of the pool to zero, and have srink to size flag set. Its my guess that when the application is not used, the pool size will reduce to zero (at night), and when the application is up and running (morning), it will recreate all the connections. This way you will not have a stale connection.
Hope this helps...
Poop goes in a willow feeder. Wipe with this tiny ad:
Devious Experiments for a Truly Passive Greenhouse!
    Bookmark Topic Watch Topic
  • New Topic