jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Thomas Auinger" <...@byteconsult.de>
Subject Session Question
Date Tue, 07 Jun 2011 09:37:01 GMT
A very basic problem has just come up (Jackrabbit 2.2.5). It seems that session.itemExists()
returns true for a newly created Node only after node.getPath() has been called.?!

Here is the code:

		Session session = prompt.getSession();
		String path = "/test";
		if (session.itemExists(path)) {
			System.out.println("removing item at " + path);
			session.removeItem(path);
		}
		Node node = session.getRootNode().addNode("test");
		System.out.println(session.itemExists(path));
		node.getPath();
		System.out.println(session.itemExists(path));

And the output is

removing item at /test
false
true

Does that make any sense at all? I know that I can get it to work by calling session.save()
after the addNode() line, but since its all the same session, it seems like a bug. Yet a bug
too fundamental to really be one... :O

The code runs with Spring Testing Framework, in-VM Repository, Session created via Springmodules
Bean

Thanks
Tom



Behalten Sie die Zukunft von Marketing und IT im Blick. Abonnieren Sie unseren Newsletter
unter http://newsletter.byteconsult.de


Mime
View raw message