Hi,

I have found the problem. I am caching the Vertex object of the user into 
the session, and even though i always commit somehow it doesn't sync well 
in this scenario. If I look up the vertex before running the query to get 
the updated list of friends , it works fine.

On Tuesday, February 17, 2015 at 9:39:27 AM UTC+1, Andrey Lomakin wrote:
>
> HI,
> You always commit tx even in case of rollback (you put commit in finally 
> block), but still it is strange.
> Could you provide test case which we may run and reproduce this issue ?
>
> On Mon, Feb 16, 2015 at 12:58 PM, Aris Alexis <[email protected] 
> <javascript:>> wrote:
>
>> Hi, I just started porting my app in orient and some things that were 
>> working need some debugging, I am a bit lost in this one.
>>
>> So I have a singleton :
>>
>> public class OrientDatabase implements IGraphDatabase {
>>
>>     private static OrientGraphFactory factory;
>>     private static OrientDatabase instance;
>>     private static String configuration;
>>
>>
>>     public static void setConf(String conf) {
>>         configuration=conf;
>>     }
>>     public OrientGraphFactory getFactory() {
>>         return factory;
>>     }
>>
>>     public OrientDatabase(String conf) {
>>         factory=new OrientGraphFactory(conf);
>>     }
>>
>>     public static OrientDatabase getInstance() {
>>         if (instance==null) {
>>             return new OrientDatabase(configuration);
>>         }
>>         else {
>>             return instance;
>>         }
>>     }
>>
>>     @Override
>>     public TransactionalGraph getGraph() {
>>         return this.getFactory().getTx();
>>     }
>> }
>>
>>
>> then at the start of the Jersey thread :
>>
>> TransactionalGraph g= GraphDatabaseFactory.getGraphDatabase().getGraph();
>>
>>
>> I am doing an integration test which does the following: I have a user 
>> with two friends (with edges). I delete one of them. I readd him. I get the 
>> friends list. 
>> these three actions are three different threads but are run sequentially.
>>
>> now the following code :
>>
>> Iterator<Vertex> vertexIterator= vuser.getVertices(Direction.BOTH, 
>> GraphHelper.EDGE_TYPE_FRIENDSHIP).iterator();
>>
>>
>> contains 1 entry. Select * from friends shows two edges to the correct 
>> friends.
>>
>> from the gremlin console: g.V("username","arisalexis").both("Friendship")
>>
>> I get shown both friends.
>>
>> In the end of my functions I always have:
>>
>> } catch (Exception e) {
>>     g.rollback();
>>     throw e;
>> } finally {
>>     g.commit();
>> }
>>
>>
>> any ideas?
>>
>> windows 7, java 8,orient 2.0.2
>>
>>  -- 
>>
>> --- 
>> You received this message because you are subscribed to the Google Groups 
>> "OrientDB" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to [email protected] <javascript:>.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> -- 
> Best regards,
> Andrey Lomakin.
>
>  

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"OrientDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to