Question

I am using Titan in Spring Web app. When i add new edge, or delete a vertex its actually deleted but doesn't reflect in my web page. My query still gets the old edges or vertices.

for that to happen i have to restart my application.

I am doing g.commit() after each new addition or deletion.

Was it helpful?

Solution

Consider issuing a g.rollback() at the start of a new HTTP request to ensure you get a fresh view. That's how Rexster does things currently.

OTHER TIPS

To add to Stephen's answer:

The problem here is not the caching layers but the fact that Titan uses transactions for both read and write operations against the graph. So, what's happening here is that the write operation followed by a g.commit() successfully stores the new data in the graph, but subsequent reads occur in an old transaction (since the former read transaction wasn't committed or rolled back) and hence the changes are visible.

This is correct behavior from a transactional perspective but can be confusing when you don't think of "reads" as transactions.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top