SourceForge.net Logo
Main Overview Wiki Issues Forum Build Fisheye

Welcome, Guest
Guest Settings
Help

Compass Support Forums » Compass » Compass Users

Thread: Duplicate Index Entries with TopLink JPA

This question is answered. Helpful answers available: 2. Correct answers available: 1.


Permlink Replies: 12 - Pages: 1 - Last Post: Dec 3, 2011 4:40 AM Last Post By: longchamp
chicoman25

Posts: 29
Registered: 12/7/06
Duplicate Index Entries with TopLink JPA
Posted: Dec 28, 2006 3:41 PM
 
  Click to reply to this thread Reply
We are trying to use Compass with TopLink Jpa and are receiving duplicate entries after a LifeCycleEvent is triggered.

The compass debug is at the end of the thread. Here is a brief summary of what we are doing. We have a simple class:

class MediaStream
{
@Basic() // jpa
@SearchableProperty
private String title;
}

Our Unit test creates a new MediaStream and persists it in setup. The unit test is trying to execute the following query (via our service tier)
.... // Transaction stuff
CompassQueryBuilder qBuilder = session.queryBuilder();
CompassMultiPropertyQueryStringBuilder propBuilder =
qBuilder.multiPropertyQueryString( query.getSearch() ).add("title");

CompassDetachedHits hits = propBuilder.toQuery().hits().detach();
...// clean up transaction

When executed this call returns 2 compass hits. Using LUKE to check the index there are also 2 Documents. When I query the database there is only 1 record in the MediaStream table.

mysql> select count(*) from dev.MEDIASTREAM;
+----------+
| count(*) |
+----------+
| 1 |
+----------+
1 row in set (0.02 sec)

Is there something obvious that I'm doing wrong or is there an issue with the TopLink JPA LifeCycleEventListener?

Debug output:

[Thu 14:35:36] [t] DEBUG dao.impl.FmDAOBase - persisting object Id: [null] Title: [My Title]
[Thu 14:35:36] [t] DEBUG jpa.lifecycle.TopLinkEssentialsJpaEntityLifecycleInjector$TopLinkEssentialsEventListener - Creating [Id: [1] Title: [My Title]]
[Thu 14:35:36] [t] DEBUG core.transaction.LocalTransaction - Starting a new local transcation on thread [main] Compass [17103907] Session [11019994] with isolation [null]
[Thu 14:35:36] [t] DEBUG lucene.engine.LuceneSearchEngine - RESOURCE CREATE {MediaStream} [stored/uncompressed,indexed<alias:MediaStream>],[stored/uncompressed,indexed<$/MediaStream/id:1>],[stored/uncompressed,indexed,tokenized<title:My Title>],[indexed,tokenized<all:alias,title>]
[Thu 14:35:36] [t] DEBUG core.transaction.LocalTransaction - Committing local transaction on thread [main] Compass [17103907] Session [11019994]
[Thu 14:35:36] [t] DEBUG jpa.lifecycle.TopLinkEssentialsJpaEntityLifecycleInjector$TopLinkEssentialsEventListener - Creating [Id: [1] Title: [My Title]]
[Thu 14:35:36] [t] DEBUG core.transaction.LocalTransaction - Starting a new local transcation on thread [main] Compass [30023838] Session [13076987] with isolation [null]
[Thu 14:35:36] [t] DEBUG lucene.engine.LuceneSearchEngine - RESOURCE CREATE {MediaStream} [stored/uncompressed,indexed<alias:MediaStream>],[stored/uncompressed,indexed<$/MediaStream/id:1>],[stored/uncompressed,indexed,tokenized<title:My Title>],[indexed,tokenized<all:alias,title>]
[Thu 14:35:36] [t] DEBUG core.transaction.LocalTransaction - Committing local transaction on thread [main] Compass [30023838] Session [13076987]
[Thu 14:35:36] [t] DEBUG core.transaction.LocalTransaction - Starting a new local transcation on thread [main] Compass [17103907] Session [15947055] with isolation [null]
[Thu 14:35:36] [t] DEBUG lucene.engine.LuceneSearchEngine - RESOURCE QUERY [(title:my) (title:title)] HITS [2]
[Thu 14:35:36] [t] DEBUG core.transaction.LocalTransaction - Committing local transaction on thread [main] Compass [17103907] Session [15947055]
Shay Banon

Posts: 4,028
Registered: 9/6/05
Re: Duplicate Index Entries with TopLink JPA
Posted: Dec 28, 2006 3:47 PM   in response to: chicoman25 in response to: chicoman25
 
  Click to reply to this thread Reply
It does seem from the debug output that two objects are getting created in the index. Can you post your JPA code before your search that stores this classes?
chicoman25

Posts: 29
Registered: 12/7/06
Re: Duplicate Index Entries with TopLink JPA
Posted: Dec 28, 2006 4:23 PM   in response to: Shay Banon in response to: Shay Banon
 
  Click to reply to this thread Reply
Shay,

Thanks for your quick response. It's typical that after hours of looking at this and finally posting that I'd figure out it's my own dumb mistake.

I was creating an instance of our own CompassManager and Spring was also creating an instance at startup. I won't go into the details of the CompassManager b/c it's irrelevant to the post but basically it's meant as a wrapper to instantiate compass with or w/o spring. I forgot Spring was creating one too so there were really 2 instances of the JpaGpsDevice running listening for events.

Nice work on this framework and the documentation!
Shay Banon

Posts: 4,028
Registered: 9/6/05
Re: Duplicate Index Entries with TopLink JPA
Posted: Dec 28, 2006 5:38 PM   in response to: chicoman25 in response to: chicoman25
 
  Click to reply to this thread Reply
No problemo, glad that it works. Out of curiosity, you are the first one I heard using TopLink (at least from the forum post), I wonder why you chose it over Hibernate (which is what most of our use choose)?
chicoman25

Posts: 29
Registered: 12/7/06
Re: Duplicate Index Entries with TopLink JPA
Posted: Dec 28, 2006 7:47 PM   in response to: Shay Banon in response to: Shay Banon
 
  Click to reply to this thread Reply
As far as I know it's because of the licensing. Toplink is CDDL where Hibernate is GPL. I'm not into the legal stuff but apparently the CDDL allows you to retain control of your intellectual property when you distribute the product.
msolnit

Posts: 108
Registered: 10/12/06
Re: Duplicate Index Entries with TopLink JPA
Posted: Jan 4, 2007 1:42 PM   in response to: chicoman25 in response to: chicoman25
 
  Click to reply to this thread Reply
Hi chicoman25. Not to get into a licensing discussion, but Hibernate is actually distributed under the LGPL license (which is a bit more liberal), not GPL.

-- Matt
asd

Posts: 70
Registered: 10/12/11
Re: Duplicate Index Entries with TopLink JPA
Posted: Oct 12, 2011 10:30 PM   in response to: chicoman25 in response to: chicoman25
 
  Click to reply to this thread Reply
"The smallville dvd firm stargate dvd has the 4400 dvd understanding king of queens dvd in a the hills dvd manager the office dvd of tour the unit dvd subdivisions the oc dvd comparable the shield dvd to our the oz dvd own, wild wild west dvd so it the west wing dvd is a west wing dvd good fit the x files dvd with our the wire dvd business. true blood dvd Its two and a half men dvd record weeds dvd in bringing will and grace dvd ahead xena dvd trade beatles remastered dvd missions the beatles dvds was of beatles remastered dvd actual http://boxsetszone.com onvolvement because we have been more and more concentrating in this environs and the acquisition fortifies our offer," he added.ABC News has brought frontwards a instance of the diagrams, overlaying the in the past and later diagrams for each precise environs for a more instantaneous representation of the quake and tsunami's devastating effects.
pylxwzhj

Posts: 719
Registered: 10/15/11
Re: Duplicate Index Entries with TopLink JPA
Posted: Nov 9, 2011 3:07 AM   in response to: chicoman25 in response to: chicoman25
 
  Click to reply to this thread Reply
Despite the anger

Coach Outlet

at Washington, voters

Chanel Bags

did not appear to be in a throw-the-bums-out frame

Coach Outlet

of mind at the city and state levels.

Coach Outlet

In Philadelphia, Mayor Michael Nutter,

Coach Outlet

a Democrat, won re-election, as did Mayor Greg Ballard,

LV Outlet

a Republican, in Indianapolis

Louis Vuitton

and Mayor Stephanie Rawlings-Blake,

Coach Outlet

a Democrat, in Baltimore. In Phoenix,

Chanel Handbags

Greg Stanton, a Democrat, was

Coach Factory Store

the winner while in San Francisco, Edwin M. Lee, the interim mayor,
lvzeng

Posts: 268
Registered: 11/13/11
louis vuitton
Posted: Nov 13, 2011 8:10 PM   in response to: chicoman25 in response to: chicoman25
 
  Click to reply to this thread Reply
Owning

louis vuitton bags

of their own has been the dreams of many fad-seeking people for a quite long time.
You need not worry about the quality of the

coach outlet store online

for sale now. The Coach brand is famous for the perfect products.
I am so confused that I don,t even know where to buy the

louis vuitton

Handbags. Because I can prefer to chose the fashionable design, favorable price, top service .

coach outlet store online

with fashion style and top quality succeed. In any occasions they are very suitable and appropriate for its precise and rich design.
They're not chosen, so one of these ideal for you.For more flexibleness a lot more like these, there are lots of discount 'shoulder' variations outlet

louis vuitton bags

.

hermes birkin

is an Austrian success story par excellence. At the end of the 19th century Daniel Swarovski founded a company with the aim to cut crystals automatically.

coach outlet store

vision system is a visual enjoy, is a visual art. The particular design has been integrated function and the element of elegancy, then show you an exquisite and excellent product.
jenny

Posts: 271
Registered: 11/13/11
coach outlet store online
Posted: Nov 13, 2011 8:17 PM   in response to: chicoman25 in response to: chicoman25
 
  Click to reply to this thread Reply
The

coach factory outlet

has been in business for many years. You can log in to find more information about its products and services.
At

louis vuitton sale

,you will find Louis Vuitton Vernis Wallet uses Vernis leather lining instead of classic Monogram canvas, meanwhile creates another classic style with fashion.
Here's your new way to look sophisticated styles. Carry the hot

coach outlet store online

of this summer and be the true trendsetter!
Several days ago, I chose one style of

hermes scarf

from the Swarovski Outlets, which has won good reputation from many customers.
It is a symbol regarding position not to mention nature, Here I would like to launch a excellent bags pertaining to business men, which may be

louis vuitton online

Cupertino M56398.
Almost everyone has identified effectively about this, below, among the best to make sure you will get much more information about

coach outlet

.
coach8outlet

Posts: 282
Registered: 11/13/11
Re: Duplicate Index Entries with TopLink JPA
Posted: Nov 14, 2011 1:52 AM   in response to: chicoman25 in response to: chicoman25
 
  Click to reply to this thread Reply

louis vuitton handbags

enjoy high reputation all over the world. They are designed for hand, elbow and shoulder carry thanks to comfortable flat leather handles.
If you have been to the mall lately and browsed

coach outlet

you may find that a high price tag goes along with just about everything in the mall.
This client-oriented and faith-rooted store aims at providing the best LV goods and services, such as top-class

louis vuitton uk

and free shipping.
Turn your attention to such discount coach sneakers for women from Coach Outlet Store online, you will find something unique and special of such authentic coach for sale at coach factory outlet store online.

louis vuitton outlet

online just like a person who want to show himself in front of other people, because he is confident enough, he can attain the respect of other people.
Bezel-set

hermes birkin bag

are showcased in all their brilliance in the chic and timeless design of this tennis bracelet. Rhodium-plated metal bracelet with foldover clasp.
The

coach outlet store online

are utilized for formal event in company area that will display your excellent taste.Not only does a briefcase make is easier to carry things.
tonnyben

Posts: 270
Registered: 11/14/11
Re: Spring inheritance, lazy-init with Compass namespace?
Posted: Nov 14, 2011 2:42 AM   in response to: chicoman25 in response to: chicoman25
 
  Click to reply to this thread Reply

coach factory outlet online

featured with stylish leather bags and signature materials, and carry this bag, it can designate people seem to be captivatingly feminine and good-looking. Why not to buy one when it is at an affordable price?
The products that

louis vuitton outlet

is countless, such as: purses, bags, handbags, shoes, belt. Even the same kind of product includes the products for women, the products for men, for summer-day use, for winter-day use.So, it is probably far beyond your imagination.
As a perfect combination of classic and modern fashion,

coach outlet online

can show the customers'unique personality.

hermes birkin

is your premier online shop for a wide range of quality Swarovski Crystal products such as Swarovski Crystals earring, Jewelry, Bracelet etc.
You could find them in desirable quality and price. If you don't mind high class louis vuitton replica bags, have a good time at

louis vuitton outlet online

.

coach purses

tend to be among finest style strikes associated with these days! They're the standing image that many ladies possess, or even, intend on obtaining.
longchamp

Posts: 272
Registered: 12/1/11
Longchamp
Posted: Dec 3, 2011 4:40 AM   in response to: chicoman25 in response to: chicoman25
 
  Click to reply to this thread Reply
longchamp, il se révèle être and also vital de l'histoire des graphic designers français de cuir, bagages et maroquinerie Longchamp strain devenir l'un des meilleurs quartiers de la marque, et devenir united nations symbole de la haute société. Aujourd'hui, la marque your not seulement la perception limitée de Longchamp et de vendre des reports sac longchamp durante cuir haut de gamme et des bagages, mais à s'impliquer dans la style, accessoires, chaussures, sacs, bijoux, montres, des médias, du vin et d'autres régions du géant des indicateurs de tendance.www.sacslongchamp-france.org
Legend
Guru: 2001 + pts
Expert: 501 - 2000 pts
Super-star: 101 - 500 pts
Assistant: 51 - 100 pts
Participant: 0 - 50 pts
Helpful Answer (5 pts)
Correct Answer (10 pts)

Point your RSS reader here for a feed of the latest messages in all forums