[Neo4j] InvalidRecordException exception
Johan Svensson
johan at neotechnology.com
Wed Dec 15 11:44:27 CET 2010
Hi George,
Could you provide the full stacktrace for the exception.
Regards,
Johan
On Wed, Dec 15, 2010 at 11:33 AM, George Ciubotaru
<george.ciubotaru at weedle.com> wrote:
> Hi David,
>
> We've build our own REST service in front of Neo4j graph to interact with it from a different environment. The operations are simple:
> - create node (each node has a single property attach to it that define its type)
>
> ...
> Transaction tx = graphDb.beginTx();
> try
> {
> Node gNode = graphDb.createNode();
> gNode.setProperty(NodeTypeDefString, vNodetype.convertToInt());
> nodeId = gNode.getId();
>
> tx.success();
> }
> ...
> finally
> {
> tx.finish();
> }
> ...
>
> - delete node (together with all its relationships):
>
> ...
> Transaction tx = graphDb.beginTx();
> try
> {
> Node node = graphDb.getNodeById(nodeId);
> deleteNodeRelationships(node);
> node.removeProperty(NodeTypeDefString);
> node.delete();
>
> tx.success();
> }
> ...
> finally
> {
> tx.finish();
> }
> ...
>
> - create relationships
>
> ...
> Transaction tx = graphDb.beginTx();
> try
> {
> ...
> leftSideNode.createRelationshipTo(rightSideNode, relationshipType);
>
> tx.success();
> }
> ...
> finally
> {
> tx.finish();
> }
> ...
>
> - delete relationships between 2 nodes (of certain type and direction)
>
> ...
> Transaction tx = graphDb.beginTx();
> try
> {
> Iterable<Relationship> relations = leftSideNode.getRelationships(relationshipType, direction);
>
> for (Relationship relation : relations)
> {
> Node checkNode = relation.getOtherNode(leftSideNode);
> if (checkNode.getId() == rightSideNode.getId())
> {
> relation.delete();
> }
> }
> tx.success();
> }
> ...
> finally
> {
> tx.finish();
> }
> ...
>
> I'm getting the InvalidRecordException when deleting a relationship in the last case above (relation.delete()).
>
> Thanks,
> George
>
>
> -----Original Message-----
> From: user-bounces at lists.neo4j.org [mailto:user-bounces at lists.neo4j.org] On Behalf Of David Montag
> Sent: 15 December 2010 05:01
> To: Neo4j user discussions
> Subject: Re: [Neo4j] InvalidRecordException exception
>
> Hi George,
>
> Could you please provide some background info on how you created/populated your Neo4j graph?
>
> David
>
> On Tue, Dec 14, 2010 at 10:03 AM, George Ciubotaru < george.ciubotaru at weedle.com> wrote:
>
>> Hello guys,
>>
>> I'm getting "org.neo4j.kernel.impl.nioneo.store.InvalidRecordException:
>> Record[558335] not in use" exception from time to time when deleting a
>> relationship. I don't seem to find much information about this kind of
>> exception. Any idea what it means?
>>
>> Thank you,
>> George
More information about the User
mailing list