AntonTerekhov / OrientDB-PHP

Binary protocol for OrientDB for PHP applications (Beta)
http://code.google.com/p/orient/wiki/NetworkBinaryProtocol
BSD 3-Clause "New" or "Revised" License
108 stars 23 forks source link

Fatal error: Maximum execution time of 30 seconds exceeded in OrientDBRecordDecoder.php on line 398 #39

Closed tommykennedy closed 10 years ago

tommykennedy commented 10 years ago

Hi Anton,

I am using the driver with 1.7rc1

I am doing a query on an edge and getting back an error

$records = $db->command(OrientDB::COMMAND_SELECT_SYNC, 'traverse * from #39:0');

Is the fieldtype g supported?

{"@type":"d","@rid":"#11:0","@version":3,"@class":"Process","out_processConnects":["#39:0","#39:4"],"ProcessName":"RMAIssue","@fieldTypes":"out_processConnects=g"}

It works when there is only one edge on a vertex.

Regards, Tom

AntonTerekhov commented 10 years ago

Hi, Tom.

I've quickly checked parser with your record, represented as

// {"@type":"d","@rid":"#11:0","@version":3,"@class":"Process","out_processConnects":["#39:0","#39:4"],"ProcessName":"RMAIssue","@fieldTypes":"out_processConnects=g"}
$record->content = 'Process@out_processConnects:[#39:0,#39:4],ProcessName:"RMAIssue",@fieldTypes:"out_processConnects=g"';
$record->parse();

It worked fine.

Can you please use something like

$db->setDebug(true);
$record = $db->command(OrientDB::COMMAND_SELECT_SYNC, 'traverse * from #39:0');
$db->setDebug(false);

and send me debug output?

Also, please note: this kind of error might happen if your code is dealing with huge amount of data (parser sure not the fastest thing in the world). And, I've never tested code completely with advanced graph queries.

tommykennedy commented 10 years ago

Hi Anton

Where it seems to fall down is when I use the the dbrecord->className property.

Regards, Tom

0 : 29 00 00 05 41 73 00 00 00 66 00 00 00 3a 63 6f [)...As...f...:co] 10 : 6d 2e 6f 72 69 65 6e 74 65 63 68 6e 6f 6c 6f 67 [m.orientechnolog] 20 : 69 65 73 2e 6f 72 69 65 6e 74 2e 63 6f 72 65 2e [ies.orient.core.] 30 : 73 71 6c 2e 71 75 65 72 79 2e 4f 53 51 4c 53 79 [sql.query.OSQLSy] 40 : 6e 63 68 51 75 65 72 79 00 00 00 15 74 72 61 76 [nchQuery....trav] 50 : 65 72 73 65 20 2a 20 66 72 6f 6d 20 23 33 39 3a [erse * from #39:] 60 : 30 ff ff ff ff 00 00 00 03 2a 3a 30 00 00 00 00 [0........*:0....] >request_status 0 : 00 [.] >TransactionID 0 : 00 00 05 41 [...A] >status 0 : 6c [l] >records_count 0 : 00 00 00 0b [....] >record_marker 0 : 00 00 [..] >record_type 0 : 64 [d] >record_clusterID 0 : 00 27 [.'] >record_position 0 : 00 00 00 00 [....] 0 : 00 00 00 00 [....] >record_version 0 : 00 00 00 02 [....] >record_content 0 : 00 00 00 36 [...6] 0 : 70 72 6f 63 65 73 73 43 6f 6e 6e 65 63 74 73 40 [processConnects@] 10 : 77 68 65 6e 3a 31 33 39 34 36 36 32 38 32 31 34 [when:13946628214] 20 : 33 30 74 2c 6f 75 74 3a 23 31 31 3a 30 2c 69 6e [30t,out:#11:0,in] 30 : 3a 23 31 31 3a 31 [:#11:1] >record_marker 0 : 00 00 [..] >record_type 0 : 64 [d] >record_clusterID 0 : 00 0b [..] >record_position 0 : 00 00 00 00 [....] 0 : 00 00 00 00 [....] >record_version 0 : 00 00 00 02 [....] >record_content 0 : 00 00 00 38 [...8] 0 : 50 72 6f 63 65 73 73 40 50 72 6f 63 65 73 73 4e [Process@ProcessN] 10 : 61 6d 65 3a 22 52 4d 41 49 73 73 75 65 22 2c 6f [ame:"RMAIssue",o] 20 : 75 74 5f 70 72 6f 63 65 73 73 43 6f 6e 6e 65 63 [ut_processConnec] 30 : 74 73 3a 23 33 39 3a 30 [ts:#39:0] >record_marker 0 : 00 00 [..] >record_type 0 : 64 [d] >record_clusterID 0 : 00 0b [..] >record_position 0 : 00 00 00 00 [....] 0 : 00 00 00 01 [....] >record_version 0 : 00 00 00 03 [....] >record_content 0 : 00 00 00 53 [...S] 0 : 50 72 6f 63 65 73 73 40 50 72 6f 63 65 73 73 4e [Process@ProcessN] 10 : 61 6d 65 3a 22 52 4d 41 52 65 63 65 69 76 65 22 [ame:"RMAReceive"] 20 : 2c 69 6e 5f 70 72 6f 63 65 73 73 43 6f 6e 6e 65 [,in_processConne] 30 : 63 74 73 3a 23 33 39 3a 30 2c 6f 75 74 5f 70 72 [cts:#39:0,out_pr] 40 : 6f 63 65 73 73 43 6f 6e 6e 65 63 74 73 3a 23 33 [ocessConnects:#3] 50 : 39 3a 31 [9:1] >record_marker 0 : 00 00 [..] >record_type 0 : 64 [d] >record_clusterID 0 : 00 27 [.'] >record_position 0 : 00 00 00 00 [....] 0 : 00 00 00 01 [....] >record_version 0 : 00 00 00 02 [....] >record_content 0 : 00 00 00 36 [...6] 0 : 70 72 6f 63 65 73 73 43 6f 6e 6e 65 63 74 73 40 [processConnects@] 10 : 77 68 65 6e 3a 31 33 39 34 36 36 32 38 32 31 34 [when:13946628214] 20 : 33 34 74 2c 6f 75 74 3a 23 31 31 3a 31 2c 69 6e [34t,out:#11:1,in] 30 : 3a 23 31 31 3a 32 [:#11:2] >record_marker 0 : 00 00 [..] >record_type 0 : 64 [d] >record_clusterID 0 : 00 0b [..] >record_position 0 : 00 00 00 00 [....] 0 : 00 00 00 02 [....] >record_version 0 : 00 00 00 03 [....] >record_content 0 : 00 00 00 50 [...P] 0 : 50 72 6f 63 65 73 73 40 50 72 6f 63 65 73 73 4e [Process@ProcessN] 10 : 61 6d 65 3a 22 49 6e 73 70 65 63 74 22 2c 69 6e [ame:"Inspect",in] 20 : 5f 70 72 6f 63 65 73 73 43 6f 6e 6e 65 63 74 73 [_processConnects] 30 : 3a 23 33 39 3a 31 2c 6f 75 74 5f 70 72 6f 63 65 [:#39:1,out_proce] 40 : 73 73 43 6f 6e 6e 65 63 74 73 3a 23 33 39 3a 32 [ssConnects:#39:2] >record_marker 0 : 00 00 [..] >record_type 0 : 64 [d] >record_clusterID 0 : 00 27 [.'] >record_position 0 : 00 00 00 00 [....] 0 : 00 00 00 02 [....] >record_version 0 : 00 00 00 02 [....] >record_content 0 : 00 00 00 36 [...6] 0 : 70 72 6f 63 65 73 73 43 6f 6e 6e 65 63 74 73 40 [processConnects@] 10 : 77 68 65 6e 3a 31 33 39 34 36 36 32 38 32 31 34 [when:13946628214] 20 : 33 39 74 2c 6f 75 74 3a 23 31 31 3a 32 2c 69 6e [39t,out:#11:2,in] 30 : 3a 23 31 31 3a 33 [:#11:3] >record_marker 0 : 00 00 [..] >record_type 0 : 64 [d] >record_clusterID 0 : 00 0b [..] >record_position 0 : 00 00 00 00 [....] 0 : 00 00 00 03 [....] >record_version 0 : 00 00 00 04 [....] >record_content 0 : 00 00 00 75 [...u] 0 : 50 72 6f 63 65 73 73 40 6f 75 74 5f 70 72 6f 63 [Process@outproc] 10 : 65 73 73 43 6f 6e 6e 65 63 74 73 3a 25 41 51 41 [essConnects:%AQA] 20 : 41 41 41 49 41 4a 77 41 41 41 41 41 41 41 41 41 [AAAIAJwAAAAAAAAA] 30 : 44 41 43 63 41 41 41 41 41 41 41 41 41 42 41 3d [DACcAAAAAAAAABA=] 40 : 3d 3b 2c 50 72 6f 63 65 73 73 4e 61 6d 65 3a 22 [=;,ProcessName:"] 50 : 44 69 73 70 6f 73 69 74 69 6f 6e 22 2c 69 6e 5f [Disposition",in] 60 : 70 72 6f 63 65 73 73 43 6f 6e 6e 65 63 74 73 3a [processConnects:] 70 : 23 33 39 3a 32 [#39:2] >record_marker 0 : 00 00 [..] >record_type 0 : 64 [d] >record_clusterID 0 : 00 27 [.'] >record_position 0 : 00 00 00 00 [....] 0 : 00 00 00 03 [....] >record_version 0 : 00 00 00 02 [....] >record_content 0 : 00 00 00 36 [...6] 0 : 70 72 6f 63 65 73 73 43 6f 6e 6e 65 63 74 73 40 [processConnects@] 10 : 77 68 65 6e 3a 31 33 39 34 36 36 32 38 32 31 34 [when:13946628214] 20 : 34 32 74 2c 6f 75 74 3a 23 31 31 3a 33 2c 69 6e [42t,out:#11:3,in] 30 : 3a 23 31 31 3a 34 [:#11:4] >record_marker 0 : 00 00 [..] >record_type 0 : 64 [d] >record_clusterID 0 : 00 0b [..] >record_position 0 : 00 00 00 00 [....] 0 : 00 00 00 04 [....] >record_version 0 : 00 00 00 02 [....] >record_content 0 : 00 00 00 33 [...3] 0 : 50 72 6f 63 65 73 73 40 50 72 6f 63 65 73 73 4e [Process@ProcessN] 10 : 61 6d 65 3a 22 53 68 69 70 22 2c 69 6e 5f 70 72 [ame:"Ship",in_pr] 20 : 6f 63 65 73 73 43 6f 6e 6e 65 63 74 73 3a 23 33 [ocessConnects:#3] 30 : 39 3a 33 [9:3] >record_marker 0 : 00 00 [..] >record_type 0 : 64 [d] >record_clusterID 0 : 00 27 [.'] >record_position 0 : 00 00 00 00 [....] 0 : 00 00 00 04 [....] >record_version 0 : 00 00 00 02 [....] >record_content 0 : 00 00 00 36 [...6] 0 : 70 72 6f 63 65 73 73 43 6f 6e 6e 65 63 74 73 40 [processConnects@] 10 : 77 68 65 6e 3a 31 33 39 34 36 36 32 38 32 31 34 [when:13946628214] 20 : 34 36 74 2c 6f 75 74 3a 23 31 31 3a 33 2c 69 6e [46t,out:#11:3,in] 30 : 3a 23 31 31 3a 35 [:#11:5] >record_marker 0 : 00 00 [..] >record_type 0 : 64 [d] >record_clusterID 0 : 00 0b [..] >record_position 0 : 00 00 00 00 [....] 0 : 00 00 00 05 [....] >record_version 0 : 00 00 00 02 [....] >record_content 0 : 00 00 00 36 [...6] 0 : 50 72 6f 63 65 73 73 40 50 72 6f 63 65 73 73 4e [Process@ProcessN] 10 : 61 6d 65 3a 22 54 6f 70 42 6f 78 31 22 2c 69 6e [ame:"TopBox1",in] 20 : 5f 70 72 6f 63 65 73 73 43 6f 6e 6e 65 63 74 73 [_processConnects] 30 : 3a 23 33 39 3a 34 [:#39:4]

tommykennedy commented 10 years ago

Also here is the output from the Query

{"result":[{"@type":"d","@rid":"#39:0","@version":2,"@class":"processConnects","when":"2014-03-12 22:20:21","out":"#11:0","in":"#11:1","@fieldTypes":"when=t"},{"@type":"d","@rid":"#11:0","@version":2,"@class":"Process","ProcessName":"RMAIssue","out_processConnects":[1]},{"@type":"d","@rid":"#11:1","@version":3,"@class":"Process","ProcessName":"RMAReceive","in_processConnects":[1],"out_processConnects":[1]},{"@type":"d","@rid":"#39:1","@version":2,"@class":"processConnects","when":"2014-03-12 22:20:21","out":"#11:1","in":"#11:2","@fieldTypes":"when=t"},{"@type":"d","@rid":"#11:2","@version":3,"@class":"Process","ProcessName":"Inspect","in_processConnects":[1],"out_processConnects":[1]},{"@type":"d","@rid":"#39:2","@version":2,"@class":"processConnects","when":"2014-03-12 22:20:21","out":"#11:2","in":"#11:3","@fieldTypes":"when=t"},{"@type":"d","@rid":"#11:3","@version":4,"@class":"Process","out_processConnects":[2],"ProcessName":"Disposition","in_processConnects":[1],"@fieldTypes":"out_processConnects=g"},{"@type":"d","@rid":"#39:3","@version":2,"@class":"processConnects","when":"2014-03-12 22:20:21","out":"#11:3","in":"#11:4","@fieldTypes":"when=t"},{"@type":"d","@rid":"#11:4","@version":2,"@class":"Process","ProcessName":"Ship","in_processConnects":[1]},{"@type":"d","@rid":"#39:4","@version":2,"@class":"processConnects","when":"2014-03-12 22:20:21","out":"#11:3","in":"#11:5","@fieldTypes":"when=t"},{"@type":"d","@rid":"#11:5","@version":2,"@class":"Process","ProcessName":"TopBox1","in_processConnects":[1]}]}

AntonTerekhov commented 10 years ago

Thanks, Tom.

Yes, problem is with field type "g". It's not supported.

tommykennedy commented 10 years ago

Hi Anton,

Will you be upgrading the driver or have you decided to not support any new versions of OrientDB?

The driver is great. I would really like to use it.

My other option is to go and use the rest api in PHP. Have you any advice?

Regards, Tom

AntonTerekhov commented 10 years ago

Well, Tom, to support g type I'd have to support all the graph capabilities, and this is a lot of work. And, right now I'm unable to spend it.

Best option for you, I guess, is to use REST api. Yes, its a lot slower, but at least you'll parse JSON without any problems.

tommykennedy commented 10 years ago

Thanks Anton.

Its a pity. Do you know how much slower rest is versus your binary method?

AntonTerekhov commented 10 years ago

I've measured a while ago, but I don't have this data right now.