Hi there,
I have recently started using Orientdb (community edition 1.7.6), and I am
in the process of learning the object db api.
I have the following scenario that is bothering me:
When I pull the same object out of the database twice within one
transaction, then the two objects don't have the same reference.
The following segment of code prints out false for example:
db.begin(OTransaction.TXTYPE.OPTIMISTIC);
List<Car> list = db.query(new OSQLSynchQuery<Car>("select * from
Car where name = 'Toyota'"));
Car car = list.get(0);
List<Car> list1 = db.query(new OSQLSynchQuery<Car>("select * from
Car where name = 'Toyota'"));
Car car1 = list1.get(0);
System.out.println(car == car1);
db.commit();
Should this be the case? Should orientdb not find the object in cache and
return that reference instead of creating a new proxied object? Or am I
missing something?
All previous object db's that I have worked with would return the same
object reference if the same record is pulled out of the database twice in
one transaction.
Why does orient do it differently?
Any thoughts would be appreciated.
--
---
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.