SourceForge.net Logo
Main Overview Wiki Issues Forum Build Fisheye
Issue Details (XML | Word | Printable)

Key: CMP-812
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Shay Banon
Reporter: Trond Marius Øvstetun
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Compass

TopLinkHelper.getCurrentCompassSession(em) throws ClassCastException running on glassfish

Created: 14/Jan/09 06:26 AM   Updated: 14/Jan/09 09:41 AM
Component/s: Compass::Gps
Affects Version/s: 2.1.0 GA
Fix Version/s: 2.1.2, 2.2.0 M2


 Description  « Hide
TopLinkHelper.getCurrentCompassSession(em).
There is a bug on line 100, the line should be the same as on line 99, using the native extractor to find the actual EM hidden inside the EntityManagerWrapper used by glassfish.
The following code yields a ClassCastException:
final CompassSession searchEngine = TopLinkHelper.getCurrentCompassSession(em);
final CompassHits hits = searchEngine.find(searchQuery);
final int antalltreff = hits.length();


 All   Comments   Change History      Sort Order: Ascending order - Click to sort in descending order
Trond Marius Øvstetun added a comment - 14/Jan/09 06:28 AM
Using
final CompassSession searchEngine = TopLinkHelper.getCompass(em).openSession();
works fine.

Haven't looked through the full source code, might be more places similar in TopLinkHelper?


Shay Banon added a comment - 14/Jan/09 06:50 AM
Hi,

Thanks, I fixed it. The EclipseLinkHelper uses similar code, so it was fixed there as well.


Trond Marius Øvstetun added a comment - 14/Jan/09 08:51 AM
Do you have a release plan ready for version 2.1.2? or 2.2.0-final?
Just wondering when we will be able to use the fix...

Shay Banon added a comment - 14/Jan/09 09:41 AM
I will probably release 2.1.2 in two weeks or so. You can get the nightly build from that will be executed tonight if you want to play with it. (http://wiki.compass-project.org/display/CMPKB/Nightly+Builds)