Entries Tagged 'spring' ↓

Terracotta Tech Talk

I’m developing a Java/Spring web application deployed on JBoss 4.2.2 that makes heavy use of memcached in order to reduce the latency experienced by the user. The user interacts with data that is (unbeknownst to them) in the cache. In order to make changes permanent a message is placed on a queue that is picked up by an MDB. The message is just the key used to access the data in the cache. The MDB takes the data out of the cache and then saves it to the database. This greatly improves the user experience because they do not have to wait for the next page to load while costly database writes occur. So far, so good.

In this case I am unfortunately duplicating data by separating the reads from the writes. The data lives in the Hibernate session used by the read-only app server in order to load the data in the first place. It also has to be loaded in the write-only app server in order for that Hibernate session to work with it, which brings me to the point of this post: Is there any way that I can use Terracotta to pool my Hibernate-managed objects into one pool used by both the read-only and write-only app servers? I think I would like to pool my Hibernate second-level cache. It seems like Terracotta can get the job done.

That said, I’m anxious to explore this topic more when Orion Letizi from Terracotta Tech comes to speak at the Boston Scalability User Group next Wednesday on May 28th. The meeting starts at 6 p.m. at the IBM Innovation Center in Waltham, MA. Of course there will be pizza and soda (sponsored by Terracotta - thank you!) so come to the meeting to have some food and explore what Terracotta can do for your project. All the details, including directions, are on the Boston Scalability User Group web site. Remember, there will be pizza!

Spring Web MVC and the benefits of pagination

Lately I’ve been working on a project that keeps my web bookmarks sync’d across multiple computers and different web browsers. The project is implemented in Java using JBoss 4.2.2, MySQL 5.0 and Spring 2.0. It’s not a very big project right now, only about 40 class files and some small number of configuration files, but the amount of data the application deals with can get fairly large.
Continue reading →

Spring Web MVC lists

I recently came across a blog post describing how *not* to use the Spring Web MVC form tag library. Spring Web MVC is one of those things that has a high learning curve but it pays off big once you get the hang of it. The form tag library is no exception. The original blog poster seems to want to display a list of things the form user can manipulate and then send the changes back to the app server. There are a few different ways we can do this with Spring Web MVC and some JSTL libraries so let’s take a look at the way I prefer to do it. Continue reading →