Frage

Using the OrientDB library by tglman and trying to run the sample code @ https://github.com/tglman/orientdb-c/wiki/Start

https://github.com/tglman/orientdb-c

I can connect to the DB and set + retrieve a value in orientDB successfully -

However when I run a query using o_database_document_query, it does not finish executing - instead it just hangs indefinitely.

How to fix this?

Maybe there is some deadlock occurring as its a multithreaded library.

In the code, it has concepts like o_engine_get_factory and o_engine_get_storage, o_database_operation_context .....

Im not really familiar with these concepts or how that works.

Any ideas how to proceed???

War es hilfreich?

Lösung

I also debuged and found the same problem ... fixed and pushed on github!

Andere Tipps

I think you can guess who i'm(from my nickname)

the o_engine_get_factory, o_engine_get_storage ,o_database_operation_context

are three different concept:

o_engine_get_factory: is the "connection factory" based on the protocol you use, now is just supported the orient "remote"

o_engine_get_storage: is the factory for the o_storage that is the low level interface for an orient db instance.

o_datebase_operation_context: is the high level interface with the database, is used for manage the documents and client side transaction!

the actual implementation of the protocol is inside the o_storage_remote.c and o_query_engine_remote.c and i think you have to have a look to the second one to try to discover something about the problem!

what you test can you give some code example so i can reproduce/debug !!

tnks bye

tglman

I have located the bug. It occurs when retrieving the 'meta data' for the record after the query: o_database_document_query.

Here is my test code:

https://gist.github.com/willmoss/6735670

I put the socket input/output debug, so you can see where the problem lies.

https://gist.github.com/willmoss/6735553

In o_database.c , line #290 in function o_database_metadata() you have created a blank record with o_storage_get_metadata_rid .

https://github.com/tglman/orientdb-c/blob/master/src/o_database.c

Then the next line, you try to retrieve this blank record from the database with o_database_load.

The library hangs at the line int select_ret = epoll_wait(selector->epoll, events, 1, timeout); - because no information is returned from the db. Line #64.

https://github.com/tglman/orientdb-c/blob/master/src/o_native_socket_selector.c

If you look at the byte output stream that is sent to the server after RECORD_LOAD , it is just '0's , with no data (see last section).

https://gist.github.com/willmoss/6735553

Can i ask a question here. How this code has ever worked for you ? Or maybe it because of some change in the protocol. Im using OrientDB Server v1.5.1 (build @BUILD@).

Also - most important - how to fix this? :D

Cheers!

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top