Skip to main content

Posts

Showing posts from 2015

Database Leak: getConnection() within Spring Transaction

I recently encountered an issue where one of my teammates was experiencing an issue where an application datasource would periodically become exhausted.  After discussing it a few times, we hypothesized that it was a situation where there was a database connection leak.  It was suspected the leak was within boundaries of some application code with a low call rate.  This would line up with, why the application would run for an extended period and then all of a sudden max out its database connections. By inspecting the logs around the times of the database connection pool becoming exhausted it became pretty clear the potential location of the problematic code. The cause of the issue was not a result of necessarily bad code writing, but more of a case of not knowing how legacy semantics would work within the context of a spring transactional boundary. The semantics of how a call to DataSource.getConnection() behaves within the Spring transaction boundary is probably not entirely evide
Dripping Faucets and Memory Leaks All Java developers will need to deal with memory leaks at some point in their careers.  There are already numerous blog posts on the internet about developers' experiences.  I figured I wold just add another, which discusses the trial and tribulations of my latest ordeal with a leaky faucet. We encountered a situation where a long running application server infrastructure all of sudden started to experience sever unreliability issues.  The application servers were starting to crash numerous times a day.  The application server was Oracle's old OC4J J2EE container, however that is really irrelevant in this case.  The application change would have caused issues on any application server platforms. Initial Pipe Tightening This particular matter was made a little more convoluted by the fact that there are actually multiple applications running in the same container.  One of the applications was a historical memory hungry application which

Upgrading to xCode 6.4

After you upgrade to xCode 6.4 you will notice that the SDK for iOS 7.1 is no longer available. If you still want to be able to build for iOS7 and run a simulator for iOS7 then you will need to do a little bit of manual work. First if you go to Preferences --> Downloads within xCode you should see a component listed for the iOS 7.1 simulator.  Click on the download arrow in order for it to be downloaded and installed. However you will notice that there is no download for the base SDK for 7.1.  You will need to manually install it in order for it to be available to xCode 6.4. You will want to check and confirm what SDKs are actually installed.  You can check by opening a terminal on your MAC and then proceeding to the directory /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs . If you do not see a folder for iPhoneOS7.1.sdk you will want to extract a copy of the SDK into your Xcode SDK directory structure.  You could either attempt to cop

HTML5 Canvas nightmares with JSF

The last couple of days have been one of those 'why is this so difficult' moments. I essentially lost more than a day trying to figure out how to get HTML5 canvases to show up in one of our JSF applications. Here is the background on the stack: JBoss AS 7.2.0 JDK 1.7.x Seam (JSF Framework) v2.2.0 Richfaces v3.3.3 Essentially we wanted to introduce a canvas to our page in order to graphical represent a numeric value and where it falls upon its normal range and possible range of values.   The page was leveraging a <ui:include> in order to display the results section.  It was a common component used among multiple pages and therefore the reason being pulled in via an include.  A richfaces commandLink was being used to initiate an AJAX request that would pull back none, one or many results and re-render the display within a JSF panelGroup.   Canvas Background:  If you look at any of the examples of using HTML5 canvases, you generally will see the definitio

Toad as a plugin for Eclipse

I have been a user of TOAD for multiple years and in the past have used and tried have other database tools. Given the level of familiarity I have with TOAD, I always end up falling back to the use of the product.  Through my career, I have also found that it is the general consensus among developers who are developing for an Oracle backend. It wasn't until recently though that I discovered the TOAD plugin for Eclipse.  I was intrigued and decided to check it out.  One of the main reasons I decided to give it a whirl is, it's always tough to switch between multiple tools during head down development.  And since I have been managing development teams for multiple years, I have heard developer after developer make comments like 'it would be nice if that was built right into Eclipse' (or whatever the editor of choice). I was pretty impressed with how well the plugin worked and it really does have some slick features from a java developer perspective.  As indicated abo

WSO2: Simple Pass through proxy (REST to REST with HTML Reply)

Today I set out on trying to set up a simple passthrough proxy that would allow for a GET request to be made to REST style backend services that replies with HTML content. The proxy services was being set up on WS02 ESB v4.8.0.  I thought this was really going to be as simple as walking though their wizard and setting up a new proxy endpoint that just handed off to the behinds the scene service. It was straight forward to set up the proxy, but then unfortunately when called it just didn't respond. It took quite awhile to figure out what the issues was.  At first I was using the ESB admin console and review the System and Application Logs.  The Application Logs were certainly more useful, but they still truncated stack traces which made it hard to clue in on the real issue. It wasn't until I went and review the logs on the server that I was able to detect the cause.   <wso2_esb_root>/repository/logs/wso2-esb-errors.log 2015-03-19 16:09:43,001 [-] [Pass

Getting Rolling with Cloud Foundry PAAS

Getting familiar with a PAAS environment for even an experience Java developer can be pretty daunting.  First you need to select a PAAS and then you need to navigate through all of the documentation and try to figure out how to get rolling.  The next couple of posts will detail the steps I took to get rolling with Pivotal's http://pivotal.io  Cloud Foundry (Community Edition) http://www.cloudfoundry.org/index.html  PAAS.  You are familiar with what a PAAS actually is, you may want to spend a little bit of time reading up on PAAS before proceeding. Part 1: Connecting To Your Cloud Foundry Instance The first thing I did was install the Spring Tool Suite (STS) v3.6.3-SR1 https://spring.io/tools/sts/all  on my MAC running Yosemite OS X 10.10.  Make sure you download and install the right version for your development system. Note: Also a system requirement for STS 3.6.x was to have at least JDK7 running on your system.  I am currently running Java 8 update 40 on my MAC.  If you do