Just to track it. https://github.com/orientechnologies/orientdb/issues/1952


On Fri, Jan 10, 2014 at 5:27 PM, Andrey Lomakin <[email protected]>wrote:

> Cool !
> I will fix it, at Monday.
>
>
> On Fri, Jan 10, 2014 at 5:14 PM, Markus Menner <
> [email protected]> wrote:
>
>> I just managed to make the problem reproducible:
>>
>> package com.axxelia;
>>
>> import com.orientechnologies.orient.core.config.OGlobalConfiguration;
>> import com.orientechnologies.orient.object.db.OObjectDatabaseTx;
>>
>> public class OrientDBTest {
>>  public static void main(String [] args) {
>> OGlobalConfiguration.CACHE_LEVEL1_ENABLED.setValue(false);
>>
>>  OObjectDatabaseTx db = new OObjectDatabaseTx("memory:test");
>>
>> if(!db.exists()) {
>> db.create();
>>  System.out.println("db.create()");
>> }
>>
>> db.getEntityManager().registerEntityClasses("com.axxelia.domain");
>>
>> try {
>> TestCase4.testCase(db);
>> }
>> finally {
>>  db.close();
>> }
>> }
>> }
>>
>>
>> >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
>> >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
>>
>> package com.axxelia;
>>
>> import com.axxelia.domain.*;
>> import com.orientechnologies.orient.core.record.impl.ODocument;
>> import com.orientechnologies.orient.core.sql.OCommandSQL;
>> import com.orientechnologies.orient.core.sql.query.OSQLSynchQuery;
>> import com.orientechnologies.orient.object.db.OObjectDatabaseTx;
>>
>> import java.util.List;
>>
>> public class TestCase4 {
>>  public static void testCase(OObjectDatabaseTx db) {
>> ItemWorkStep idt1 = new ItemWorkStep();
>> idt1.setStatus(Status.NONE);
>>  db.save(idt1);
>>
>> ItemWorkStep idt2 = new ItemWorkStep();
>> idt2.setStatus(Status.STARTED);
>>  db.save(idt2);
>>
>> WorkOrderWorkStep idt3 = new WorkOrderWorkStep();
>> idt3.setStatus(Status.NONE);
>>  db.save(idt3);
>>
>> WorkOrderWorkStep idt4 = new WorkOrderWorkStep();
>> idt4.setStatus(Status.STARTED);
>>  db.save(idt4);
>>
>> List<WorkOrderWorkStep> subs;
>> List<ODocument> counts;
>>
>> counts = db.query(new OSQLSynchQuery("SELECT count(*) FROM ItemWorkStep
>> WHERE status IN ['NONE', 'STARTED']"));
>> assert ((Long) (counts.iterator().next().field("count"))) == 4;
>>
>> counts = db.query(new OSQLSynchQuery("SELECT count(*) FROM
>> WorkOrderWorkStep WHERE status IN ['NONE', 'STARTED']"));
>> assert ((Long) (counts.iterator().next().field("count"))) == 2;
>>
>> db.command(new OCommandSQL("CREATE PROPERTY AdaptiveTask.status
>> STRING")).execute();
>>
>> counts = db.query(new OSQLSynchQuery("SELECT count(*) FROM
>> WorkOrderWorkStep WHERE status IN ['NONE', 'STARTED']"));
>>  assert ((Long) (counts.iterator().next().field("count"))) == 2;
>>
>> /**
>>  * create the index
>>  */
>> db.command(new OCommandSQL("CREATE INDEX AdaptiveTask.status ON
>> AdaptiveTask (status) NOTUNIQUE")).execute();
>>
>> /**
>>  * huh!! those two tests fail. if you remove the index above, they will
>> succeed!!!
>>  */
>>  counts = db.query(new OSQLSynchQuery("SELECT count(*) FROM
>> WorkOrderWorkStep WHERE status='NONE'"));
>> assert ((Long) (counts.iterator().next().field("count"))) == 1;
>>
>> counts = db.query(new OSQLSynchQuery("SELECT count(*) FROM
>> WorkOrderWorkStep WHERE status in ['NONE']"));
>> assert ((Long) (counts.iterator().next().field("count"))) == 1;
>>  }
>> }
>>
>>
>> >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
>> >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
>>
>> package com.axxelia.domain;
>>
>> public class AdaptiveTask {
>> private Status status;
>>
>>  public Status getStatus() {
>> return status;
>> }
>>
>>  public void setStatus(Status status) {
>>  this.status = status;
>> }
>> }
>>
>>
>> >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
>> >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
>>
>> package com.axxelia.domain;
>>
>> public class ItemWorkStep extends AdaptiveTask {}
>>
>>
>> >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
>> >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
>>
>> package com.axxelia.domain;
>>
>> public class WorkOrderWorkStep extends ItemWorkStep {}
>>
>>
>> >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
>> >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
>>
>>
>>  --
>>
>> ---
>> 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/groups/opt_out.
>>
>
>
>
> --
> Best regards,
> Andrey Lomakin.
>
> Orient Technologies
> the Company behind OrientDB
>
>


-- 
Best regards,
Andrey Lomakin.

Orient Technologies
the Company behind OrientDB

-- 

--- 
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/groups/opt_out.

Reply via email to