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 [...]
Archive for September, 2010
Eclipse tip: Add a short cut key to Skip All Breakpoints
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 [...]
/dev/random vs /dev/urandom
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 [...]
HibernateException – A collection with cascade=”all-delete-orphan” was no longer referenced by the owning entity instance
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 [...]
Garbage Collection, Reference types and Reachability – Strong, Soft, Weak, Phantom, Unreachable
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 [...]
Blocked thread with Read Write Lock due to writer starvation
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 [...]
