I've been working with Compass on a few projects based either on Grails and Spring (Grails features Spring under the covers). Recently, I needed to incorporate Compass into a project based on the Glassfish platform.
The actual implementation was a little trickier than expected, but the final result was worth the effort. I've blogged about my experience, providing both a synopsis of the problems encountered as well as fully coded classes to get you started.
I'm not 100% happy with the result, and in my gut I know there's a more elegant solution: I used a Singleton to be called from within a BMT configured session facade for initialization.
If you're in the same position, and need some assistance, this article will get you to a working system. On the other hand, if you've dealt with this issue before, and have some advice, I'd be very interested to hear from you.
View the article: Glassfish JPA and Compass
Thursday, May 17, 2007
Glassfish, JPA, and Compass
Compass provides a powerful bridge between ORMs and the Apache Foundation's Lucene project. Supporting both XML descriptors and Java 5 annotations, Compass makes quick work of creating powerful indexes over your application data domain.
As a fan of both Toplink and Glassfish, I was excited to integrate Compass into the applications I design, but soon ran into difficulty. I've found a work around to get Compass working in a Glassfish JPA environment that is easy, somewhat elegant, but a bit of a hack.
I've included code samples, as well as a description of the issues faced at Glassfish & Compass.
I've taken a Singleton approach, with some caveats. If you have had success with Compass, JPA, and Glassfish (without Spring!), this developer would be very interested in your experiences.
As a fan of both Toplink and Glassfish, I was excited to integrate Compass into the applications I design, but soon ran into difficulty. I've found a work around to get Compass working in a Glassfish JPA environment that is easy, somewhat elegant, but a bit of a hack.
I've included code samples, as well as a description of the issues faced at Glassfish & Compass.
I've taken a Singleton approach, with some caveats. If you have had success with Compass, JPA, and Glassfish (without Spring!), this developer would be very interested in your experiences.
Spring Live 1.5 released
Matt Raible, in "Spring Live 1.5 Released," notes that the 6th edition of Spring Live was released last week. This release contains a new chapter on Advanced Form Processing, as well as Spring 1.2 updates.
It can be downloaded from SourceBeat; the release notes are also online.
It can be downloaded from SourceBeat; the release notes are also online.
Alex Vasseur - Opt-out AOP: good or evil?
Alex Vasseur, in "Opt-out AOP: good or evil?," describes the -Xreweavable option in AspectJ. One of the consequences of this option is that it's "fairly easy to implement an opt-out AOP engine that simply restores the state prior to weaving, and thus kicks out all the aspects from the application!"
Billy Newport: "End of the road for invasive middleware?"
Billy Newport has blogged in "End of the road for invasive middleware?" that add-in components like Hibernate for persistence or Coherence for caching are attractive for consumers because they're not invasive - meaning that users can take advantage of the products without waiting for a release cycle of an application server.
Floyd Marinescu: "A brief history of EJB"
Floyd Marinescu, in "A brief history of EJB," has given us a discussion point on the history and placement (and success) of EJB in the Java space. There has been some dissent, including this rebuttal by Ted Neward, in which Ted refers to Floyd's history as being "revisionist."
John Smart: "An offshore development war story"
John Ferguson Smart has documented the problems and results of a project that used an offshore development team in "An offshore development war story": what went wrong, what corrections were used, and what lessons might be learned.
Subscribe to:
Posts (Atom)