« Return to Thread: Compass, Lucene and Grails Searchable Plugin
Hi Mike,
Let
me say up front that I don’t know anything about compass – I just
browsed some of their code (I looked at trunk of their svn repo).
So if “org.compass.core.lucene.engine.store.RAMLuceneSearchEngineStore.ramIndexes”
is a root, then this lock snippet should get past that exception:
<named-lock>
<method-expression>* org.compass.core.lucene.engine.store.RAMLuceneSearchEngineStore.*(..)</method-expression>
<lock-level>write</lock-level>
<lock-name>theLockName</lock-name>
</named-lock>
That will apply the named lock to all
methods of that class. In reality, you only need to apply the lock to those
methods that read or write the shared object.
It’s not obvious, but you’ll
also need to <include> that class
<include>
<class-expression>org.compass.core.lucene.engine.store.RAMLuceneSearchEngineStore</class-expression>
</include>
All this said, this approach with named
locks is rather blunt, but it is useful for experimenting.
Hope this helps
-tim
From:
tc-users-bounces@...
[mailto:tc-users-bounces@...] On Behalf Of Mike Brevoort
Sent: Tuesday, January 22, 2008
7:30 AM
To: tc-users@...
Subject: [tc-users] Compass,
Lucene and Grails Searchable Plugin
Hi,
I'm trying to get Terracotta working to cluster my Lucene RAMDirectory index
while using the Compass/Lucene Grails plugin. I've dug into compass to
find that it manages the RAMDirectory objects in this class:
org.compass.core.lucene.engine
.store.RAMLuceneSearchEngineStore and manages each subindex
RAMDirectory in a java.util.HashMap called ramIndexes.
I've been trying to set
org.compass.core.lucene.engine.store.RAMLuceneSearchEngineStore.ramIndexes as a
root in Terracotta (I'm a rookie here!), but no matter what I do I can't get
past the UnlockedSharedObjectException exception. I've tried using coarse
named locks though I'm not sure if I'm setting it up directory. I thought
I'd ask here first...
Is it possible to have this as a root and have Terracotta manage it if the code
around it is not synchronized and the data structure (HashMap) is not
synchronized? If so can you point me to how to configure it? I've
tried already on my own for five hours to get it working but just can't get
past it.
Thanks!
Mike
com.tc.object.tx.UnlockedSharedObjectException:
*******************************************************************************
Attempt to access a shared object outside the scope of a shared lock.
All access to shared objects must be within the scope of one or more shared
locks defined in your Terracotta configurati
on.
Please alter the locks section of your Terracotta configuration so that this
access is auto-locked or protected by a nam
ed lock.
For more information on this issue, please visit our Troubleshooting Guide at:
http://terracotta.org/kit/troubleshooting
Caused by Thread: main in VM(0)
Shared Object Type: java.util.HashMap
*******************************************************************************
« Return to Thread: Compass, Lucene and Grails Searchable Plugin
| Free Forum Powered by Nabble | Forum Help |