Coordination between portlets is a very common requirement. An example of information sharing between portlets can be a weather portlet displaying the weather information of a city and a map portlet displaying the location of the city. Since, both the portlets would be using the same zip code for a user, there should be mechanism provided by the portlal containers to allow portlets to share the zip code.
Prior to JSR 286, the support for inter portlet communication was rather minimal and information sharing between different portlets was accompalished primarily using application scoped session objects or vendor specific APIs. Both of above methods were rather problematic as in the former maintaining the uniqueness of the session attribute over a complex aaplication was a concern and in the later portability of the portlet was hampered. In order to provide coordination between portlets the Java Portlet Specification v2.0 (JSR 286) introduces the following mechanisms:
Let’s have a look how to use the above features.
(more…)
Tags: JSR 286, portlets, websphere, websphere portal
Filed under General | 44 Comments »
SeamTest is a class we extend for the tests we write in our Seam application. It provides the seam environment in tests something analogous to WicketTester in Wicket Application.
I want to share some information on setting the property of Session bean, i came to know while using the SeamTest.
(more…)
Tags: Seam
Filed under Java, Testing | No Comments »
Logging should be simple and straightforward. It is an essential part of everyday administrative operations and it provides vital information for debugging production incidents. Adequate logging saves time and money. When hosting a number of applications, say 10+, you will want to separate application logs from each other and from platform logs and traces. Logging frameworks like the jdk logger and log4j, cooperating with the j2ee container provide the means to do this, using configuration files. So far, so good.
(more…)
Tags: websphere
Filed under Java, Middleware | 5 Comments »
For the last few weeks I have been covering the implementation patterns I discovered while writing JPA applications. The last two blogs covered saving entities and retrieving entities. But when you’re really through with your entities, I guess you’d want to remove them too.
So that is the subject of this blog.
Just like retrieving an entity, removing an entity is pretty simple. In fact it’s all you need to do is pass the entity to the EntityManager.remove method to remove the entity from the database when the transaction is committed (Of course you’d actually invoke a remove method on your DAO which in turn invokes EntityManager.remote). That’s all there is to it. Usually. Because when you’re using associations (be they bidirectional or not) things get more interesting.
(more…)
Tags: Hibernate, JPA, JPA implementation patterns
Filed under Java, JPA, JPA Implementation Patterns | 21 Comments »
San Francisco 31 March – 3 April: Web 2.0 Expo brought together people with diverse professional backgrounds, having interest in Web 2.0, at Mascone Centre in San Francisco. San Francisco Bay Area, also known as Silicon Valley boasts of high concentration of information technology companies of all sizes ranging from biggies like Intel Corporation to numerous start ups trying to make it big.
(more…)
Hibernate is a sophisticated ORM framework, that will manage the state of your persistent data for you. Handing over the important but difficult task of managing persistent state of your application to a framework has numerous advantages, but one of the disadvantages is that you sort of lose control over what happens where and when. One example of this is the dirty checking feature that Hibernate provides. By doing dirty checking, Hibernate determines what data needs to be updated in your database. In many cases, this feature is quite useful and will work without any issues, but sometimes you might find that Hibernate decides to update something that you did not expect. Finding out why his happened can be a rather difficult task.
(more…)
Tags: dirty checking, Hibernate, StaleObjectStateException, versioning
Filed under General | 9 Comments »
Last week I talked about how to save an entity. And once we’ve saved an entity we’d also like to retrieve it. Compared to managing bidirectional associations or saving entities, retrieving entities is actually rather simple. So simple I doubted whether there would be much point in writing this blog
. However we did use a few nice patterns when writing code for this. And I’m interested to hear what patterns you use to retrieve entities. So here is the next instalment in the series on JPA implementation patterns.
Basically, there are two ways to retrieve an entity with JPA:
Tags: JPA, JPA implementation patterns
Filed under Java, JPA, JPA Implementation Patterns | 16 Comments »
On the 15th of April the NLJUG (Dutch Java User group) will be holding their J-Spring conference. Four Xebians will be presenting. Every week we’ll be providing a sneak preview on the podcast of one of those presentations.
The second sneak peek is about The Java Persistence API – How do i build a real application by Vincent Partington.
The preview is in Dutch, a full interview in english will be coming in about 4 weeks.
You can find more information here or read Vincent’s JPA blog series.
Vincent’s presentation is from 14.25 to 15.15
So head on over to the show page or subscribe to our podcast!
Tags: JPA
Filed under Podcast | 1 Comment »
The introduction of Enums in Java 5 finally provided a powerful (and slightly magical) way of modelling fixed sets. One can have too much of a good thing, however, and in some situations an enum is a little too fixed to be convenient.
Here, I’d like to discuss a pattern I’ll call – for want of a better name – the dynamic enum, that addresses this issue. (more…)