Tuesday, January 24, 2006
Atomic transaction in J2EE
As budding developers, most of us tend to debate on certain technologies out there and comment on which is better than which and why. dotNet developers will argue that J2EE is so hard to use while the latter will comment that dotNet does not scale and is not as reliable. Even within the J2EE environment, some developers does not see EJB as a useful feature of J2EE and comment that it is difficult to develop and the same results can be achieved merely by using JDBC. There are even others who said that using stored procedures will result in most efficient code. Efficient here means fastest to execute and return desired results. As I am also one of the budding developers, I also face this type of debates most of the time. I still does not know which one is most efficient and which one should I use in which type of situation. However, I does realize the fact that session beans and entity beans removed a lot of the headache of maintaining transactions in JDBC environment. Container managed transaction is a blessing for Java developers.
Anyway, the point is, I actually like to find out WHAT IF the transaction that is guaranteed by the container fails. I mean, say the task A and task B must occur as one atomic transaction but actually only task A managed to run but the transaction is unable to roll it back or worst, does not even realized it. Who would be responsible for this behavior? Most of the time it would be developers fault for not understanding the J2EE spec correctly and made mistakes while developing, however one cannot simply rule out that the application server vendor is not at fault. What if this funny behavior is randomly appearing at production systems and the developers are sure that their application are coded correctly. Who are liable for financial lost that occurred because of application servers funny inconsistent behavior?
Monday, January 16, 2006
Death March

Friday, January 13, 2006
The Dilbert Blog: The Devil
Interesting thoughts about stoning the devil...
Read more at dilbertblog.typepad.com...
Tuesday, January 03, 2006
Overloading in Tiger
I was confused with how overloading in J2SE 5.0 works, so I compiled a little example to show. Initially, I thought the code will refuse to compile but I was proven wrong. It does compile and there is some precedence to which method that will be invoked.
public class Overload { public static void main(String[] args) { Overload m = new Overload(); short s = 0; m.foo(s); } //Direct primitive type match will take precedence private void foo(short l){ System.out.println("short"); } //Primitive type promotion will take precedence over Autoboxing private void foo(long l){ System.out.println("long"); } //Autoboxing will only happen when primitive or promotion not available private void foo(Short l){ System.out.println("Short"); } }
Subscribe to:
Posts (Atom)