Subject: | Batch Processing is Broken |
Getting undef's when creating nodes in batch. Testing on both 1.9M01 and 1.8 community
editions of Neo4j.
My code is broken so I used the code from the POD as well(attached below)
In the POD code I get this error:
Can't call method "get_outgoing_relationships" on an undefined value at test.pl line 18.
In my code I am getting the following(all from the same error):
Use of uninitialized value $url_components[0] in pattern match (m//) at
/opt/local/lib/perl5/site_perl/5.16.0/REST/Neo4p/Agent.pm line 185.
Job 'GraphWorker::import_assembly_fasta' died: Can't use string ("{2}") as a HASH ref while
"strict refs" in use at /opt/local/lib/perl5/site_perl/5.16.0/REST/Neo4p/Entity.pm line 289.
Job 'GraphWorker::import_assembly_fasta' died: Can't call method "_self_url" on an undefined
value at /opt/local/lib/perl5/site_perl/5.16.0/REST/Neo4p/Node.pm line 26, <GEN12> line 2.
Let me know if I can provide any more information.
(ignore the 7575, 7474 is production, 7575 is stable... ish)
Here is my test file from the POD:
use REST::Neo4p;
use REST::Neo4p::Batch;
use List::MoreUtils qw(pairwise);
REST::Neo4p->connect('http://localhost:7575');
my @bunch = map { "new_node_$_" } (1.100);
my @nodes;
batch {
my $idx = REST::Neo4p::Index->new('node','bunch');
@nodes = map { REST::Neo4p::Node->new({name => $_}) } @bunch;
pairwise { $idx->add_entry($a, name => $b) } @nodes, @bunch;
$nodes[$_]->relate_to($nodes[$_+1],'next_node') for (0..$#nodes-1);
} 'keep_objs';
$idx = REST::Neo4p->get_index_by_name('node','bunch');
($the_99th_node) = $nodes[98];
($points_to_100th_node) = $the_99th_node->get_outgoing_relationships;
($the_100th_node) = $idx->find_entries( name => 'new_node_100');