Hi,
Ok I will try meanwhile I noticed that you reused the same instance of db
for every thread. db instance is like connection to data storage and you
need to have new instance for each thread.
I will try to repeat your test, meanwhile coudl you try to change code I
suggested and try it too ?

On Fri, Sep 26, 2014 at 5:20 PM, <[email protected]> wrote:

> Sorry Andrey, no maven project, just playing with Orientdb.
> But I am attaching the 4 java files that I used to get that bug, hope that
> helps.
>
> On Friday, September 26, 2014 7:43:20 AM UTC-4, Andrey Lomakin wrote:
>>
>> Hi,
>> Could you provide test which I can run, in form of may be maven project ?
>>
>> On Thu, Sep 25, 2014 at 7:41 AM, Andrey Lomakin <[email protected]>
>> wrote:
>>
>>> Hi,
>>> You should follow https://github.com/orientechnologies/orientdb/
>>> issues/2840
>>>
>>> On Wed, Sep 24, 2014 at 10:57 PM, <[email protected]> wrote:
>>>
>>>> Hi,
>>>> I get this error - any help on this?
>>>> This is the code that is causing the exception:
>>>>
>>>> package test;
>>>> import java.text.SimpleDateFormat;
>>>> import java.util.Date;
>>>> import java.util.List;
>>>> import java.util.concurrent.*;
>>>> import com.orientechnologies.orient.core.sql.query.OSQLSynchQuery;
>>>> import com.orientechnologies.orient.object.db.OObjectDatabaseTx;
>>>> public class CustomerTest3 {
>>>>
>>>>  int  corePoolSize  =    2;
>>>>  int  maxPoolSize   =   3;
>>>>  long keepAliveTime = 500;
>>>>  public OObjectDatabaseTx db = new OObjectDatabaseTx(
>>>>    "plocal:c:/java/dbs/person").open("admin", "admin");
>>>>  public ExecutorService threadPoolExecutor =  new ThreadPoolExecutor(
>>>>             corePoolSize,
>>>>             maxPoolSize,
>>>>             keepAliveTime,
>>>>             TimeUnit.MILLISECONDS,
>>>>             new LinkedBlockingQueue<Runnable>()
>>>>             );
>>>>
>>>>
>>>>
>>>>  public  CustomerTest3() {
>>>>
>>>>
>>>>  }
>>>>  public static void main(String[] args) {
>>>>
>>>>
>>>>   CustomerTest3 ct3 = new CustomerTest3();
>>>>
>>>>   ct3.db.getEntityManager().registerEntityClasses("test");
>>>>   Future f1 = ct3.threadPoolExecutor.submit(new FutureTask<String>(
>>>>     new Callable<String>()
>>>>     {
>>>>      public String call() {
>>>>       ct3.updateCust3();
>>>>       return "done";
>>>>      }
>>>>     }));
>>>>
>>>>   Future f2 = ct3.threadPoolExecutor.submit(new FutureTask<String>(
>>>>     new Callable<String>()
>>>>     {
>>>>      public String call() {
>>>>       ct3.updateCust4();
>>>>       return "done";
>>>>      }
>>>>     }));
>>>>
>>>>
>>>> //  try {
>>>> //   if (f1.get().equals("done") && f1.get().equals("done"))
>>>> //      ct3.db.close();
>>>> //  } catch (InterruptedException e) {
>>>> //   // TODO Auto-generated catch block
>>>> //   e.printStackTrace();
>>>> //  } catch (ExecutionException e) {
>>>> //   // TODO Auto-generated catch block
>>>> //   e.printStackTrace();
>>>> //  }
>>>>
>>>>
>>>>  }
>>>>
>>>>   private void updateCust3() {
>>>>   List<Customer> result = db.query(new OSQLSynchQuery<Customer>(
>>>>     "select * from Customer where address.city like '%98%'"));
>>>>
>>>>         SimpleDateFormat sdf = new SimpleDateFormat("MMM dd,yyyy
>>>> HH:mm");
>>>>
>>>>
>>>>
>>>>   for (Customer p : result) {
>>>>    //db.begin();
>>>>
>>>>    p.setName("updated name " + sdf.format(new
>>>> Date(System.currentTimeMillis())));
>>>>
>>>>          System.out.println(sdf.format(new
>>>> Date(System.currentTimeMillis())));
>>>>
>>>>          System.out.println(p.getAddress().getCity());
>>>>          System.out.println(p.getName());
>>>>       db.save(p);
>>>>    try {
>>>>     Thread.sleep(5000);
>>>>    } catch (InterruptedException e) {
>>>>     // TODO Auto-generated catch block
>>>>     e.printStackTrace();
>>>>    }
>>>>
>>>>    //db.commit();
>>>>   }
>>>>   }
>>>>
>>>>   private void updateCust4() {
>>>>    List<Customer> result = db.query(new OSQLSynchQuery<Customer>(
>>>>      "select * from Customer where address.city like '%99%'"));
>>>>
>>>>          SimpleDateFormat sdf = new SimpleDateFormat("MMM dd,yyyy
>>>> HH:mm");
>>>>
>>>>
>>>>
>>>>       for (Customer p : result) {
>>>>
>>>>
>>>>      p.setName("updated name " + sdf.format(new
>>>> Date(System.currentTimeMillis())));
>>>>
>>>>            System.out.println(sdf.format(new
>>>> Date(System.currentTimeMillis())));
>>>>
>>>>            System.out.println(p.getAddress().getCity());
>>>>            System.out.println(p.getName());
>>>>
>>>>      try {
>>>>       Thread.sleep(1000);
>>>>      } catch (InterruptedException e) {
>>>>       // TODO Auto-generated catch block
>>>>       e.printStackTrace();
>>>>      }
>>>>      //db.begin();
>>>>      db.save(p);
>>>>      //db.commit();
>>>>     }
>>>>
>>>>    }
>>>>
>>>> }
>>>>
>>>>
>>>> /////////////////////////////////////////////////////////////////
>>>>
>>>>  Sep 24, 2014 3:48:31 PM com.orientechnologies.common.log.OLogManager
>>>> log
>>>> SEVERE: Error on fetching record during browsing. The record has been
>>>> skipped
>>>> com.orientechnologies.orient.core.exception.ODatabaseException: Error
>>>> on retrieving record #10:0 (cluster: customer)
>>>>  at com.orientechnologies.orient.core.db.raw.ODatabaseRaw.read(
>>>> ODatabaseRaw.java:288)
>>>>  at com.orientechnologies.orient.core.db.record.
>>>> ODatabaseRecordAbstract.executeReadRecord(ODatabaseRecordAbstract.java:
>>>> 905)
>>>>  at com.orientechnologies.orient.core.tx.OTransactionNoTx.
>>>> loadRecord(OTransactionNoTx.java:70)
>>>>  at com.orientechnologies.orient.core.db.record.ODatabaseRecordTx.load(
>>>> ODatabaseRecordTx.java:274)
>>>>  at com.orientechnologies.orient.core.db.record.ODatabaseRecordTx.load(
>>>> ODatabaseRecordTx.java:40)
>>>>  at com.orientechnologies.orient.core.iterator.OIdentifiableIterator.
>>>> readCurrentRecord(OIdentifiableIterator.java:285)
>>>>  at com.orientechnologies.orient.core.iterator.
>>>> ORecordIteratorClusters.begin(ORecordIteratorClusters.java:287)
>>>>  at com.orientechnologies.orient.core.iterator.ORecordIteratorClusters.
>>>> config(ORecordIteratorClusters.java:376)
>>>>  at com.orientechnologies.orient.core.iterator.
>>>> ORecordIteratorClass.<init>(ORecordIteratorClass.java:72)
>>>>  at com.orientechnologies.orient.core.sql.
>>>> OCommandExecutorSQLResultsetAbstract.searchInClasses(
>>>> OCommandExecutorSQLResultsetAbstract.java:368)
>>>>  at com.orientechnologies.orient.core.sql.OCommandExecutorSQLSelect.
>>>> searchInClasses(OCommandExecutorSQLSelect.java:657)
>>>>  at com.orientechnologies.orient.core.sql.
>>>> OCommandExecutorSQLResultsetAbstract.assignTarget(
>>>> OCommandExecutorSQLResultsetAbstract.java:128)
>>>>  at com.orientechnologies.orient.core.sql.OCommandExecutorSQLSelect.
>>>> assignTarget(OCommandExecutorSQLSelect.java:398)
>>>>  at com.orientechnologies.orient.core.sql.OCommandExecutorSQLSelect.
>>>> executeSearch(OCommandExecutorSQLSelect.java:382)
>>>>  at com.orientechnologies.orient.core.sql.OCommandExecutorSQLSelect.
>>>> execute(OCommandExecutorSQLSelect.java:349)
>>>>  at com.orientechnologies.orient.core.sql.OCommandExecutorSQLDelegate.
>>>> execute(OCommandExecutorSQLDelegate.java:60)
>>>>  at com.orientechnologies.orient.core.storage.OStorageEmbedded.
>>>> executeCommand(OStorageEmbedded.java:82)
>>>>  at com.orientechnologies.orient.core.storage.OStorageEmbedded.
>>>> command(OStorageEmbedded.java:71)
>>>>  at com.orientechnologies.orient.core.sql.query.OSQLQuery.run(
>>>> OSQLQuery.java:69)
>>>>  at com.orientechnologies.orient.core.sql.query.OSQLSynchQuery.
>>>> run(OSQLSynchQuery.java:80)
>>>>  at com.orientechnologies.orient.core.query.OQueryAbstract.
>>>> execute(OQueryAbstract.java:29)
>>>>  at com.orientechnologies.orient.core.db.record.
>>>> ODatabaseRecordAbstract.query(ODatabaseRecordAbstract.java:664)
>>>>  at com.orientechnologies.orient.core.db.ODatabaseRecordWrapperAbstract
>>>> .query(ODatabaseRecordWrapperAbstract.java:192)
>>>>  at com.orientechnologies.orient.object.db.ODatabasePojoAbstract.query(
>>>> ODatabasePojoAbstract.java:238)
>>>>  at test.CustomerTest3.updateCust3(CustomerTest3.java:75)
>>>>  at test.CustomerTest3.access$0(CustomerTest3.java:73)
>>>>  at test.CustomerTest3$1.call(CustomerTest3.java:43)
>>>>  at test.CustomerTest3$1.call(CustomerTest3.java:1)
>>>>  at java.util.concurrent.FutureTask.run(FutureTask.java:266)
>>>>  at java.util.concurrent.Executors$RunnableAdapter.
>>>> call(Executors.java:511)
>>>>  at java.util.concurrent.FutureTask.run(FutureTask.java:266)
>>>>  at java.util.concurrent.ThreadPoolExecutor.runWorker(
>>>> ThreadPoolExecutor.java:1142)
>>>>  at java.util.concurrent.ThreadPoolExecutor$Worker.run(
>>>> ThreadPoolExecutor.java:617)
>>>>  at java.lang.Thread.run(Thread.java:744)
>>>> Caused by: com.orientechnologies.common.concur.lock.OLockException:
>>>> Cannot unlock a never acquired lock
>>>>  at com.orientechnologies.orient.core.tx.OTransactionAbstract.
>>>> unlockRecord(OTransactionAbstract.java:119)
>>>>  at com.orientechnologies.orient.core.id.ORecordId.unlock(
>>>> ORecordId.java:272)
>>>>  at com.orientechnologies.orient.core.storage.impl.local.
>>>> OAbstractPaginatedStorage.readRecord(OAbstractPaginatedStorage.
>>>> java:1304)
>>>>  at com.orientechnologies.orient.core.storage.impl.local.
>>>> OAbstractPaginatedStorage.readRecord(OAbstractPaginatedStorage.
>>>> java:661)
>>>>  at com.orientechnologies.orient.core.db.raw.ODatabaseRaw.read(
>>>> ODatabaseRaw.java:282)
>>>>  ... 33 more
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> --
>>>>
>>>> ---
>>>> 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.
>>>>
>>>
>>>
>>>
>>> --
>>> 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/d/optout.
>



-- 
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/d/optout.

Reply via email to