Message from discussion
KeyError in python
Received: by 10.50.156.129 with SMTP id we1mr23480857igb.4.1325525269565;
Mon, 02 Jan 2012 09:27:49 -0800 (PST)
X-BeenThere: neo4j@googlegroups.com
Received: by 10.231.63.137 with SMTP id b9ls29091889ibi.0.gmail; Mon, 02 Jan
2012 09:27:48 -0800 (PST)
Received: by 10.50.193.133 with SMTP id ho5mr23480668igc.2.1325525268749;
Mon, 02 Jan 2012 09:27:48 -0800 (PST)
Received: by 10.50.193.133 with SMTP id ho5mr23480667igc.2.1325525268720;
Mon, 02 Jan 2012 09:27:48 -0800 (PST)
Return-Path: <ja...@voltvoodoo.com>
Received: from mail-iy0-f170.google.com (mail-iy0-f170.google.com [209.85.210.170])
by gmr-mx.google.com with ESMTPS id ai8si11289282igc.2.2012.01.02.09.27.48
(version=TLSv1/SSLv3 cipher=OTHER);
Mon, 02 Jan 2012 09:27:48 -0800 (PST)
Received-SPF: neutral (google.com: 209.85.210.170 is neither permitted nor denied by best guess record for domain of ja...@voltvoodoo.com) client-ip=209.85.210.170;
Authentication-Results: gmr-mx.google.com; spf=neutral (google.com: 209.85.210.170 is neither permitted nor denied by best guess record for domain of ja...@voltvoodoo.com) smtp.mail=ja...@voltvoodoo.com
Received: by iafj26 with SMTP id j26so29475620iaf.15
for <neo4j@googlegroups.com>; Mon, 02 Jan 2012 09:27:48 -0800 (PST)
MIME-Version: 1.0
Received: by 10.50.195.164 with SMTP id if4mr58505650igc.11.1325525268366;
Mon, 02 Jan 2012 09:27:48 -0800 (PST)
Sender: ja...@voltvoodoo.com
Received: by 10.50.57.228 with HTTP; Mon, 2 Jan 2012 09:27:48 -0800 (PST)
X-Originating-IP: [188.78.150.138]
In-Reply-To: <CAF59RW7d9h=C+G160WugiLhZWH3QDNzV_N8Etgb9+Asaqr_c4g@mail.gmail.com>
References: <CAB_xkJj3cLtFXVANS=LmVxeDVvuJ3z0iEsfqZR+z+GMrmWAj8Q@mail.gmail.com>
<CAF59RW4KNE7AiTz6-FE2J3SmVv-rDmM9ZB_xmB_vknOhTBDVgA@mail.gmail.com>
<22352071.2124.1323815517239.JavaMail.geo-discussion-forums@vbak19>
<CAF59RW7d9h=C+G160WugiLhZWH3QDNzV_N8Etgb9+Asaqr_c4g@mail.gmail.com>
Date: Mon, 2 Jan 2012 18:27:48 +0100
Message-ID: <CAOY0wOpUEPrVhntknX8CJPJMC7vxUAQja3XdJ3kcj_+0i7OCcw@mail.gmail.com>
Subject: Re: [Neo4j] KeyError in python
From: Jacob Hansson <jacob.hans...@neotechnology.com>
To: neo4j@googlegroups.com
Content-Type: multipart/alternative; boundary=14dae934032fc303a404b58ee6a7
--14dae934032fc303a404b58ee6a7
Content-Type: text/plain; charset=ISO-8859-1
Hmm..
I *think* that the problem is that you are using an older version of
neo4j-embedded, one that did not have an __iter__ method for the nodes.
Python falls back to passing numbers in order to __getitem__, which
eventually fails when it hits a node id that does not exist.
Try upgrading to the latest version of neo4j-embedded.
Also: For higher throughput when dealing with large batch operations like
this, it is usually a good idea to split the work into multiple
transactions. Ideally, each transaction should handle something like 50 000
to 100 000 inserts, passed that, performance will degrade. If you refactor
the code to use multiple transactions, performance should be significantly
better.
Let me know if it works!
jake
On Thu, Dec 29, 2011 at 10:56 AM, Peter Neubauer <
peter.neuba...@neotechnology.com> wrote:
> Mms,
> I am no python expert by any means. Maybe running it on different
> platforms is a good idea. Also, I think I have been googling for JVM
> settings with python, and you can provide them when you start the vm.
>
>
> On Tuesday, December 13, 2011, Jacopo Farina <jacopo1.far...@gmail.com>
> wrote:
> > I tried again to run the program and still got the same error, at the
> same point. I'm running it on Ubuntu 10.10, but I could try on a pc with
> Windows 7 and more RAM.
> > Cheers,
> > Jacopo
> >
>
> --
> Sent from Gmail Mobile
>
--
Jacob Hansson
Phone: +46 (0) 763503395
Twitter: @jakewins
--14dae934032fc303a404b58ee6a7
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Hmm..<br><br>I *think* that the problem is that you are using an older vers=
ion of neo4j-embedded, one that did not have an __iter__ method for the nod=
es. Python falls back to passing numbers in order to __getitem__, which eve=
ntually fails when it hits a node id that does not exist.<br>
<br>Try upgrading to the latest version of neo4j-embedded.<br><br>Also: For=
higher throughput when dealing with large batch operations like this, it i=
s usually a good idea to split the work into multiple transactions. Ideally=
, each transaction should handle something like 50 000 to 100 000 inserts, =
passed that, performance will degrade. If you refactor the code to use mult=
iple transactions, performance should be significantly better.<br>
<br>Let me know if it works!<br>jake<br><br><div class=3D"gmail_quote">On T=
hu, Dec 29, 2011 at 10:56 AM, Peter Neubauer <span dir=3D"ltr"><<a href=
=3D"mailto:peter.neuba...@neotechnology.com">peter.neuba...@neotechnology.c=
om</a>></span> wrote:<br>
<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex">Mms,<br>I am no python expert by any means. =
Maybe running it on different platforms is a good idea. Also, I think I hav=
e been googling for JVM settings with python, and you can provide them when=
you start the vm.<div class=3D"HOEnZb">
<div class=3D"h5"><br><br>On Tuesday, December 13, 2011, Jacopo Farina <=
<a href=3D"mailto:jacopo1.far...@gmail.com" target=3D"_blank">jacopo1.farin=
a...@gmail.com</a>> wrote:<br>
> I tried again to run the program and still got the same error, at the =
same point. I'm running it on Ubuntu 10.10, but I could try on a pc wit=
h Windows 7 and more RAM.<br>> Cheers,<br>> Jacopo<br>><br><br>
</div></div><span class=3D"HOEnZb"><font color=3D"#888888">
-- <br>Sent from Gmail Mobile<br>
</font></span></blockquote></div><br><br clear=3D"all"><br>-- <br>Jacob Han=
sson<br><font size=3D"1">Phone: +46 (0) 763503395<br>Twitter: @jakewins</fo=
nt><br>
--14dae934032fc303a404b58ee6a7--