Skip to main content


Showing posts from June, 2008

What is Consumer JRE, Java Kernel

The JRE 1.6 update 10 around the corner. Sun's Initiative to slim down a huge 14 MB JRE download is very much understandable to keep itself in competition. But for an average joe, How would this matter? There is some confusion in understanding what is this release about. Why is this in minor release update? What is expected? Why now?

Java Kernel, has been in talks for a while now. Why now - because with AIR, SilverLight taking on RIA market, Java cannot lag behind sticking to its thick client apis (AWT,SWT). But here is the thing, This release hass no change in API. Its just a new JRE implementation.

Okay What is it? The JRE consists of a bootstrap library and a bunch of system, language and util libraries. There may be inter dependencies in these libraries. Making the smallest possible JRE that can start on itself is the Java Kernel. After You get java kernel, Consider that a java program is asking for some dependencies, The Java Kernel *downloads* it and loads in the program for …

Ganymede is here

Today marks a new episode for Eclipse. I talked about provisioning, and effective plugin mechnaism using osgi earlier. p2 and scores of features are now officially out. My intersts is much in the Eclipse Communication framework. However, this may be a quite entrance for ECF in Ganymede release as much of the default provider is not very impressive. The UI is not state of art, and LOUD cry far from multi-protol clients like pidgin (which is my favorite client). But What is worth giving a look is its Collaboration framework. New and innovative features include Collaborative code review and development.

Nevertheless, Ganymede is much more impressive, maintainable and *loveable* :) Download today!

Dr Dobbs - July 2008

This month's Dobbs has an interesting article on lock free queues. Basically, The philosophy is : A pop and an insert should not be race-condition-ing each other. Most Queue implementations would lock the underlying data store (list or array) and hence causing the race between get() and put(). The article goes on to define how you can make your high contention programs less contending, by simply reducing the lock range. Its an interesting read. The article used C++ for examples. I was keen on a Java implementation.

Java 5 introduced a BlockingQueue interface. The default implementations provided, viz. ArrayBlockingQueue, DelayQueue, LinkedBlockingDeque, LinkedBlockingQueue, PriorityBlockingQueue, SynchronousQueue. But they dont seem to be lock free, are they? OR do we see another implementation coming in JDK 7?

There are other articles.. Read here..

Cisco AnyConnect Client on Ubuntu fails on server certificate

I have vpnaccess to my work. I have been on Ubuntu after my upgrade to Hardy. But I have to go back to vista only for vpn. If I am able to connect to vpn in Ubuntu, There is hardly any reason to switch to windoze.

First of all, I was able to install AnyConnect client using the webinstaller the same way I would in vista. But only to find an error after I run the client.

then when you click ok.. it would go to..

and quit on me.

I realised the client needs a vpn agent deamon. I checked the folder where it installed and started it manually (I guess the install script failed to put in init.rd or something.)
But it doesnot solve the problem. I still get a certificate error. And no.. This is not related to the host, as I can very well connect to the same host in Vista.

I am looking up to my IT guys. Lets see what they come up with.

GIT Tutorial (s) - Move to Git today!

Last week I wrote about Git, Today, I installed git on my ubuntu. its fairly simple

sudo apt-get install git git-core

And then, since I am from SVN, I could directly use this svn to git tutorial. CVS users should also be able to comprehend this as it is not much different from SVN.

Git is, for now, a CLI user's paradise. There is an eclipse plugin (in its snail pace development), which ironically needs a hell lot of process to get to install. But if you are like me, like more cli, get gitting© !! ;)

ManagedConnection has no connection handle - ORA-02396: exceeded maximum idle time

If there's not any endgame, we're in quicksand. We take one more step, and we're still there, and there's no way out. - Richard ShelbyWe've had yet another outage this week. We were exceeding connection idle time limit in Oracle. with almost 270 connections blocked by the application just waiting idly. There was something that was holding up the connections, so we rebounded the server. We thought that was an off shoot. However this repeated on another instance. Around 90 minutes into this blocked state, we got this stack trace.

org.springframework.jdbc.UncategorizedSQLException: Hibernate operation: could not inspect JDBC autocommit mode; uncategorized SQLException for SQL [???]; SQL state [null]; error code [0]; Connection handle is not currently associated with a ManagedConnection; nested exception is java.sql.SQLException: Connection handle is not currently associated with a ManagedConnection

[org.hibernate.util.JDBCExceptionReporter] ORA-02396: exceeded maximum …

CVS log Examples - How to get a change log

Recently our team has been committing a lot of files into CVS. We had three branches and were committing files based on certain rules of critical-ness of the commit. After two weeks of such committing, we merged all files to one branch. And then we were asked to give a simple change log for the two weeks. Coming from a strong SVN background, It wasn't easy for me to get a command for this and I have been searching Google, and could not find it. I guess soon we are going to get GITtting, But for now, and for people still adamant to get out of CVS. Here are some samples.

To show the headers of files created after October 1, 2005 and before October 3, 2005:
cvs log -S -d "2005/10/1<2005/10/3"

To show the headers of files in the current directory created after October 1, 2005 through the present time:
cvs log -S -l -d "2005/10/1<now"

Commits by a user with username after a date
cvs log -wusername -S -N -d "<1 Apr 2005"

Note: The quotes and the spacing!

Static Variables: The wild goose chase ends here.

(Continued from yesterday..)

So we dint know what was copying the instance attributes to other instances. If it was not the Batch Job, There is definitely a non thread safe code that's doing it. But with so many threads, how easy is it to track down the cause. A wild card search for static would result in a lot of static variables in code.

Thank fully, there was a small market tracking method. This method profiled all the requests. And the data collected was stored in DB. so we were able to look at the requests that were *possibly* causing this. From there it was only a matter of debugging the code.

Unfortunately, We didn't find anything statically referring in our code. but we soon realised it was happening in a (our own) library module that employed its own threading pattern. And there was a STATIC transactional variable. The rest of the story is imaginable. Remove the static reference rebuild the lib and deploy it.

But there are important lessons to be learnt here.

Of all the…

Static Variables: Grave Danger

I lost the whole last week on a very small issue. Issue of a kind that would be considered very silly if looked at later. Static variables for holding a Transactional object. This is probably a very naaive concept in Java (or any other language with statics). But mistakes are mistakes. We learn from them everyday. This time, I leart from some one else's. Not the static concept itself, but the sleepless nights it may drive you into for no reason.

The issue started last monday. We were seeing transactional attributes of an object replicated in other objects in the database. An application that stood well in multiple regression tests, load tests, stress tests, failed dramatically in production. To add to confusion, this was happenning exactly at a time where we had a batch job running, a lot of users logging in (of the order 50 logins/ sec), and most of these first time users.

To narrow down our variables, we stopped the batch job. that was in our control. Still There logins, a lot of…

Ubuntu on!! But no Sound!

finally, I installed Ubuntu 8.04. This blog is exclusively from Ubuntu..

My Lenovo Y410 still doesnot have sound, but I could redo my steps for Gutsy. However, The GL issues have been taken care of Desktop Effects work out of box.

I am going to setup GAE environment and JEE on ubuntu and roll!!

Acegi Security - fails to process login with a landing page having dynamic jsp:include

I spent 10 mins in vain to aptly Title this post. but I still dont think I did justice.

While working with Acegi, I discovered a problem in a srange use case.

this post assumes intermediate-advanced level knowledge of Acegi

Acegi has a SecurityContextHolderAwareRequestFilter that filters requests accessing secure pages when SecurityContextHolder doesnot have a securityToken yet. So if user accesses /root/secure/resource , and he is not yet logged in, the request is redirected to /login (defined in AuthenticationProcessingFilterEntryPoint)

now, The request uri along with params if any are wrapped into SavedRequestWrapper, so it can be used to redirected to once the login is successful.

The SavedRequestWrapper implments HttpServletRequest so a getParam on this will return the params from /login request first and then /root/secure/resource after the redirect.

This is simple so far. But when the /root/secure/resource has a jsp:include page="/root/secure/resource2" things get compli…

SarathOnline Version History

[Page always Updated, Last: May 2010]

Sep 2010 v6.1 - Site running on a custom simple MVC framework is now live. Also includes Dynamic Resources - images and jscss files. These are now served from BigTable datastore.

Apr 2010 v6 (small v) - Back down to Plain old java. Wrote own non-reflective Java mvc framework to mimic spring mvc. Objectify for Data access. Released in May. released only as beta.

2009 - 2010 V5 discontinued attempt - Spring. App engine cold start up times better, 12 sec - but still a worry. Best optimized configuration, with minimal libraries still around 8 secs.

Aug 2009 V4 discontinued attempt - Grails. Tried in vain. App engine cold start up times as much as 30 sec (really awful). Fall back to python v3.1. Trying Spring 2.5.2. Plans to upgrade to 3.

2009 V3.1 Began the year with Ajax (Google API) blog. Quickly followed by Django. A big reason was there was an application at work using grails. Cought up grails, rails, and django frameworks. So this minor release is to…

Data Majestic. Scalability thirsty Apps.

I have been interested on scalability of Humongous apps recently. Google declared the first ever free real time stock quotes provision today. So Tomorrow morning, If you are on Google Finance, You are not watching the 15-20 minute delayed results.

For an average Joe, this might be just another thing google can do. But for Technology enthusiasts, This is a much interesting step. Just give you an idea, a few days back Facebook opened up its chat feature to its ~70 million strong member base. Google does a similar feat with its Chat integration for its, I don't even know how many, million users. IMs are the least of issues. Presence Notification packets, Security, Keeping so many connections open, memory to handle all these are of highest consideration. It would be interesting how Google will explain feed polling from NASDAQ and delivery and still keep it realtime for Gigillian hits gets every day. What is even harder to imagine is how an open webapp(even availabl…

Support FireFox. Pledge your Download

Make History. Be a part of a record.

I registered
Download Day 2008
Thanks for pledging to help Firefox

Thanks for pledging and joining our effort to set a Guinness World Record for the most software downloads in 24 hours. Don't forget to tell your friends, family and colleagues to pledge to download Firefox 3 during Download Day!Will you. Go here.

Todays Dilbert

A Good friend and collegue got me caught up with Dilbert Strip. Now that is my dont-miss read in my google reader. I hook you up with today's dilbert.

You can subscribe to Dilberts strip here