Home arrow static arrow Java Programming [Archive] - Catching causal exceptions from finally{} block?
Warning: Creating default object from empty value in /www/htdocs/w008deb8/wiki/components/com_staticxt/staticxt.php on line 51
Java Programming [Archive] - Catching causal exceptions from finally{} block?
This topic has 84 replies on 6 pages.    « Previous | 1 | 2 | 3 | 4 | 5 | 6 |

Posts:2,830
Registered: 9/1/03
Re: Catching causal exceptions from finally{} block?  
Aug 5, 2004 3:09 PM (reply 75 of 84)



 
But again based on the JDBC postings a lot of other
people don't. If they don't understand that there is
a resource management issue there to begin with, then
exceptions don't help with that.

but they don't need to completely understand what is going on,
this is the point of the exception.

it can suggest why the call failed and hint at a way to fix it. exceptions
have helped me, many times, understand what is going on in the method,
without it i wouldn't have considered that a file may not be able to be 'closed'
and so on.
 

Posts:6,750
Registered: 1/25/04
Re: Catching causal exceptions from finally{} block?  
Aug 5, 2004 3:45 PM (reply 76 of 84)



 
exceptions
have helped me, many times, understand what is going
on in the method,
without it i wouldn't have considered that a file may
not be able to be 'closed'
and so on.

Hm, so maybe checked exceptions aren't so bad after all. :-)
 

Posts:2,830
Registered: 9/1/03
Re: Catching causal exceptions from finally{} block?  
Aug 5, 2004 3:51 PM (reply 77 of 84)



 
exceptions
have helped me, many times, understand what is going
on in the method,
without it i wouldn't have considered that a file
may
not be able to be 'closed'
and so on.

Hm, so maybe checked exceptions aren't so bad after
all. :-)

exceptions, not neccessarily checked ones :) i do read documentation sometimes :)

but sure, sometimes it's handy to have the compiler tell you without the need to look up
the documentation, except for ... i think i've said enough :)
 

Posts:27,518
Registered: 11/3/97
Re: Catching causal exceptions from finally{} block?  
Aug 5, 2004 5:00 PM (reply 78 of 84)



 
But again based on the JDBC postings a lot of other
people don't. If they don't understand that there is
a resource management issue there to begin with, then
exceptions don't help with that.

but they don't need to completely understand what is going on,
this is the point of the exception.

Yes they do. And the exception does not help with that.

To write SQL code you must understand resource management.

it can suggest why the call failed and hint at a way to fix it. exceptions
have helped me, many times, understand what is going on in the method,
without it i wouldn't have considered that a file may
not be able to be 'closed' and so on.

Yes, but that is not what I am talking about.

If you do not understand what a resource is and do not understand what you need to do to manage it then exceptions, checked or not, is not going to help you. Seeing an exception at a higher level isn't going to help with that either.
 

Posts:2,830
Registered: 9/1/03
Re: Catching causal exceptions from finally{} block?  
Aug 5, 2004 7:07 PM (reply 79 of 84)



 
But again based on the JDBC postings a lot of
other
people don't. If they don't understand that there
is
a resource management issue there to begin with,
then
exceptions don't help with that.

but they don't need to completely understand what is
going on,
this is the point of the exception.

Yes they do. And the exception does not help with
that.

If you say so.. I don't believe it's true, however. It's entirely possible to
see the exception, understand exception handling, handle the error
(via log or exit) and not fully understand the cause of the exception.

I don't fully understand what may have caused my OOM exception,
but I can handle it via a global exception handler if I feel like.

If you do not understand what a resource is and do not
understand what you need to do to manage it then
exceptions, checked or not, is not going to help you.
Seeing an exception at a higher level isn't going to
help with that either.

care to clarify what you mean by 'what you need to do to manage it' ?

I can tell a co-worked to always put a try / catch / log / exit around a
certain part of code and they can have no idea why, but they will do
it.
 

Posts:37,103
Registered: 3/30/99
Re: Catching causal exceptions from finally{} block?  
Aug 5, 2004 7:29 PM (reply 80 of 84)



 
I can tell a co-worked to always put a try / catch /
log / exit around a
certain part of code and they can have no idea why,
but they will do
it.

Your coworkers actually follow your suggestions? Lucky so-and-so.
 

Posts:27,518
Registered: 11/3/97
Re: Catching causal exceptions from finally{} block?  
Aug 6, 2004 9:32 AM (reply 81 of 84)



 
But again based on the JDBC postings a lot of
other
people don't. If they don't understand that there
is
a resource management issue there to begin with,
then
exceptions don't help with that.

but they don't need to completely understand what is
going on,
this is the point of the exception.

Yes they do. And the exception does not help with
that.

If you say so.. I don't believe it's true, however.

I suggest you spend more time in the JDBC and Sockets forum then.

Perhaps by the sixth time that you explain to someone why you can't serialize a ResultSet or a Socket it will become more apparent.


If you do not understand what a resource is and do
not
understand what you need to do to manage it then
exceptions, checked or not, is not going to help you.
Seeing an exception at a higher level isn't going to
help with that either.

care to clarify what you mean by 'what you need to do
to manage it' ?

A resource is a limited commodity on a computer.

So you need to control how it is acquired, used and returned to the system. None of that has anything to do with exceptions.

I can tell a co-worked to always put a try / catch /
log / exit around a
certain part of code and they can have no idea why,
but they will do it.

Yes and I can spend hours explaining to a co-worker what resources on a computer does.

But that has nothing to do with what you are suggesting.

You suggested that simply because an exception exists and because it occurs that this will allow someone to understand how to manage resources. Are you claiming that everytime an exception occurs in the world that you personally are going to explain about resources?
 

Posts:2,830
Registered: 9/1/03
Re: Catching causal exceptions from finally{} block?  
Aug 6, 2004 6:29 PM (reply 82 of 84)



 
But again based on the JDBC postings a lot of
other
people don't. If they don't understand that
there
is
a resource management issue there to begin
with,
then
exceptions don't help with that.

but they don't need to completely understand
what is
going on,
this is the point of the exception.

Yes they do. And the exception does not help with
that.

If you say so.. I don't believe it's true, however.

I suggest you spend more time in the JDBC and Sockets
forum then.

not undetsanding that some things can't be serialised is different from
from what we are discussing, isn't it ?

anyway, reading the rest of your message i'm confused as to what our
original discussion was ... so i think i'll leave it :)

You suggested that simply because an exception exists
and because it occurs that this will allow someone to
understand how to manage resources. Are you claiming
that everytime an exception occurs in the world that
you personally are going to explain about resources?

All I meant was because an exception exists they are able to handle
it without fully understanding what is going on.

that is all :)
 

Posts:27,518
Registered: 11/3/97
Re: Catching causal exceptions from finally{} block?  
Aug 7, 2004 3:03 PM (reply 83 of 84)



 

not undetsanding that some things can't be serialised
is different from
from what we are discussing, isn't it ?

No. If you understand the resources of a computer enough to understand why and how you must manage them then you will understand why it can't be serialized.

Of course you might understand that it can't be serialized and still not understand that the resource must be managed.

You suggested that simply because an exception exists
and because it occurs that this will allow someone to
understand how to manage resources. Are you claiming
that everytime an exception occurs in the world that
you personally are going to explain about resources?

All I meant was because an exception exists they are able to handle
it without fully understanding what is going on.

that is all :)

And I am saying that is incorrect in terms of resource management. You can certainly learn that too many database connections means that you will get an exception. But that doesn't help you to understand why to many connections is bad, nor that you might be able to increase the maximum (and why you should or should not) and how that limit needs to impact how you need to design your code because of when connections are maintained even though other exceptions occur.

The existance of an exception will not teach those things.
 

Posts:2,830
Registered: 9/1/03
Re: Catching causal exceptions from finally{} block?  
Aug 7, 2004 3:36 PM (reply 84 of 84)



 
All I meant was because an exception exists they are
able to handle
it without fully understanding what is going on.

that is all :)

And I am saying that is incorrect in terms of resource
management. You can certainly learn that too many
database connections means that you will get an
exception. But that doesn't help you to understand
why to many connections is bad, nor that you might be
able to increase the maximum (and why you should or
should not) and how that limit needs to impact how you
need to design your code because of when connections
are maintained even though other exceptions occur.

The existance of an exception will not teach those
things.

Okay, I'll agree with that :)
 
This topic has 84 replies on 6 pages.    « Previous | 1 | 2 | 3 | 4 | 5 | 6 |