~pperalta

Thoughts on software development and other stuff

Talks by Jurgen

without comments

Jurgen Hoeller gave a talk about 10 Cool Spring Features You Might Not Be Aware Of. I was somewhat familiar with most of them, especially the native JDBC connection and CLOB functionality, which I’ll talk about more during this session. There were two features that I was not aware of that look interesting for our application.

The first is lazy JDBC connections. This is a feature where a DataSource is wrapped in a DataSource implementation that returns a proxy for getConnection() instead of a real connection. This proxy will only get a real connection when it is needed. The use case for this is declarative transactions (using local transactions, not JTA) where the data that is being requested by the caller is cached. The declarative transaction manager gets a connection, turns off auto commit (although I think this depends on the environment), and starts the transaction. When the service method is done, the connection is committed. However, if the data being returned by the service is in cache, then we have made up to 3 calls to the database that were not needed. In high volume applications this can add up to a lot of overhead, especially depending on the level of isolation configured for the database connection.

The other interesting feature is the Task Executor. This is meant for launching functionality that should be executed asynchronously. They provide several implementations, including ones based on java.util.Timer, the JDK 1.5 concurrent library, and CommonJ WorkManager for WAS and WebLogic. The latter would be required if the application uses EJBs since EJBs can’t launch new threads (or at least they’re not supposed to). If needed, implementations could be provided for other EJB containers such as JBoss, but I suspect that most Spring applications are being deployed as WARs anyway which makes it a moot point.

After the talk I spoke to Jurgen about providing a JMS Invoker for JMS based remoting. I submitted an implementation before realizing that an implementation already existed in the sandbox. However, my solution performs serialization manually and uses BytesMessage instead of ObjectMessage because Tibco has issues serializing primitives. I would be interested in seeing a JMS remoting solution in Spring, and the JIRA issue was marked for Spring 1.3 (which is now Spring 2.0). I do know about the existence of Lingo so I suppose it is possible that this would be the JMS remoting solution instead of rolling it into the main project.

Speaking of Jurgen, he gave the keynote speech after dinner. The topic was “Spring’s Nature,” where he was talking about the characteristics and philosophy of Spring. Some highlights:

  • Spring is very modular, and separation of components is taken very seriously
  • It covers many different areas, but the design is very consistent
  • Some subsystems are so independent that they effectively are libraries
  • Implementation classes are considered part of the public API
  • Many hooks are provided for easy customization

Spring is analogous to an ice floe: has broad coverage but is very shallow. Spring provides integration hooks for many things, but it does not provide anything that already has a good solution (such as ORM). J2EE is more like an iceberg: only a part of it is visible, but there is a lot that is hidden from view.

Written by Patrick Peralta

December 8th, 2005 at 8:53 pm

Posted in Development