Apache MyFaces Orchestra

JSF-Spring-Hibernate is a popular formula these days but the inconsistency between the view layer and persistence layer can be a pain in the ass. A real life example is my previous project where we’ve used OpenSessionInViewFilter of Spring which basically binds a session to a request by a filter. Then the developers in the team started to get these damn LazyInitializationException or NonUniqueObjectException errors in workflow scenarios, the reason was simple. In a request you load a persistent object and put it in somewhere like HttpSession or JSF ViewState where you can get it in further requests. The thing is; accessing an uninitialized lazy object property in another request later will cause lazy exceptions. Workarounds can be doing Session.merge() and bind the detached object to the current request but trying to maintain the synchronization of the object in each request does not sound a good idea. The real solution would be using long persistence contexts.

Apache MyFaces Orchestra is a subproject of Apache MyFaces family and tries to solve this problem with the view layer and persistence layer. It has a simple conversation api that can be used in workflow scenarios. The backing beans are not managed by JSF but spring so it can use aop tricks and custom scope functionality(JSF 2.0 will have these too hopefully).

After you read this, you’ll probably compare it with Seam, well Seam tries to solve the same problem too but also adds many more goodies to your application. If you’re using Spring I’d suggest trying Orchestra to take care of your view-persistence layer problems in workflow scenarios, on the other hand if you’ve preferred EJB3 over spring, Seam can be handy too.

Apache MyFaces Orchestra Links
Home Page



2 Responses to Apache MyFaces Orchestra

  1. Mitch says:

    I have a simple question:
    Is it possible (without having to code addional classes) to use Hibernate+Orchestra+Spring+MyFaces with Java 1.4?

    If yes, can anyone provide a working configuration? I put much hope in orchestra, but I couldn’t get it to work.

  2. Pingback: Apache MyFaces Orchestra « Cagatay Civici’s Weblog

%d bloggers like this: