Poo Kan

Ranch Hand
+ Follow
since May 26, 2004
Merit badge: grant badges
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Poo Kan

Because, you can see from the error message, the JVM does a arrayCopy when it expands the StringBuilder. If the StirngBuilder needs to be expanded whenever you append a char, then JVM will do this array copy again and again which consumes a lot of memory. I think you need to change your way of reading with buffering. try using readLine(byte[] b,int off,int len) method of ServletInputStream.
14 years ago
i think sysout will be faster than logging in DEBUG level. but when your application goes to production, you will not log everything. if you do so you have to face a big performance issue. logger gives you much convenient ways implement logging.
14 years ago
Animesh, shouldn't your application deployed under webapps? .... webapps>MyApp>WEN-INF>classes
14 years ago
surya, it good to know how to find the class version.But I doubt that finding the class version in your class file will be helpful for resolving this issue and it is already in the error message given by ant and the class version is 50. you should use the component(sanjdk.jar) compiled with compiler compliance level 1.5, or as Rob suggested upgrade your JVM
14 years ago
Kri Shan, By stating in-memory caching, do you mean having a static instance variable of HashMap? if so, you might need to synchronize the part accessing/updating this Map. Or you can try using http://download.oracle.com/docs/cd/E17476_01/javase/1.5.0/docs/api/java/util/Collections.html#synchronizedMap(java.util.Map)

HashTable is synchronized and can be used in multi-thread environment but it is kind of getting old.

14 years ago
Nilk, May i know why do you need to get the WAR file path? So that can think of an alternatives...
14 years ago
Should not be any problem unless those ports are used by other programs. you can use up to 65535. you can do a "netstat -ona" on command prompt and check whether these ports are already being used
i would prefer to keep the parameters list inside the method as it would be thread safe in a multi thread environment. And i would suggest to load the quarries form a properties file,cache it and use it, so that you will not need to change the source code for any changes in query

Apart from 'parameters' list and query, i would also suggest to change the method signature to return List than ArrayList. Always better to have the return type as an interface unless you have any special reasons to return the concrete class.it hides the internal implementation and also flexible for any internal changes.
14 years ago
In your first example, you override the method m() of A. so when you call x.m(), the overridden method is called and it prints "B".

But in the second, you have a new method m1(). so when you call x.m(), the inherited method is called and prints 'A'.

And i doubt whether you can call it as " static inner class ". it is just a static variable refers to a Anonymous inner class
14 years ago
it's not clear what you mentioned by "database updates will rollback, when database update fails". I don't think that data will just be rolled back if there is a update failure unless a system exception or an ApplicationException( with rollback=true) is thrown. I assume that you use CMT as you mentioned about REQUIRED Tx attribute.

I think this post would give you a better inside https://coderanch.com/t/444151/java-EJB-SCBCD/certification/MDB-Message-Redelivery-discard
you can try this if you haven't yet http://www.compoundtheory.com/javaloader/docs/
14 years ago
i think you should have used ServletContext#getInitParameter method
14 years ago
I would prefer servlet filter as it would be a controller for all servlets
14 years ago
What i can think of is jar file or the classes loaded at runtime. It may still refer to the old classes. As you have changed the code, please check whether only the modified classes are loaded at runtime
14 years ago