Archive for June 2007

dabbling in the dark arts

June 21, 2007

Ever tried to get deep into performance tuning with Hibernate? It is not a well traveled path I am finding. In general, I think Hibernate has excellent documentation but recently I’ve been doing some work in performance tuning a highly transactional application and I’ve been struggling to find useful resources. Here are some areas I’ve found difficult to find documentation.

  • turn on logging for the Oracle thin JDBC driver. Much of Oracle’s documentation is outdated and it refers to deprecated methods on the driver.
  • ehcache is a bit difficult to obtain statistics from if you ask me. I haven’t been successful in getting ehcache installed into JConsole yet although the documentation makes it appear simple enough.
  • Hibernate also generates statistics and this is helpful but getting cache statistics on the second level cache can prove problematic

Anyhow, I’ll have future blog entries when the above issues I am having are resolved. Where are Professors Lupin or Snape when I need them?

my Mac and PC laptops

June 12, 2007

I have two laptops. I have an HP nc8230 and a MacBook Pro core duo. Both machines have 2 GB of RAM and perform pretty much the same. The obvious difference, of course, is that one runs Mac and one runs Windows. No surprise. The PC laptop has one small glitch that really bugs me and stands as a testament to why I’d prefer to use the Mac, given the choice: the volume controls.

For some reason the volume buttons on the PC laptop just stop working over time in a Windows session. Who knows why but after a period of time they no longer function. This seems par for the course in Windows. Things stop working now and then.

This isn’t to be expected on a Mac. I can’t think of the last time I was truly let down by hardware not working on my Mac due to some sort of software problem.

thoughts on Flash Remoting

June 7, 2007

I have been doing some work building a backend to support a Flash client. The backend provides a set of services for the UI front end like registration, login validation, and generally just persisting state to the database.

Early on we made an attempt to write the communication between the front end and the backend with a web service using Apache Axis. We were halted with many strange errors and then came across this (obscure IMO) technote from Adobe. After this discovering we switched to using Flash Remoting for communcation to the server.

Here are some things that were learned.

  • Remoting puts some burden on the Flash developer to syntactically mimic the complete Java class structure that is being returned. This can be tedious although there are some open source tools for writing out ActionScript based on consuming Java classes.
  • Passing back Hibernate-style POJOs that contain back references can be problematic. The Adobe Remoting servlet can run into stack overflow as it tries to serialize/deserialze circular references.
  • Remoting is fast, faster than web services. I have no data to support this but Adobe may have some someplace.
  • Remoting is easy to debug at least on the Java side. The servlet provides incredibly verbose logging so it is straightforward to look at what is being passed to/from the client.

In general, one big design decision should involve decoupling objects passed back to the client versus objects used to represent database persistence. Maybe this is obvious but I can tellĀ  you it is easy to get sucked into returning objects that are paired with the data model.