Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!

Bob Hager

+ Follow
since Oct 23, 2008
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Bob Hager


I have an application that connects to a Microsoft SQL Server 2005, using a JDBC connection pool accessible via a datasource.

I am suspecting a connection leakage problem, since the established connections count (between the application server and the database server) keeps on rising until everything freezes up and we have to restart the application server.

I suspect the problem to be in the following code:

Please note that the developer who wrote this, tries to close the cstmt (CallableStatement) AFTER the conn (Connection) is closed.

I'd appreciate some opinions on this, do you think the order of closing the connection is responsible for the leakage? Also, what about the case when the developer forgets to close the cstmt in the first place, could that account for a connection leakage? What about failing to close a ResultSet?

I appreciate any insights or tips towards debugging this problem, and towards better understating JDBC clean-ups in general.


Jeanne Boyarsky wrote:

Bob Hager wrote:The other alternative, using JDK's TimerTask leaves me with the original problem of how to initialize/launch that service. I'd like to avoid running it in a stand-alone mode if possible.

I found a third way that I plan to investigate, using Quartz (open source Apache license 2.0). It sounds simple to use and robust, and can be instantiated from an initialization servlet as suggested by this article:

Why can't you initialize/launch the TimerTask from the servlet (as you are thinking to do with Quartz) ? You can set your web.xml to load the servlet on startup so that happens automatically.

You're right! I'll do exactly that.

11 years ago

Jeanne Boyarsky wrote:Bob,
You could use WebSphere scheduler. Or if you are on a recent version you could use a TimerTask (not IBM specific.) I recommend the later since you don't require complex scheduling.


Thanks for your informative response. I looked into the WebSphere scheduler, and I saw that it requires the WAS admins to write some scripts to schedule the job. That's unfortunate because our Admins that I work with are both overly protective of their territory as well as incompetent (or at very least: lazy), so I don't see them finishing that anytime soon

The other alternative, using JDK's TimerTask leaves me with the original problem of how to initialize/launch that service. I'd like to avoid running it in a stand-alone mode if possible.

I found a third way that I plan to investigate, using Quartz (open source Apache license 2.0). It sounds simple to use and robust, and can be instantiated from an initialization servlet as suggested by this article:



11 years ago

I have a design / architecture question that I'd appreciate some help with.

I am working on a web application that uses Websphere app server. But have a requirement to check a certain DB table periodically (every 2 minutes), and if new rows were inserted, then do something accordingly (namely: call a web service).

The obvious approach is to have this code launched in its own JVM - as a standalone application. But I feel this is not optimal because that JVM will have to be manually managed: For example, if it throws an exception for instance, the JVM will exit and it will have to be manually restarted - among other things..

At the same time, I don't believe standard JEE managed components (Servlets and EJBs) can help me for this purpose, because they run as services that have to be invoked by someone/something. While what I'm trying to do is more of a maintenance/daemon functionality that has to run independently in the background.

So, do you think this approach is sound? and do you know of other - better - alternatives, especially in a Websphere environment?

Much appreciated!

11 years ago
Hi Everyone,

Here is the snippet that I need help with:

public void method1 (String x, String y) {
String z = method2();
doComplexStuff(x, y, z);

method1 is being called from numerous places in this (very) large JSP
file. I need to replace the doComplexStuff() method with a custom tag
that looks something like this:

<xyz:doComplexStuffTag x="value1" y="value2" z="value3" />

Is there a way to replace the fourth line, i.e the doComplexStuff
(x,y,z) call, with the mentioned tag without breaking method1() ? Of
course I still need to continue passing the method parameters (x, y
and z) as tag attribute values.

I know I should refactor the whole thing, but this is not practical at
the moment.

Thanks for any pointers..

- Bob
11 years ago
Exclusive interview with Jonathan:

[ November 08, 2008: Message edited by: Bob Hager ]
11 years ago
>> Gabriel Claramunt ...
>> I'll seriously consider:
>> -Lawyer (they make money everywhere)
>> -Doctor ( debug/maintenance of humans

Now why didn't I think of that (becoming a lawyer/doctor)? now if only I could find those $250K I stashed somewhere in my mattress, just in case I had to go to med school one day

>> omi sharma ...
>> you can live with me and I can manage to arrange breakfast,lunch,supper
>> ,dinner for you(free of cost).However you can't drink alcoholic beverages
>> in my home.

LOL Thanks man for a most generous offer. I would've taken you up on it, but something tells me the wife might not appreciate me packing all of a sudden and boarding the first plane heading to india

On the (really) long term, I think that computer programming in general will become more relevant. We are practically in the infancy of the information age - lots of white-collared professions are yet to lose ground to automation (advances in B2B integration, advances in A.I and expert systems, semantics web, etc.). on a longer time scale, I think lots of blue-collared jobs will start losing ground (A.I/robotics/etc.) - all that is bad news to almost everyone except high tech folks.

I love programming. It's something I would do for free if it weren't for life's little inconveniences, such as having to pay bills. But I cannot ignore that the road to the programmer's utopia (described above) could be a very bumpy one. I.T budgets are particularly susceptible to economic downturns since their budgets are the first to get cut when the getting gets tough. So looking for alternative (or secondary) career paths to ride out the inevitable tough years might not be such a bad idea - nor do I think of it as a negative or a desperate move. I'm even more inclined to investigate blue-collared jobs specifically, because some of them are highly immune to the economic cycles, and could help you keep those bills paid regardless of what some dude � like Bernanke (head of Federal reserve) - does, or who becomes the next president.
11 years ago
Questions: What are the best alternative careers for Java (or Software) developers? (i.e, I.T free alternatives)

BTW, Sounds like a viable book idea for all the books authors out there!

Frequent strengths of Software Developers (Things they could capitalize on):

- Mathematics.
- Logic, Memory.
- High analytical abilities.
- Electronics (many come from EE discipline).
- Ability to work nights and early mornings
- Distinguished coffee drinkers.
- ??

Here are a few suggestions:

- Highschool Math or Physics Teacher.
- Big-city Cab driver (Requires Memory + Math).
- actuary.

Indulge us: What else is out there?
11 years ago
A friend of mine recently interviewed for a position in Toronto, during which he was asked to share a keyboard for about an hour with another programmer (pair programming) to work on a couple of problems and do some bug fixing.

I've done some interviews before, but I've never been subjected to this type of sadism though. I mean it's very difficult to keep a cool head and work under such conditions - at least for me!

Is this form of interviewing common or (hopefully!) rare? With the rise of eXtreme/Agile Programming, is this form of stressful interviews to be expected? If you've been subjected to such torture, what is your observations/recommendations/feedback?
[ October 25, 2008: Message edited by: Bear Bibeault ]
11 years ago
Hmm.. I see.

Way I look at it, if you've gone that far, and studied THAT hard to understand the material required to pass SCJP and SCWCD without having actually worked on real apps, then you probably:
1) HAVE the mindset to be a programmer.
2) are already too deep into java territory to back up now.

What makes you think Network or Sys Admins have it any better? What I'm trying to say is: Don't set yourself up for deeper frustration by spending more $$ & months/years doing a bunch of network/admin certs - only to find yourself in the exact same position you're in now where all the jobs you're applying for (most of which are fake BTW, posted by recruiters to collect resumes or to pump up their image) require experience..

Maybe it's the market, maybe we should dramatically lower our expectations - I mean it doesn't matter how much you've spent on your education, at the end of the day, it's supply & demand, and in the IT world, it seems to me that the supply of eager IT professionals far exceeds the demand.

Good luck man, and don't frustrate - remember there are TONS of others in the same boat as you. Try volunteering or working for scraps. Position yourself well for when the world economy picks up again (if ever).
11 years ago
I cannot offer anything in the way of advise, especially that I'm unemployed myself (recently laid off and trying in vain to land another job) despite having +5 yrs of experience, a CS degree and a bunch of Java certs - which don't seem to make any difference..

What I'd like to ask though is: How on earth did you manage to pass SCWCD 5 exam - which I recall was VERY experience centric - without being able to EASILY patch together a webapp? Just curious really!
11 years ago
Hi Javaranchers,

Is there a way to verify Sun Microsystems certification online? As a means for a prospective employer to verify the candidate's certification claims.

Many thanks!

Not to be bitter or anything, but it seems to me that the only money to be made in Java nowadays comes from selling books to desperate Java programmers looking for a job.

11 years ago
Hi Javaranchers.

Been a java pro most of my career. The latest news from Sun (the defacto Java shepard) are very disheartening. Their share is down the toilet. Analyst believe they have no viable business model, and that they're losing their server market to Microsoft's .Net quickly. Their share outlook has just been downgraded.

Market share isn't the only thing they're losing. Java pioneers are moving to Microsoft's .Net platform. Here is an article:
Reason: better "development practices, technology, management, and working environment"

Also, today another Sun co-founder jumped off their stationwagon:

These are all very bad reports to me, not only do I like Java/Unix and have years and $1000s of hard-earned dollars invested in related training and certifications, but also I HATE working with Microsoft technologies (along with their non-trivial learning curve of proprietary code-generating wizards).

What do you think? Is your business moving away from Java/Unix and into Microsoft? What are your predictions regarding Java/J2EE's future in the Enterprise? Ultimately, did we (Java Professionals) bet on the wrong horse?

11 years ago