Archive for September, 2010

Use binary diff tools like xdelta, bsdiff/bspatch to transfer large files

Tags: , , ,

What do you do if you have to frequently transfer large files over a slow connection as part of your work? Perhaps new builds produced by your corporate build server need to be deployed at a different location for the QA team? I have seen such scenarios causing huge amounts of wasted time for multiple [...]

Continue reading » 4 Comments

Eclipse tip: Add a short cut key to Skip All Breakpoints

Tags: ,

Eclipse doesn’t have a short cut key bound by default to the ‘Skip all breakpoints’ functionality. Here is how you can set one. While you are at it, you probably want to define a few more shortcuts to functionality you use frequently. In Eclipse, go to Window > Preferences > Type in ‘Keys’ in the [...]

Continue reading » 3 Comments

/dev/random vs /dev/urandom

Tags: , , ,

If you want random data in a Linux/Unix type OS, the standard way to do so is to use /dev/random or /dev/urandom. These devices are special files. They can be read like normal files and the read data is generated via multiple sources of entropy in the system which provide the randomness. /dev/random will block [...]

Continue reading » No comments

HibernateException – A collection with cascade=”all-delete-orphan” was no longer referenced by the owning entity instance

Tags: , , ,

The logged exception org.hibernate.HibernateException – “A collection with cascade=”all-delete-orphan” was no longer referenced by the owning entity instance: com.onkarjoshi.hibernate.test.Person.children” Your likely problem Looks like you have a Parent entity and a Child entity. The Parent has a collection of Child entities with cascade=”all-delete-orphan”. You are setting a new collection via the setter thus leaving the [...]

Continue reading » 19 Comments

Garbage Collection, Reference types and Reachability – Strong, Soft, Weak, Phantom, Unreachable

Tags: , , ,

The Java Virtual Machine has 5 different levels of reachability for an object. Strongly reachable An object is strongly reachable if it can be reached by some thread without traversing any reference objects. A newly-created object is strongly reachable by the thread that created it. This is the reference you know about and use all [...]

Continue reading » 2 Comments

Blocked thread with Read Write Lock due to writer starvation

Tags: , , ,

Here is an interesting and simple example of how you can end up with a locked thread in your application and what you can do to avoid it. Task A – Starts at t = 0. Takes a read lock. Runs for 3 seconds. Scheduled to run every 5 seconds. Task B – Starts at [...]

Continue reading » No comments