MySQL/MariaDB data not available in second application

This is a interesting issue I found using Hibernate. You have 2 independent application both using the same database. What I found that if one application submits a value to the database the second application does not see the updated/new entry. If you use direct SQL on the database the changed/new entry is visible and the same is true if you use the JDBC directly without hibernate.

ThreadPoolExecutor gotcha with unbounded queue

Something I have now seen a few times in projects is people not being aware of how ThreadPoolExecutor works. When creating a ThreadPoolExecutor you have to arguments to set minPoolSize, maxPoolSize, keepAliveTime and workQueue. Now the gotcha is in when the ThreadPoolExecutor creates a new thread for execution especially when using unbounded size Queues. For example when looking at this ThreadPoolExecutor constructor:

Fixing the mouse

I have been using a Evoluent VerticalMouse 4 now for just over a year and have really grow to like it up until a few weeks ago where it would only work when it felt like it. Fiddling around with the cable I realized there was a connection problem in the cable. After doing some searching it seems like a common problem.

Implementing Java Comparable

Implementing the Comparable interface in Java give the object a natural ordering, as in makes it Sortable. The comparable interface only has one method:

Ungit the ultimate tool for git

Ungit is the easiets way to use GIT. It is great tool that visiually represents your repository and completly removes the learning curve with GIT. It uses node.js and is available via npm.

Bluk update GIT master location

The server hosting the GIT repository has moved to an new domain name. Now is very painfull to update manually so here is quick command to find all the GIT config files and replace the old domain name with the new domain name.

Guava LoadingCache invalidate call while loading?

I have a application that needs to pull data from the database do some calculations (This takes a second or two) then returns. I have been using Guava’s LoadingCache to do this. The problem came in when a user makes a change to the source data which in effect invalidates the calculation results. Easy solution just invalidate. But what happens if the data is modified during the calculation process. For example you have 2 threads, Thread 1 calls get on the loading cache then during the Loading process in Thread 1, Thread 2 calls invalidate since the underlying data has changed. Is the data invalidated or is the invalid/stale data stored in the cache?