• 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

JSP vs. Servlet via JDBC-ODBC bridge

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Environment is a Win95 machine running jswdk101, jdk122.
Right before I started learning about JSP pages, etc., I had written a _servlet_ that would take information from an http post, and look up something in a database, then spit that data out to the response as html. That worked well, except that when garbagecollect would run, it would crash my server. Well, I went back and cleared out references to SQL-specific objects at the end of the routine, and lo and behold, it worked.
Then, I took that servlet and turned it into a JSP page. Same code, same clearing of the references, etc., but it again crashes my server.
Any ideas on what may be happening?
- Brett
 
Ranch Hand
Posts: 124
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Make sure you are explicitly closing all the ResultSet and Statement objects and of course Connection too.
 
Brett Paul
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes, I am doing these things in both cases (servlet and jsp). However, like I said, it works fine (without crashing) in the servlet, but crashes the server in the JSP page. I might add that the output is sent back to the client first, and the crash happens on garbagecollect.
 
Ranch Hand
Posts: 107
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Are you using to declare your connection object and such, in your page. If so it means that vars declared in these blocks are available to all threads of the jsp and the next time you access the page that var (like a Connection object) has been close or set to null.
good luck
paul
[This message has been edited by Paul Wetzel (edited October 18, 2000).]
 
reply
    Bookmark Topic Watch Topic
  • New Topic