jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From behrangsa <behran...@gmail.com>
Subject Re: TransientRepository bug?
Date Tue, 03 Oct 2006 23:37:05 GMT

Jukka,

But the name TransientRepository kind of implies that changes made to the
repository are gonna be lost when the program terminates... so I expected
that whenever I run the program, the repository be empty... :-)

What do you think? Shouldn't TransientRepository behave this way?

Regards,
Behi


Jukka Zitting-3 wrote:
> 
> Hi,
> 
> On 10/4/06, behrangsa <behrangsa@gmail.com> wrote:
>> Compile and run the following class:
>> [...]
>> Now, change the value of BLOG_COUNT to 20 and rerun the class. When I do
>> this, I get 20 exceptions:
>>
>> javax.jcr.PathNotFoundException: blog11
>> [...]
>> If I delete the repository directory and repository.xml and derby.log and
>> rerun the program, the exceptions fade away...
>>
>> Could someone please confirm this bug?
> 
> You probably ran the program first with BLOG_COUNT set to 10. This
> created nodes /blogs and /blogs/blogN (0 <= N < 10) and those nodes
> were persisted for the next invocation of the program. Then, when you
> ran the program again, the statement s.getRootNode().addNode("blogs")
> created a *same-name sibling* for the /blogs node, namely /blogs[2],
> after which your program created nodes /blogs[2]/blogN (0 <= N < 20).
> Thus, nodes /blogs/blogN (10 <= N < 20) were never created, causing
> your PathNotFoundExceptions.
> 
> You can solve the issue by
> a) removing the entire repository between program runs,
> b) deleting the /blogs content tree at the end of each run, or
> c) checking if the nodes being created already exist (see Node.hasNode).
> 
> BR,
> 
> Jukka Zitting
> 
> -- 
> Yukatan - http://yukatan.fi/ - info@yukatan.fi
> Software craftsmanship, JCR consulting, and Java development
> 
> 

-- 
View this message in context: http://www.nabble.com/TransientRepository-bug--tf2379243.html#a6630984
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.


Mime
View raw message