Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring forum!

thushara wijeratna

Greenhorn
+ Follow
since Jan 28, 2009
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by thushara wijeratna

I believe this is possible via some jni on Linux (and possibly on other platforms). basically Linux provides a PF_NETLINK socket call where setting the netlink_family to NETLINK_ROUTE allows you to get notifications of all sorts, including interface additions/deletions.
On a Linux shell, do a "man 7 netlink" - there is an example as well.
i think this is difficult to get as the design goals of the Executor framework was to largely hide the underlying thread details from the user.
perhaps you can describe what you are trying to do, and we can think of another way to do that?
I think this is probably because the servlet logic that calls into doFilter() is already catching the exception. try this example, to get an idea:

Jeanne Boyarsky wrote:Thushara,
Could the JDO code itself be catching the error?


except, if i catch Throwable (instead of Exception), i do catch the OutOfMemoryError - this can't happen if the JDO code (which i call) is catching it, right?
11 years ago

Deepak Bala wrote:Describe these two apps. Is app 1 a web app against app 2 being a client app. Web containers may sometimes choose to redirect std out to a file or some other persistence.


they are both stand-alone apps. the first (more complex app) uses JDO to access a mysql database.
11 years ago
I have an app that doesn't produce OutOfMemory output to stderr. I haven't been able to re-pro this problem on a small app, as if I write a simple app that allocates more than the allowed memory, the JVM catches the OutOfMemory and prints it to stderr.

Has anyone seen OutOfMemory errors being swallowed in some way? The code that exhibits this problem does not catch Throwable, or OutOfMemoryError or such, so I would assume the normal JVM handler should catch it and print to stderr...

thanks,
thushara
11 years ago
what review tool are you using and what is the exact message? it seems you are releasing resources correctly.

sreedhar Lackka wrote:Hi,
I am using prepared statement to execute some query but when I verify the same code with some review tool it is giving me an error saying resource cant be released,
Please help me what to do,
Below is the code which I am writing,
Error which I am getting is,"Method may fail to clean up stream or resource " in the line where we are creating prepare statement


Please help me what to do

Regards,
Sree

yes true. one should clear the dest list first. normally, people who want to use Collections.copy has an empty destination list in mind. Alas, Collections.copy doesn't really do a copy, it is an "element replacer". so we fall back on List.addAll().
11 years ago
You could use List.addAll(Collection c) to do this as well.
11 years ago