I'm not sure if you have some abridged code, but like Renato and the
post you reference, I don't see where you are committing the
transaction in your script from the Gremlin console. You need the
final line i added to your script:
confcass = new BaseConfiguration();
confcass.setProperty("storage.backend","cassandra");
confcass.setProperty("storage.hostname","localhost");
confcass.setProperty("port",9160);
confcass.setProperty("storage.keyspace","titan");
g = TitanFactory.open(confcass);
g.createKeyIndex('name', Vertex.class)
g.stopTransaction(SUCCESS)
As far as transactions in rexster go, a request to the standard REST
API is encapsulated within a transaction. So, if you POST a vertex
Rexster will commit that as a transaction.
Stephen
On Wed, Nov 14, 2012 at 5:51 AM, Jean-Armel Luce <
jalu...@gmail.com> wrote:
> Hello,
>
> I am using titan with rexster and Cassandra :
>
> titan 0.1.0
> rexster 2.1.0
> cassandra 1.1.5 (1 single node in my VM)
>
> My rexster.xml file is attached to this mail
>
> Through Gremlin console (gremlin.sh), I have created an index on property
> name:
>
> confcass = new BaseConfiguration();
> confcass.setProperty("storage.backend","cassandra");
> confcass.setProperty("storage.hostname","localhost");
> confcass.setProperty("port",9160);
> confcass.setProperty("storage.keyspace","titan");
> g = TitanFactory.open(confcass);
> g.createKeyIndex('name', Vertex.class)
>
> Then, I have inserted a few vertices using REST requests, such as
>
http://localhost:8182/graphs/titan&type=IA&name=IA_386653723
>
>
> I am able to query the vertices by their id from my browser :
>
http://localhost:8182/graphs/titan/vertices/4
> returns :
> {"version":"2.1.0","results":{"name":"IA_386653723","type":"IA","_id":4,"_type":"vertex"},"queryTime":6.840465}
>
> From gremlin console (bin/gremlin.sh), I am able to query the vertex by its
> id, but I am not able to map it (error The value is already used by another
> vertex and the key is unique)
> gremlin> v = g.v(4)
> ==>v[4]
> gremlin> v.map
> The value is already used by another vertex and the key is unique
>
>
> And I am unable to query the vertices by their name, neither from my
> browser, nor from gremlin console.
>
> From gremlin console gremlin.sh, an error NoSuchElementException is thrown :
> gremlin> ia = g.V('name', 'IA_386653723').next()
> java.util.NoSuchElementException
> Display stack trace? [yN] n
>
>
> It looks that the index I have created thtrough gremlin.sh is not taken into
> account by Rexster.
>
> Maybe it is the same problem as Renato ?
> (
https://groups.google.com/forum/?fromgroups=#!topic/gremlin-users/5dI0WObwQPE).
> In this case, I don't understand how to manage transactions with Rexster.
>
> Please, could you tell me what is wrong ?
>
> Thanks.
>
> Jean Armel
>
>
>
> --
>
>