SDK Node.deleteAll() fails (nodes still exist in database)

22 views
Skip to first unread message

appren...@googlemail.com

unread,
May 7, 2015, 12:27:21 PM5/7/15
to ne...@googlegroups.com
Hi,

Querying database immediately after calling "GraphRepository.deleteAll"  seems to return positive.  Any suggestions why this could be failing? Perhaps this is a bug? 

Spring Data Neo4j Version = 3.3.0.RELEASE
Neo4j Community Version = 2.0.2

Test Case

@Test

public void testDeleteAll() {

accountService.deleteAll();


Set<Long> ids = AppUtil.newHashSetInstance();

ids.add(new Long(1));

Set<AccountGraph> all = accountService.findAllAccountWithIds(ids);


for(AccountGraph graph: all){

System.out.println(graph);

}

assertEquals(0,all.size()); <-- this fails

}

Sumit Gupta

unread,
May 7, 2015, 2:32:11 PM5/7/15
to ne...@googlegroups.com
I find some old discussion around deleteAll(). (Thanks to Michael) 



Please see if it helps.

Thanks,
Sumit

appren...@googlemail.com

unread,
May 7, 2015, 2:49:55 PM5/7/15
to ne...@googlegroups.com
I don't see a solution in that discussion.

appren...@googlemail.com

unread,
May 7, 2015, 2:52:00 PM5/7/15
to ne...@googlegroups.com
I should add, I am using a neo4j server as opposed to the embedded database.

Sumit Gupta

unread,
May 7, 2015, 9:28:24 PM5/7/15
to ne...@googlegroups.com
can you try using deleteAll within a transaction and commit the transaction after method finishes sucessfully?

Thanks,
Sumit

JMill

unread,
May 9, 2015, 1:43:14 AM5/9/15
to ne...@googlegroups.com
Test is already running inside a transaction (save() works fine). 

--
You received this message because you are subscribed to a topic in the Google Groups "Neo4j" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/neo4j/SFnYO82447E/unsubscribe.
To unsubscribe from this group and all its topics, send an email to neo4j+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

JMill

unread,
May 9, 2015, 1:44:10 AM5/9/15
to ne...@googlegroups.com
I tried deleteAll() on another Object Type, which seems to work fine.

Michael Hunger

unread,
May 11, 2015, 5:48:27 PM5/11/15
to ne...@googlegroups.com
The only thing is if you find nodes via their neo4j-node-id then they will still be returned within the tx that they were deleted in.

Michael

You received this message because you are subscribed to the Google Groups "Neo4j" group.
To unsubscribe from this group and stop receiving emails from it, send an email to neo4j+un...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages