You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jackrabbit.apache.org by chokdee <bo...@gmail.com> on 2008/11/19 14:28:54 UTC

Flush Index

Hello

I am trying to synchronize my code with the index for a unit test.
It seems to be that I can not use the QueryManager immediately after adding
a node to search this node.
Is this right? 
The MultiIndex is running as a background thread and I can tell him how
often it should run. 
But can I synchronize it?

Thanks
Juergen
-- 
View this message in context: http://www.nabble.com/Flush-Index-tp20579766p20579766.html
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.


Re: Flush Index

Posted by Marcel Reutegger <ma...@gmx.net>.
Hi,

committed changes are immediately searchable by any session.

can you please be more specific about what worker-thread you mean?

regards
 marcel

chokdee wrote:
> Thank you Marcel.
> 
> And after commit? Do I have to wait until the Worker-Thread is finished?
> 
> BTW:
> Is this a standard or a jackrabbit 'feature'?
> 
> Thanks
> Juergen
> 
> 
> Marcel Reutegger wrote:
>> chokdee wrote:
>>> I don't want to commit this changes.
>>> I am using Springs AbstractTransactionalSpringContextTests to rollback my
>>> changes after running.
>>> So I need to use the index inside the same transaction. Isn't this
>>> possible?
>> no, this is not possible. jackrabbit only allows you to execute queries
>> against
>> committed changes.
>>
>> regards
>>  marcel
>>
>>
> 


Re: Flush Index

Posted by chokdee <bo...@gmail.com>.
Thank you Marcel.

And after commit? Do I have to wait until the Worker-Thread is finished?

BTW:
Is this a standard or a jackrabbit 'feature'?

Thanks
Juergen


Marcel Reutegger wrote:
> 
> chokdee wrote:
>> I don't want to commit this changes.
>> I am using Springs AbstractTransactionalSpringContextTests to rollback my
>> changes after running.
>> So I need to use the index inside the same transaction. Isn't this
>> possible?
> 
> no, this is not possible. jackrabbit only allows you to execute queries
> against
> committed changes.
> 
> regards
>  marcel
> 
> 

-- 
View this message in context: http://www.nabble.com/Flush-Index-tp20579766p20704563.html
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.


Re: Flush Index

Posted by Marcel Reutegger <ma...@gmx.net>.
chokdee wrote:
> I don't want to commit this changes.
> I am using Springs AbstractTransactionalSpringContextTests to rollback my
> changes after running.
> So I need to use the index inside the same transaction. Isn't this possible?

no, this is not possible. jackrabbit only allows you to execute queries against
committed changes.

regards
 marcel

Re: Flush Index

Posted by chokdee <bo...@gmail.com>.
Hello Marcel,

I don't want to commit this changes.
I am using Springs AbstractTransactionalSpringContextTests to rollback my
changes after running.
So I need to use the index inside the same transaction. Isn't this possible?

Thanks
Juergen


Marcel Reutegger wrote:
> 
> Hi,
> 
> chokdee wrote:
>> I am trying to synchronize my code with the index for a unit test.
>> It seems to be that I can not use the QueryManager immediately after
>> adding
>> a node to search this node.
>> Is this right? 
> 
> the query manager will always execute the query against all persisted
> changes.
> can you please double check that you called save() and committed the
> transaction
> (if there is one) before you execute the query?
> 
>> The MultiIndex is running as a background thread and I can tell him how
>> often it should run. 
>> But can I synchronize it?
> 
> what exactly do you mean with 'synchronize it'?
> 
> regards
>  marcel
> 
> 

-- 
View this message in context: http://www.nabble.com/Flush-Index-tp20579766p20662742.html
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.


Re: Flush Index

Posted by Marcel Reutegger <ma...@gmx.net>.
Hi,

chokdee wrote:
> I am trying to synchronize my code with the index for a unit test.
> It seems to be that I can not use the QueryManager immediately after adding
> a node to search this node.
> Is this right? 

the query manager will always execute the query against all persisted changes.
can you please double check that you called save() and committed the transaction
(if there is one) before you execute the query?

> The MultiIndex is running as a background thread and I can tell him how
> often it should run. 
> But can I synchronize it?

what exactly do you mean with 'synchronize it'?

regards
 marcel